There are several configuration files that need to be set up for ZooKeeper.
Extract the ZooKeeper configuration files to a temporary directory.
The files are located in the
configuration_files/zookeeperdirectories where you decompressed the companion files.Modify the configuration files.
In the respective temporary directories, locate the following files and modify the properties based on your environment. Search for
TODOin the files for the properties to replace.Edit
zoo.cfgand modify the following properties:dataDir=$zk.data.directory.path
server.1=$zk.server1.full.hostname:2888:3888
server.2=$zk.server2.full.hostname:2888:3888
server.3=$zk.server3.full.hostname:2888:3888
Edit the
hbase-site.xmland modify the following properties:<property> <name>hbase.zookeeper.quorum</name> <value>$zk.server1.full.hostname,$zk.server2.full.hostname,$zk.server3.full.hostname</value> <description>Comma separated list of Zookeeper servers (match to what is specified in zoo.cfg but without portnumbers)</description> </property>
Copy the configuration files
On all hosts create the config directory:
rm -r $ZOOKEEPER_CONF_DIR ; mkdir -p $ZOOKEEPER_CONF_DIR ;
Copy all the ZooKeeper configuration files to the
$ZOOKEEPER_CONF_DIRdirectory.Set appropriate permissions:
chmod a+x $ZOOKEEPER_CONF_DIR/; chown -R $ZOOKEEPER_USER:$HADOOP_GROUP $ZOOKEEPER_CONF_DIR/../ ; chmod -R 755 $ZOOKEEPER_CONF_DIR/../
where:
$ZOOKEEPER_CONF_DIRis the directory to store the ZooKeeper configuration files. For example,/etc/zookeeper/conf.$ZOOKEEPER_USERis the user owning the ZooKeeper services. For example,zookeeper.

