'Create flag in HDFS that represent the active namenode in Hadoop?
I just wondering , if somewhere in HDFS , we can find some signature file that help us to know which is the active name-node ?
if not we can create a flag as file in HDFS , and this flag will get the active name-node machine , for example by the following API that will runs from Linux Cron Job each min
> curl 'http://172.20.11.177:50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus'
{
"beans" : [ {
"name" : "Hadoop:service=NameNode,name=NameNodeStatus",
"modelerType" : "org.apache.hadoop.hdfs.server.namenode.NameNode",
"State" : "active",
"NNRole" : "NameNode",
"HostAndPort" : "localhost:19000",
"SecurityEnabled" : false,
"LastHATransitionTime" : 0
} ]
# "State" is "initializing", "active", "standby" or "stopping".
# "LastHATransitionTime" is the last time of the last flip from standby to active (or vice versa)
Reference - Any command to get active namenode for nameservice in hadoop?
the goal is:
we run Thousands executes a cross 540 nodes ( node managers machines )
each executor ask by http request which is the active name-node
asking so many requests across on Hadoop cluster isn't so elegant and maybe cause performance issue or maybe other collisions
so we thinking about to create some file as flag in HDFS that include the name of the active name-node
but it will be excellent if this file already created somewhere ? as part of entire HDFS structure
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
