Database Reference
In-Depth Information
You need to add to these a section at the bottom of the file to define the port ranges used by ZooKeeper clients
on each of the servers. For instance, on server hc1r1m1, the port range for ZooKeeper server 1 is 60050 to 61050. That
allows for 1,000 client connections per ZooKeeper server.
server.1=hc1r1m1:60050:61050
server.2=hc1r1m2:60050:61050
server.3=hc1r1m3:60050:61050
#server.4=hc1nn:60050:61050
Note also that you have three servers defined and a fourth set up, but commented out to ensure that there will be
an odd number of ZooKeeper instances to form a quorum. Now, you initialize the Hadoop V2 installation:ZooKeeper
installation:
service zookeeper-server init
Edit the files /var/lib/zookeeper/myid on each server, entering integer numbers to match the configuration file.
For instance, for the setup on hc1r1m1, you add a “1” to the file, and so on. This allows each ZooKeeper server to
determine its ID number and so recognize its port range from the configuration file.
You now start ZooKeeper on hc1r1m1, hc1r1m2, and hc1r1m3, using the service command:
service zookeeper-server start
JMX enabled by default
Using config: /etc/zookeeper/conf/zoo.cfg
Starting zookeeper ... STARTED
Under /var/log/zookeeper / , you check the logs to ensure everything is running correctly:
-rw-r--r--. 1 zookeeper zookeeper 21450 Mar 20 18:54 zookeeper.log
-rw-r--r--. 1 zookeeper zookeeper 0 Mar 20 18:50 zookeeper.out
You'll likely see errors indicating that the servers can't reach each other, meaning that the firewall is interfering
again. You need to open the ports that ZooKeeper uses and then restart both Iptables and the ZooKeeper server for
the changes to be picked up. If you are unsure how to configure your firewall, approach your systems administrator.
[root@hc1r1m3 conf]# service zookeeper-server restart
Restarting ZooKeeper daemon: JMX enabled by default
Using config: /etc/zookeeper/conf/zoo.cfg
Stopping zookeeper ... STOPPED
JMX enabled by default
Using config: /etc/zookeeper/conf/zoo.cfg
Starting zookeeper ... STARTED
After you restart all of the ZooKeeper servers, they now will run as desired and will contain no errors in their log
files, as shown:
2014-03-20 19:09:34,011 [myid:3] - INFO
[QuorumPeer[myid=3]/0.0.0.0:2181:Environment@100] - Server
environment:os.arch=i386
2014-03-20 19:09:34,012 [myid:3] - INFO
[QuorumPeer[myid=3]/0.0.0.0:2181:Environment@100] - Server
Search WWH ::




Custom Search