Database Reference
In-Depth Information
<value>node1.hcluster:2181, node2.hcluster:2181,
node3.hcluster:2181</value>
</property>
7. Initialize the
High Availability
(
HA
) state in ZooKeeper using the following
command from one of the namenodes:
$ hdfs zkfc -formatZK
This command creates a znode in ZooKeeper, which is used by the automatic fail-
over system to store its data.
8. Restart all Hadoop daemons on all the nodes using the following command:
$ for x in 'cd /etc/init.d; ls hadoop*'; do sudo
service $x start; done
9. Start the ZooKeeper failover controller on the machines hosting the namenodes
using the following command:
$ sudo service hadoop-hdfs-zkfc start
Your cluster is now configured for automatic failover. You can test this configuration by
manually killing the active the namenode using
kill -9
to see if the failover occurs.