First download the solr-5.3.1.tgz as before, and then execute the following command to release the file and place it in the/usr/directory:
tar -xvzf solr-5.3. 1 mv solr-5.3. 1 /usr//usr/solr-5.3. 1
this time do not have to start SOLR, because the standalone mode in order to maintain and before the common use of external zookeeper, but zookeeper also run in stand-alone mode, this time and before the same download zookeeper, and then released to the specified directory, operation as follows:
mkdir /usr/tar -xzvf zookeeper-3.4. 6. Tar mv zookeeper-3.4. 6 /usr//usr/zookeeper/zookeeper-3.4. 6
Now that the release is complete, and then compile the zoo.cfg configuration file under the Conf directory, the default file name is zoo_sample.cfg need to rename the operation, execute the following command:
mv conf/zoo_sample.cfg conf/zoo.cfg$ vim conf/zoo.cfg
After opening, you can see that there are a lot of configuration information, according to the official documentation, the others are the default, just modify the DataDir data storage directory, the default is/tmp/zookeeper, for unified storage, this is changed to/usr/zookeeper/data
Modify finish save exit, and then create data directory
mkdir /usr/zookeeper/data
Once you've created the data catalog, you're ready to start zookeeper.
Bin/zkserver. SH start
After starting the Zookeeper service, then go to the SOLR installation directory, start using cluster mode, just the way of the pseudo-cluster, according to the official documentation instructions to start as follows:
BIN/SOLR start-e cloud-z localhost:2181 -noprompt
Just a moment. SOLR starts normally, by default the boot port is 8983 and 7574, but when combined with zookeeper only start 8983 port, we can also manually add another port to the Zookeeper service, here by default is a, now access to the URL can be accessed, Now there is no data set, then upload the configuration file:
./server/scripts/cloud-scripts/zkcli. sh -zkhost localhost:2181 -cmd upconfig-confname my_new_config-confdir server/solr/configsets/ Sample_techproducts_configs/conf
This uploads the configuration file to zookeeper, and then sets up the dataset, which can be set up via the Curl command or by accessing the URL, and the Curl command is as follows:
" http://localhost:8983/solr/admin/collections?action=create&name=my_collection&numshards=1& Replicationfactor=1&collection.configname=my_new_config"
Now create a dataset called My_collection, using the configuration is My_new_config, note that the number of shards numshards and the number of replicas Replicationfactor can only be 1, because the node only one, So it can only be distributed on a single node, this time by clicking on the cloud->graph of the management interface to see the structure of the set up data set
Multiple collection are created here, and now you can add indexes and queries to SOLR, and the configuration file uses the default, If you need to be able to configure your own new Schema.xml file update zookeeper, the above is the configuration process of SOLR with zookeeper standalone environment
SOLR Standalone Environment configuration