Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

namenode HA and hdfs zkfc -formatZK -force

Solved Go to solution
Highlighted

namenode HA and hdfs zkfc -formatZK -force

hi all

 

 

 

We are performing now the change hostname configuration on production cluster according to the document - https://docs.cloudera.com/HDPDocuments/Ambari-2.7.0.0/administering-ambari/content/amb_changing_host...

 

The last stage is talking about – "in case NameNode HA enabled , then need to run the following command on one of the name node"

 

 

hdfs zkfc -formatZK -force

 

 

since we have active name node and standby name node we assume that our namenode is HA enable ?

 

Capture.PNG

 

but we want to understand  what are the risks when doing the following cli on one of the namenode

 

hdfs zkfc -formatZK -force

 

is the below command is safety to run without risks ?

Michael-Bronson
1 ACCEPTED SOLUTION

Accepted Solutions

Re: namenode HA and hdfs zkfc -formatZK -force

Mentor

@mike_bronson7 

Always stick to the Cloudera documentation. Yes !!! there is no risk in running that command I can understand your reservation.

 

View solution in original post

3 REPLIES 3
Highlighted

Re: namenode HA and hdfs zkfc -formatZK -force

Cloudera Employee

Hello @mike_bronson7 

 

No need to run "hdfs zkfc -formatZK -force" if you are not changing the hostname of the HDFS components like NameNode, FailoverController or ZooKeeper hosts in the cluster. 

 

The command "hdfs zkfc -formatZK" is used to initialize the HA state in ZooKeeper. This will create a znode in ZooKeeper in which the automatic failover system stores its data.

 

The example below shows the HA znode output where it stores the name of the Active NN in the cluster.

 

 

[zk: localhost:2181(CONNECTED) 3] ls /hadoop-ha/ns1
[ActiveBreadCrumb, ActiveStandbyElectorLock] <=== HA znodes in zookeeper 
[zk: localhost:2181(CONNECTED) 2] get /hadoop-ha/ns1/ActiveBreadCrumb

ns1
namenode39%nightly63x-2.nightly63x.root.hwx.site ?>(?>  <==== Active NN hostname
[zk: localhost:2181(CONNECTED) 3] 

 

 

The command "hdfs zkfc -formatZK -force" needs to run after the ZK Service is UP and running post hostname changes. 

Highlighted

Re: namenode HA and hdfs zkfc -formatZK -force

you said that not need to run it , but the post that I mentioned say to run it , so what is right 

Michael-Bronson

Re: namenode HA and hdfs zkfc -formatZK -force

Mentor

@mike_bronson7 

Always stick to the Cloudera documentation. Yes !!! there is no risk in running that command I can understand your reservation.

 

View solution in original post

Don't have an account?
Coming from Hortonworks? Activate your account here