Configuring SolrCloud
Use the following procedure to configure SolrCloud.
Download the
solr_for_audit_setup_v3
file to the/usr/local/
directory:wget https://issues.apache.org/jira/secure/attachment/12761323/solr_for_audit_setup_v3.tgz -O /usr/local/solr_for_audit_setup_v3.tgz
Use the following commands to switch to the
/usr/local/
directory and extract thesolr_for_audit_setup_v3
file.cd /usr/local tar xvf solr_for_audit_setup_v3.tgz
The contents of the .tgz file will be extracted into a
/usr/local/solr_for_audit_setup
directory.Use the following command to switch to the
/usr/local/solr_for_audit_setup
directory.cd /usr/local/solr_for_audit_setup
Use the following command to open the
install.properties
file in the vi text editor.vi install.properties
Set the following property values, then save the changes to the
install.properties
file.Table 4.2. Solr install.properties Values
Property Name Value Description JAVA_HOME <path_to_jdk>, for example: /usr/jdk64/jdk1.8.0_40
Provide the path to the JDK install folder. For Hadoop, you can check /etc/hadoop/conf/hadoop-env.sh
for the value of JAVA_HOME. As noted previously, Solr only supports JDK 1.7 and higher.SOLR_USER solr The Linux user used to run Solr. SOLR_INSTALL_FOLDER /opt/lucidworks-hdpsearch/solr The Solr installation directory. SOLR_RANGER_HOME /opt/lucidworks-hdpsearch/solr/ranger_audit_server The location where the Ranger-related configuration and schema files will be copied. SOLR_RANGER_PORT 6083 The Solr port for Ranger. SOLR_DEPLOYMENT solrcloud The deployment type. SOLR_ZK <ZooKeeper_host>:2181/ranger_audits The Solr ZooKeeper host and port. It is recommended to provide a sub-folder to create the Ranger Audit related configurations so you can also use ZooKeeper for other Solr instances. Due to a Solr bug, if you are using a path (sub-folder), you can only specify one ZooKeeper host. SOLR_SHARDS 1 If you want to distribute your audit logs, you can use multiple shards. Make sure the number of shards is equal or less than the number of Solr nodes you will be running. SOLR_REPLICATION 1 It is highly recommend that you set up at least two nodes and replicate the indexes. This gives redundancy to index data, and also provides load balancing of Solr queries. SOLR_LOG_FOLDER /var/log/solr/ranger_audits The folder for the Solr log files. SOLR_MAX_MEM 2g The memory allocation for Solr. Use the following command to run the set up script.
./setup.sh
Run the following command only once from any node. This command adds the Ranger Audit configuration (including
schema.xml
) to ZooKeeper./opt/lucidworks-hdpsearch/solr/ranger_audit_server/scripts/add_ranger_audits_conf_to_zk.sh
Log in as the
solr
orroot
user and run the following command to start Solr on each node./opt/lucidworks-hdpsearch/solr/ranger_audit_server/scripts/start_solr.sh
When Solr starts, a confirmation message appears.
Started Solr server on port 6083 (pid=). Happy searching!
Run the following command only once from any node. This command creates the Ranger Audit collection.
/opt/lucidworks-hdpsearch/solr/ranger_audit_server/scripts/create_ranger_audits_collection.sh
You can use a web browser to open the Solr Admin Console at the following address:
http:<solr_host>:6083/solr
Note | |
---|---|
You can use the following command to stop Solr: /opt/lucidworks-hdpsearch/solr/ranger_audit_server/scripts/stop_solr.sh |