Creating Solr Cloud part 1 – zookeeper ensemble

Standard

Solr is a useful full text search tool. Think Google. It helps you to easily search for contents you want. Today I want to cover how to set up the zookeeper ensemble

  • Get 3 instances in AWS / GCE. for this example we use ubuntu OS
  • We are not using the ubuntu zookeeper, as i find out it is not working well. download the JDK file using this command
    1. wget http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz
  • go to /etc/environment document and add in the new java bin
    1. PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/jdk1.8.0_91/bin”

  • ensure that your java version is 1.8 and above
  • download zookeeper
    1. wget http://download.nus.edu.sg/mirror/apache/zookeeper/stable/zookeeper-3.4.8.tar.gz
  • unzip it, and rename zoo_sample.cfg to zoo.cfg in the conf folder
  • copy / paste this. the dataDir can be the directory of your choice
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/zookeeper/data
clientPort=2181
server.1=<hostname1>:2888:3888
server.2=<hostname2>:2888:3888
server.3=<hostname3>:2888:3888
  • at the  dataDir, create this file myid. Chmod it to 777. Key in one value called 1. Why 1? because of your zoo.cfg settings, which you set server.1 as your first server
  • do the same for the other 2 servers, except the myid file must change accordingly to 2 and 3
  • lastly run bin/zkServer.sh start

Once you run the zookeeper, you can tell that it is running by this command ps -ef | grep zoo

do note to tell iptables or security groups to keep port 2888 and 3888 open

Advertisements