Reply
Explorer
Posts: 9
Registered: ‎08-15-2013

Please surface nameservice IDs in CM and namenode web pages

Hi all,

 

I'm working with High Availability and the namenodes. I've discovered how obscure the nameservice ID is to aquire so that it may be used with hdfs haadmin. Yes, you can eventually figure out it's in hdfs-site.xml neatly tucked away.

 

The High Availability Guide doesn't address how to obtain these either.

 

Can't someone add these to both Cloudera Manager and/or the namenode's web page or even a CLI tool?

 

Thanks

Expert Contributor
Posts: 63
Registered: ‎08-06-2013

Re: Please surface nameservice IDs in CM and namenode web pages

Use the variable $target_nameserviceid  ; the nameservice ID of the NN to be fenced

Posts: 1,537
Kudos: 277
Solutions: 234
Registered: ‎07-31-2013

Re: Please surface nameservice IDs in CM and namenode web pages

 


rowlandg wrote:

I'm working with High Availability and the namenodes. I've discovered how obscure the nameservice ID is to aquire so that it may be used with hdfs haadmin. Yes, you can eventually figure out it's in hdfs-site.xml neatly tucked away.


I believe you're referring to NameNode IDs (which map to NNs under a NameService), not NameService ID (which forms your HDFS URI).

 

With CM, the goal's not to need to know this. The UI offers all possible actions you can perform for HA maintenance, via the CM -> HDFS -> Actions (or) CM -> HDFS -> Instances -> (Any NameNode Instance) -> Actions dropdown buttons.

 

Outside of CM, i.e. for CM-less CDH installs, the NN IDs are typically kept simple as nn1 or nn2, and therefore this issue shouldn't arise there.

Backline Customer Operations Engineer
Explorer
Posts: 9
Registered: ‎08-15-2013

Re: Please surface nameservice IDs in CM and namenode web pages

I think if you'll refer to the document I referenced, you'll find they are referred to (at least at the time the document was written) as Nameservice ID and then somewhat later as Namenode id's. Perhaps the HA Guide needs updating or clarification?

 

"HA clusters reuse the NameService ID to identify a single HDFS instance that may consist of multiple HA NameNodes. In addition, a new abstraction called NameNode ID is introduced. Each distinct NameNode in the cluster has a different NameNode ID. To support a single configuration file for all of the NameNodes, the relevant configuration parameters are suffixed with the NameService ID as well as the NameNode ID."

 

The goal might be not to need this but since it's required from the command line it should be shown somewhere or provided in someother way.

 

The particular day I needed this small bit of information CM was unresponsive and both namenodes were in inactive state.  HA had been enabled for manual failover so the only way out was to regain control was to work from the command line.

 

 

Thanks

Posts: 1,537
Kudos: 277
Solutions: 234
Registered: ‎07-31-2013

Re: Please surface nameservice IDs in CM and namenode web pages

 


rowlandg wrote:

The particular day I needed this small bit of information CM was unresponsive and both namenodes were in inactive state.  HA had been enabled for manual failover so the only way out was to regain control was to work from the command line.


Thanks for taking the time to post back!

 

I think the doc is correct in differentiating NN IDs with NS IDs and the nesting they establish. But I agree it would be better if the NN IDs were more visible under CM. I've gone ahead and filed https://issues.cloudera.org/browse/CM-50 for this request.

 

In case you want a quick way for now, perhaps these commands may help you deduce the right ID (assuming your NS is called 'nameservice1'):

 

hdfs getconf -confKey dfs.ha.namenodes.nameservice1

hdfs getconf -namenodes

 

For example:

 

[root@host-1 ~]# hdfs getconf -confKey dfs.ha.namenodes.nameservice1

namenode81,namenode72
[root@host-1 ~]# hdfs getconf -namenodes
host-1.com host-2.com

 

Backline Customer Operations Engineer
Explorer
Posts: 9
Registered: ‎08-15-2013

Re: Please surface nameservice IDs in CM and namenode web pages

Thanks

Highlighted
New Contributor
Posts: 1
Registered: ‎10-11-2017

Re: Please surface nameservice IDs in CM and namenode web pages

life saver

Announcements