In this short blog I will discuss on getconf class of hdfs.
This class lists the configuration as listed in the configuration file
It can be used to get details on namenodes, secondarynamenode, backupnode etc
General syntax of the utility is as follows
hdfs getconf <item_to_get>
Below is the help
[hdfs@nn logs]$ hdfs getconf
hdfs getconf is utility for getting configuration information from the config file.
hadoop getconf
[-namenodes] gets list of namenodes in the cluster.
[-secondaryNameNodes] gets list of secondary namenodes in the cluster.
[-backupNodes] gets list of backup nodes in the cluster.
[-includeFile] gets the include file path that defines the datanodes that can join the cluster.
[-excludeFile] gets the exclude file path that defines the datanodes that need to decommissioned.
[-nnRpcAddresses] gets the namenode rpc addresses
[-confKey [key]] gets a specific key from the configuration
Examples
1. Get Namenodes list
[hdfs@nn logs]$ hdfs getconf -namenodes
nn
2. Get SecondaryNamenodes list
[hdfs@nn logs]$ hdfs getconf -secondaryNameNodes
snn
3. Get Details of include file
[hdfs@nn logs]$ hdfs getconf -includeFile
/etc/hadoop/conf/dfs.hosts.include
4. Get specific key - replication
[hdfs@nn logs]$ hdfs getconf -confKey dfs.replication
3
5. Get specific key - blocksize
[hdfs@nn logs]$ hdfs getconf -confKey dfs.blocksize
134217728
This class lists the configuration as listed in the configuration file
It can be used to get details on namenodes, secondarynamenode, backupnode etc
General syntax of the utility is as follows
hdfs getconf <item_to_get>
Below is the help
[hdfs@nn logs]$ hdfs getconf
hdfs getconf is utility for getting configuration information from the config file.
hadoop getconf
[-namenodes] gets list of namenodes in the cluster.
[-secondaryNameNodes] gets list of secondary namenodes in the cluster.
[-backupNodes] gets list of backup nodes in the cluster.
[-includeFile] gets the include file path that defines the datanodes that can join the cluster.
[-excludeFile] gets the exclude file path that defines the datanodes that need to decommissioned.
[-nnRpcAddresses] gets the namenode rpc addresses
[-confKey [key]] gets a specific key from the configuration
Examples
1. Get Namenodes list
[hdfs@nn logs]$ hdfs getconf -namenodes
nn
2. Get SecondaryNamenodes list
[hdfs@nn logs]$ hdfs getconf -secondaryNameNodes
snn
3. Get Details of include file
[hdfs@nn logs]$ hdfs getconf -includeFile
/etc/hadoop/conf/dfs.hosts.include
4. Get specific key - replication
[hdfs@nn logs]$ hdfs getconf -confKey dfs.replication
3
5. Get specific key - blocksize
[hdfs@nn logs]$ hdfs getconf -confKey dfs.blocksize
134217728
No comments:
Write comments