Any command to get active namenode for nameservice in hadoop?

后端 未结 10 1442
情歌与酒
情歌与酒 2020-12-13 22:08

The command:

hdfs haadmin -getServiceState machine-98

Works only if you know the machine name. Is there any command like:

h         


        
10条回答
  •  鱼传尺愫
    2020-12-13 22:21

    I found the below when i simply typed 'hdfs' and found a couple of helpful commands, which could be useful for someone who could maybe come here seeking for help.

    hdfs getconf -namenodes
    

    This above command will give you the service id of the namenode. Say, hn1.hadoop.com

    hdfs getconf -secondaryNameNodes
    

    This above command will give you the service id of the available secondary namenodes. Say , hn2.hadoop.com

    hdfs getconf -backupNodes
    

    This above command will get you the service id of backup nodes, if any.

    hdfs getconf -nnRpcAddresses
    

    This above command will give you info of name service id along with rpc port number. Say, hn1.hadoop.com:8020

                                      You're Welcome :)
    

提交回复
热议问题