3. Starting Solr in Cloud Mode with Embedded Zookeeper: Interactive Script Method
Apache Solr Tutorial
- Apache Solr6 Download & Installation
- Starting Solr in Standalone Mode
- Starting Solr in Cloud Mode with Embedded Zookeeper
- External ZooKeeper 3.4.6: Download & Installation
- Solr cloud mode with External Zookeeper on a Single Machine
- Solr cloud mode with External Zookeeper on different Machines
SolrCloud is designed to provide a fault tolerant, scalable and highly available environment for created web application that can index the data for searching. This can be done by distributing your indexed content at different servers and querying user’s requests across those multiple servers.
Your information is indexed and stored in “collections” which is then distributed to a group of machines that work together to provide storage and search results which is called a SolrCloud Cluster.
An embedded Zookeeper server is also bundled with Solr that helps to manage the overall structure so that both indexing and search requests can be routed properly.
1. Starting SolrCloud
To launch Solr in Cloud mode with an embedded Zookeeper run the following command:
$bin/solr -e cloud
This starts an interactive session which takes us through the easy steps of setting up a simple SolrCloud cluster with embedded Zookeeper. All of the defaults will be fine.
Now, we have to give two port numbers to the created nodes for our SolrCloud cluster.
We can provide the name to create a new collection or choose to use the previously created collection.
You can visit http://localhost:8983/solr to check the status of SolrCloud.
After logging into SolrCoud GUI, we can check the number of shards and replicas created in the Graph section.
2. Posting Documents in a Collection
We can post the documents to be indexed into your collection by giving following command,
$ ./bin/post -c Collection1 example/exampledocs/*xml
3. Running Query on the Documents
We can query the documents in our collection by giving input in -q parameter.
After running the query we will get the results in the form of fields as described in the chosen configuration or schema.