Ansible role to install Apache Solr 7 on RHEL servers and set-up Solr cores
This role is capable of deploying Solr in the following configurations:
- Standalone: a single Solr instance
It is assumed that Java and HTTPD are installed on the host system.
If you have project-specific Solr configuration files, they should be placed in the files
role directory inside a sub-directory named projname_solr-conf
, where projname
is an identifier you choose to represent the custom config files for this project.
solr_version
- defines the version of Solr to use (e.g. 4.2.0, etc.)solr_url
- defines the URL to download Solrsolr_user
- defines the user to own Solr files and run the Solr processsolr_service_name
- defines the name of the Solr processsolr_install_dir
- defines the top-level directory where Solr will be installedsolr_base_dir
- defines the full path where Solr is installedsolr_data_dir
- defines the full path where the Solr indexes/cores will residesolr_port
- defines the network port the Solr process will bind tosolr_config_file
- defines the path to the Solr installation configuration filesolr_java_min_mem
- defines the Solr process minimum memory allocationsolr_java_max_mem
- defines the Solr process maximum memory allocationsolr_cores
- the dictionary list of all Solr cores to be used in this instanceident
- defines the names of the cores to configure within this Solr instancetype
- defines the project name used to reference which custom solr configs to use (e.g. default, drupal, hyrax etc).- the
type
variable is used in conjunction with application specific solr configuration files. You will need to manually put the appropriate files in thefiles
directory for this role.- the naming convention for solr configuration files is:
projname_solr-conf
- for example, if your
type
is set to drupal, then the custom solr config file dir should be named:drupal_solr-conf
- the naming convention for solr configuration files is:
- the
- uclalib_role_rhel7repos
- uclalib_role_java
- uclalib_role_apache
solr_cores:
- ident: core1
type: default
- ident: core2
type: drupal
- ident: core3
type: hyrax
The variable definitions should be placed in the playbook under the vars
statement.
Example:
---
- name: uclalib_solr.yml
sudo: true
hosts: test
vars:
solr_cores:
- ident: core1
type: default
- ident: core2
type: drupal
- ident: core3
type: hyrax
roles:
- { role: uclalib_role_java, oracle_java_version: '1.8.0_181' }
- { role: uclalib_role_apache }
- { role: uclalib_role_solr, solr_version: '7.4.0' }