You can replace a ZooKeeper Role on an unmanaged cluster, using command
line.
These instructions assume you are using ZooKeeper from the command line.
-
Stop the ZooKeeper role on the old host.
-
Confirm the ZooKeeper Quorum elected a leader.
-
Add a new ZooKeeper role on the new server.
-
Identify the
dataDir
locatiom from the
zoo.cfg
file.
This default to /var/lib/zookeeper
.
-
Identify the ID number for the ZooKeeper Server from the
myid
file in the configuration:
cat/var/lib/zookeeper/myid
.
-
On all the ZooKeeper hosts, edit the
zoo.cfg
file, so the
server ID references the new server hostname.
For
example:
server.1=zk1.example.org:3181:4181 server.2=zk2.example.org:3181:4181 server.4=zk4.example.org:3181:4181
-
Restart the ZooKeeper hosts.
-
Confirm the ZooKeeper Quorum elected a leader and the other hosts are
followers.
-
Restart any dependent services, such as HBase, HDFS Failover Controllers with
HDFS High Availability, or YARN with High Availability.
-
Perform a failover to make on HDFS NameNode active.