The HBase cluster is installed, and the HBase cluster can be successfully started by using its own installed zookeeper cluster when the problem with its built-in zookeeper cluster fails to resolve.
1, in the/home/instal directory, decompression zookeeper-3.4.6 to the directory
TAR-ZXVF zookeeper-3.4.6.tar.gz-c/home/instal
2. Copy the zoo_sample.cfg under zookeeper-3.4.6/conf and rename it to Zoo.cfg
CP Zoo_sample.cfg Zoo.cfg
Next, add the following configuration in Zoo.cfg:
server.1=slaves7:2888:3888
server.2=slaves8:2888:3888
server.3=slaves9:2888:3888
Datadir=/home/install/zookeeper-3.4.6-data
Create a new Zookeeper-3.4.6-data, create a new myID file under the folder, edit the myID file, and enter the corresponding number on the corresponding IP machine. such as in Slaves7, myID content is 1, on SLAVES8, myID content is 2, each machine above want a change.
3. Copy the configured zookeeper-3.4.6 and Zookeeper-3.4.6-data to the remaining zookeeper cluster sub-nodes:
$ scp-r zookeeper-3.4.6 slaves8:/home/install/
$ scp-r Zookeeper-3.4.6-data slaves8:/home/install/
$ scp-r zookeeper-3.4.6 slaves9:/home/install/
$ scp-r Zookeeper-3.4.6-data slaves9:/home/install/
and make the corresponding server number modification in the corresponding myID file.
4. The zookeeper cluster built into the HBase cluster is changed to its own installed zookeeper cluster. The configuration file for HBase needs to be changed:
Hbase-env.sh:
Change export hbase_manages_zk=true to: Export Hbase_manages_zk=false
Hbase_site.xml: Comment out the following sections
<!--<property>
Set the Hbase.zookeeper.property.dataDir property to get rid of the directory address where the zookeeper holds the data.
The default value is/tmp, which is deleted by the operating system when it is restarted and can be modified
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/qiao/zookeeper_data</value>
</property>
(The two files on each hbase node are modified accordingly)
5. Start zookeeper machine to zookeeper-3.4.6/bin/zkserver.sh start
Close command: zookeeper-3.4.6/bin/zkserver.sh stop
Zookeeper cluster installation (HBase cluster is installed)