Installing Apache Solr Cloud with Zookeeper

Hi Solr Learners,

This article will show you how to install Multi Node Solr Cloud in three Machines. After installing Single Node Solr you can view Solr running in your machine using UI. Follow the below steps carefully to get Solr installed in your own machine.

Solr_cloud_installation

solr_multinode_cloud

Machine 1:

1. Download Solr
To get the latest version of Apache Solr , visit solr official website

2. Download Java from Oracle site. Kindly check for Oracle website if the link is broken. Kindly check for latest version in the Oracle Site.
$ wget http://mirrors.ibiblio.org/apache/lucene/solr/4.10.3/solr-4.10.3.tgz

3. Untar Solr
$ tar -zxvf solr-4.10.3.tgz

4. Set JAVA PATH in .bashrc
$ vi .bashrc

export JAVA_HOME=/home/saravanan/jdk1.7.0_45
export PATH=$HOME/bin:$JAVA_HOME/bin:$PATH

5. Execute .bashrc 

$ source .bashrc
—————————————————————————————————–

It is best practice to add IP address and its HostName in /etc/hosts. If your network is backed by a DNS server, below changes are not needed.

$sudo vi /etc/hosts

10.0.0.2 datadotz_master
10.0.0.3 datadotz_slave1
10.0.0.8 datadotz_slave2

Enter into solr and do the steps one by one:

6. Flush the things ,that is present in data folder of collection1
rm -r example/solr/collection1/data/*

7. Copy the example folder to another name (for instance, example2)
cp -r example example2

8. Goto example2 folder
cd example2

9. Now, lets start Solr with Embedded Zookeeper using the below command 

java -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DzkRun -DnumShards=2 -jar start.jar

—————————————————————————————————————–

Machine 2

1. Download Solr
To get the latest version of Apache Solr , visit solr official website

2. Download Java from Oracle site. Kindly check for Oracle website if the link is broken. Kindly check for latest version in the Oracle Site.
$ wget http://mirrors.ibiblio.org/apache/lucene/solr/4.10.3/solr-4.10.3.tgz

3. Untar Solr
$ tar -zxvf solr-4.10.3.tgz

4. Set JAVA PATH in .bashrc
$ vi .bashrc

export JAVA_HOME=/home/saravanan/jdk1.7.0_45
export PATH=$HOME/bin:$JAVA_HOME/bin:$PATH

5. Execute .bashrc 

$ source .bashrc

—————————————————————————————————–

It is best practice to add IP address and its HostName in /etc/hosts. If your network is backed by a DNS server, below changes are not needed.

$sudo vi /etc/hosts

10.0.0.2 datadotz_master
10.0.0.3 datadotz_slave1
10.0.0.8 datadotz_slave2

Enter into solr and do the steps one by one:

6. Flush the things ,that is present in data folder of collection1
rm -r example/solr/collection1/data/*

7. Copy the example folder to another name (for instance, example2)
cp -r example example2

8. Goto example2 folder
cd example2

9. Start Solr in this machine with Zookeeper IP
java -Djetty.port=7574 -DzkHost=datadotz_master:9983 -jar start.jar

—————————————————————————————————————–

Machine 3

1. Download Solr
To get the latest version of Apache Solr , visit solr official website

2. Download Java from Oracle site. Kindly check for Oracle website if the link is broken. Kindly check for latest version in the Oracle Site.
$ wget http://mirrors.ibiblio.org/apache/lucene/solr/4.10.3/solr-4.10.3.tgz

3. Untar Solr
$ tar -zxvf solr-4.10.3.tgz

4. Set JAVA PATH in .bashrc
$ vi .bashrc

export JAVA_HOME=/home/saravanan/jdk1.7.0_45
export PATH=$HOME/bin:$JAVA_HOME/bin:$PATH

5. Execute .bashrc 

$ source .bashrc

—————————————————————————————————–

It is best practice to add IP address and its HostName in /etc/hosts. If your network is backed by a DNS server, below changes are not needed.

$sudo vi /etc/hosts

10.0.0.2 datadotz_master
10.0.0.3 datadotz_slave1
10.0.0.8 datadotz_slave2

Enter into solr and do the steps one by one:

6. Flush the things ,that is present in data folder of collection1
rm -r example/solr/collection1/data/*

7. Copy the example folder to another name (for instance, example2)
cp -r example example2

8. Goto example2 folder
cd example2

9. Start Solr in this machine with Zookeeper IP
java -Djetty.port=7574 -DzkHost=datadotz_master:9983 -jar start.jar

—————————————————————————————————————–
Solr Cloud is created with Zookeeper in a machine.

Web UI:

Browser : http://datadotz_master:8983

(Click the cloud option on left of UI. It will give us some information about the cloud)

———————————-

Article written by DataDotz Team

DataDotz is a Chennai based BigData Team primarily focussed on consulting and training on technologies such as Apache Hadoop, Apache Spark , NoSQL(HBase, Cassandra, MongoDB), Search and Cloud Computing.

Note: DataDotz also provides classroom based Apache Kafka training in Chennai. The Course includes Cassandra , MongoDB, Scala and Apache Spark Training. For more details related to Apache Spark training in Chennai, please visit http://datadotz.com/training/