Skip to main content
dhirajk
Gold ⭐️
Oct 19, 2017 11:09 PM UTC
Solved

How to Run hdfs zkfc -formatZK in a Kerberos-Enabled Hadoop Cluster

To reset ZKFC we have to stop both the ZKFC processes and run the following command as the hdfs super user : hdfs zkfc –formatZK

Is this same for Kerberos enabled environment?

Do we need to stop all HDFS Services and failover control?

Where do we need to run this command in NN or anywhere?

HDP Version - 2.4.3

Thanks in advance.

bandarusridhar1
Gold ⭐️
Oct 20, 2017 1:37 AM UTC

@Dhiraj

Yes, it will be the same for even Kerberos environment and you need to have valid hdfs keytab before running the command.

Execute the following command on NN1:

hdfs zkfc -formatZK

This command creates a znode in ZooKeeper. The automatic failover system stores uses this znode for data storage.

Try this in lower environments before trying in prod.

Whats the reason to format znode?

3 replies

bandarusridhar1
Gold ⭐️
Oct 20, 2017 1:37 AM UTC

@Dhiraj

Yes, it will be the same for even Kerberos environment and you need to have valid hdfs keytab before running the command.

Execute the following command on NN1:

hdfs zkfc -formatZK

This command creates a znode in ZooKeeper. The automatic failover system stores uses this znode for data storage.

Try this in lower environments before trying in prod.

Whats the reason to format znode?

Translate
dhirajk
dhirajkAuthor
Gold ⭐️
Oct 20, 2017 3:10 AM UTC

Reason for format ZKFC is, Adding service rpc port property in NN: Please look for service rpc port in below link.

https://community.hortonworks.com/articles/43838/scaling-the-hdfs-namenode-part-1.html

Translate
bandarusridhar1
Gold ⭐️
Oct 20, 2017 8:21 AM UTC
@Dhiraj

I hope your just changing the ports here. Already rpc calls should be enabled on the cluster. If thats the case "Changing the service RPC port settings requires a restart of the NameNodes, DataNodes and ZooKeeper Failover Controllers to take full effect. If you have NameNode HA setup, you can restart the NameNodes one at a time followed by a rolling restart of the remaining components to avoid cluster downtime."

Hope this helps you.

Translate