You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by Devopam Mittra <de...@gmail.com> on 2014/11/03 06:03:17 UTC

unable to use hdfs haadmin -ns on HDP2.1 , HDFS2.4.0.2.1

hi All,
I wanted to systematically probe and list all my namenode(s) via CLI.
An easier way was to maintain a masters conf file , but I want to
dynamically find the same leveraging the system metadata.

In process of trying to find the same , I tried to use
hdfs haadmin -ns ... but to my dismay the command always returns "Missing
Command" on the console as if I am doing something syntactically wrong.

I know my nameserviceId and I tried both capital letters and all small
(just to be sure to not commit a silly mistake).

Can you please help me in trying to figure out what I am doing wrong here.


-- 
Devopam Mittra
Life and Relations are not binary

Re: unable to use hdfs haadmin -ns on HDP2.1 , HDFS2.4.0.2.1

Posted by Devopam Mittra <de...@gmail.com>.
hi All,
Please find a very simple script attached that helps me to find the current
'active' namenode fqdn on my HDP2.1 HA cluster . I needed this information
for the ETL jobs to run properly.
Sharing it with everyone in case it may be of use to you as well.

Thanks to Brahma for the initial pointers once again.
Do let me know if you face any issues executing the same.

regards
Devopam


On Mon, Nov 3, 2014 at 6:06 PM, Devopam Mittra <de...@gmail.com> wrote:

> hi Brahma,
> Thanks so much for the pointers.
> I am able to achieve my goal by extending the help provided and proceed
> with the automated script I am trying to build.
> Shall share for common benefit after initial testing.
>
> warm regards
> Devopam
>
>
> On Mon, Nov 3, 2014 at 1:40 PM, Brahma Reddy Battula <
> brahmareddy.battula@huawei.com> wrote:
>
>> Yes, you can get, but you need to use two commands like following..
>>
>> 1) Need to get nameservices
>> 2) dfs.ha.namenodes.${dfs.nameservices}.
>>
>>
>> [root@linux156 bin]# ./hdfs getconf -confKey dfs.nameservices
>> hacluster
>> [root@linux156 bin]# ./hdfs getconf -confKey dfs.ha.namenodes.hacluster
>> 100,101
>>
>>
>>
>>
>> Thanks & Regards
>> Brahma Reddy Battula
>>
>> ________________________________________
>> From: Devopam Mittra [devopam@gmail.com]
>> Sent: Monday, November 03, 2014 1:23 PM
>> To: common-dev@hadoop.apache.org
>> Subject: Re: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 ,
>> HDFS2.4.0.2.1
>>
>> hi Brahma,
>> Thanks a lot for the clarification.
>>
>> This brings me to my next question: Is there a way I can systematically
>> retrieve the serviceId s using any CLI command , instead of reading it
>> from
>> conf xmls ?
>>
>>
>> regards
>> Devopam
>>
>>
>> On Mon, Nov 3, 2014 at 12:51 PM, Brahma Reddy Battula <
>> brahmareddy.battula@huawei.com> wrote:
>>
>> > Hi Mittra
>> >
>> >
>> > As far as I knew, "hdfs haadmin -ns" is not availble..(please someone
>> can
>> > correct, If I am wrong..)
>> >
>> >
>> > Please check following help command for haadmin..
>> >
>> > [root@linux bin]# ./hdfs haadmin
>> > No GC_PROFILE is given. Defaults to medium.
>> > Usage: DFSHAAdmin [-ns <nameserviceId>]
>> >     [-transitionToActive <serviceId> [--forceactive]]
>> >     [-transitionToStandby <serviceId>]
>> >     [-failover [--forcefence] [--forceactive] <serviceId> <serviceId>]
>> >     [-getServiceState <serviceId>]
>> >     [-checkHealth <serviceId>]
>> >     [-help <command>]
>> >
>> >
>> > Example:
>> >
>> > if your service id's are like nn1,nn2
>> >
>> > then you can try like,, hdfs haadmin -getServiceState nn1.
>> >
>> >
>> > Thanks & Regards
>> > Brahma Reddy Battula
>> > ________________________________________
>> > From: Devopam Mittra [devopam@gmail.com]
>> > Sent: Monday, November 03, 2014 10:33 AM
>> > To: common-dev@hadoop.apache.org
>> > Subject: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 ,
>> > HDFS2.4.0.2.1
>> >
>> > hi All,
>> > I wanted to systematically probe and list all my namenode(s) via CLI.
>> > An easier way was to maintain a masters conf file , but I want to
>> > dynamically find the same leveraging the system metadata.
>> >
>> > In process of trying to find the same , I tried to use
>> > hdfs haadmin -ns ... but to my dismay the command always returns
>> "Missing
>> > Command" on the console as if I am doing something syntactically wrong.
>> >
>> > I know my nameserviceId and I tried both capital letters and all small
>> > (just to be sure to not commit a silly mistake).
>> >
>> > Can you please help me in trying to figure out what I am doing wrong
>> here.
>> >
>> >
>> > --
>> > Devopam Mittra
>> > Life and Relations are not binary
>> >
>>
>>
>>
>> --
>> Devopam Mittra
>> Life and Relations are not binary
>>
>
>
>
> --
> Devopam Mittra
> Life and Relations are not binary
>



-- 
Devopam Mittra
Life and Relations are not binary

Re: unable to use hdfs haadmin -ns on HDP2.1 , HDFS2.4.0.2.1

Posted by Devopam Mittra <de...@gmail.com>.
hi Brahma,
Thanks so much for the pointers.
I am able to achieve my goal by extending the help provided and proceed
with the automated script I am trying to build.
Shall share for common benefit after initial testing.

warm regards
Devopam


On Mon, Nov 3, 2014 at 1:40 PM, Brahma Reddy Battula <
brahmareddy.battula@huawei.com> wrote:

> Yes, you can get, but you need to use two commands like following..
>
> 1) Need to get nameservices
> 2) dfs.ha.namenodes.${dfs.nameservices}.
>
>
> [root@linux156 bin]# ./hdfs getconf -confKey dfs.nameservices
> hacluster
> [root@linux156 bin]# ./hdfs getconf -confKey dfs.ha.namenodes.hacluster
> 100,101
>
>
>
>
> Thanks & Regards
> Brahma Reddy Battula
>
> ________________________________________
> From: Devopam Mittra [devopam@gmail.com]
> Sent: Monday, November 03, 2014 1:23 PM
> To: common-dev@hadoop.apache.org
> Subject: Re: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 ,
> HDFS2.4.0.2.1
>
> hi Brahma,
> Thanks a lot for the clarification.
>
> This brings me to my next question: Is there a way I can systematically
> retrieve the serviceId s using any CLI command , instead of reading it from
> conf xmls ?
>
>
> regards
> Devopam
>
>
> On Mon, Nov 3, 2014 at 12:51 PM, Brahma Reddy Battula <
> brahmareddy.battula@huawei.com> wrote:
>
> > Hi Mittra
> >
> >
> > As far as I knew, "hdfs haadmin -ns" is not availble..(please someone can
> > correct, If I am wrong..)
> >
> >
> > Please check following help command for haadmin..
> >
> > [root@linux bin]# ./hdfs haadmin
> > No GC_PROFILE is given. Defaults to medium.
> > Usage: DFSHAAdmin [-ns <nameserviceId>]
> >     [-transitionToActive <serviceId> [--forceactive]]
> >     [-transitionToStandby <serviceId>]
> >     [-failover [--forcefence] [--forceactive] <serviceId> <serviceId>]
> >     [-getServiceState <serviceId>]
> >     [-checkHealth <serviceId>]
> >     [-help <command>]
> >
> >
> > Example:
> >
> > if your service id's are like nn1,nn2
> >
> > then you can try like,, hdfs haadmin -getServiceState nn1.
> >
> >
> > Thanks & Regards
> > Brahma Reddy Battula
> > ________________________________________
> > From: Devopam Mittra [devopam@gmail.com]
> > Sent: Monday, November 03, 2014 10:33 AM
> > To: common-dev@hadoop.apache.org
> > Subject: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 ,
> > HDFS2.4.0.2.1
> >
> > hi All,
> > I wanted to systematically probe and list all my namenode(s) via CLI.
> > An easier way was to maintain a masters conf file , but I want to
> > dynamically find the same leveraging the system metadata.
> >
> > In process of trying to find the same , I tried to use
> > hdfs haadmin -ns ... but to my dismay the command always returns "Missing
> > Command" on the console as if I am doing something syntactically wrong.
> >
> > I know my nameserviceId and I tried both capital letters and all small
> > (just to be sure to not commit a silly mistake).
> >
> > Can you please help me in trying to figure out what I am doing wrong
> here.
> >
> >
> > --
> > Devopam Mittra
> > Life and Relations are not binary
> >
>
>
>
> --
> Devopam Mittra
> Life and Relations are not binary
>



-- 
Devopam Mittra
Life and Relations are not binary

RE: unable to use hdfs haadmin -ns on HDP2.1 , HDFS2.4.0.2.1

Posted by Brahma Reddy Battula <br...@huawei.com>.
Yes, you can get, but you need to use two commands like following..

1) Need to get nameservices
2) dfs.ha.namenodes.${dfs.nameservices}.


[root@linux156 bin]# ./hdfs getconf -confKey dfs.nameservices
hacluster
[root@linux156 bin]# ./hdfs getconf -confKey dfs.ha.namenodes.hacluster
100,101




Thanks & Regards
Brahma Reddy Battula

________________________________________
From: Devopam Mittra [devopam@gmail.com]
Sent: Monday, November 03, 2014 1:23 PM
To: common-dev@hadoop.apache.org
Subject: Re: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 , HDFS2.4.0.2.1

hi Brahma,
Thanks a lot for the clarification.

This brings me to my next question: Is there a way I can systematically
retrieve the serviceId s using any CLI command , instead of reading it from
conf xmls ?


regards
Devopam


On Mon, Nov 3, 2014 at 12:51 PM, Brahma Reddy Battula <
brahmareddy.battula@huawei.com> wrote:

> Hi Mittra
>
>
> As far as I knew, "hdfs haadmin -ns" is not availble..(please someone can
> correct, If I am wrong..)
>
>
> Please check following help command for haadmin..
>
> [root@linux bin]# ./hdfs haadmin
> No GC_PROFILE is given. Defaults to medium.
> Usage: DFSHAAdmin [-ns <nameserviceId>]
>     [-transitionToActive <serviceId> [--forceactive]]
>     [-transitionToStandby <serviceId>]
>     [-failover [--forcefence] [--forceactive] <serviceId> <serviceId>]
>     [-getServiceState <serviceId>]
>     [-checkHealth <serviceId>]
>     [-help <command>]
>
>
> Example:
>
> if your service id's are like nn1,nn2
>
> then you can try like,, hdfs haadmin -getServiceState nn1.
>
>
> Thanks & Regards
> Brahma Reddy Battula
> ________________________________________
> From: Devopam Mittra [devopam@gmail.com]
> Sent: Monday, November 03, 2014 10:33 AM
> To: common-dev@hadoop.apache.org
> Subject: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 ,
> HDFS2.4.0.2.1
>
> hi All,
> I wanted to systematically probe and list all my namenode(s) via CLI.
> An easier way was to maintain a masters conf file , but I want to
> dynamically find the same leveraging the system metadata.
>
> In process of trying to find the same , I tried to use
> hdfs haadmin -ns ... but to my dismay the command always returns "Missing
> Command" on the console as if I am doing something syntactically wrong.
>
> I know my nameserviceId and I tried both capital letters and all small
> (just to be sure to not commit a silly mistake).
>
> Can you please help me in trying to figure out what I am doing wrong here.
>
>
> --
> Devopam Mittra
> Life and Relations are not binary
>



--
Devopam Mittra
Life and Relations are not binary

Re: unable to use hdfs haadmin -ns on HDP2.1 , HDFS2.4.0.2.1

Posted by Devopam Mittra <de...@gmail.com>.
hi Brahma,
Thanks a lot for the clarification.

This brings me to my next question: Is there a way I can systematically
retrieve the serviceId s using any CLI command , instead of reading it from
conf xmls ?


regards
Devopam


On Mon, Nov 3, 2014 at 12:51 PM, Brahma Reddy Battula <
brahmareddy.battula@huawei.com> wrote:

> Hi Mittra
>
>
> As far as I knew, "hdfs haadmin -ns" is not availble..(please someone can
> correct, If I am wrong..)
>
>
> Please check following help command for haadmin..
>
> [root@linux bin]# ./hdfs haadmin
> No GC_PROFILE is given. Defaults to medium.
> Usage: DFSHAAdmin [-ns <nameserviceId>]
>     [-transitionToActive <serviceId> [--forceactive]]
>     [-transitionToStandby <serviceId>]
>     [-failover [--forcefence] [--forceactive] <serviceId> <serviceId>]
>     [-getServiceState <serviceId>]
>     [-checkHealth <serviceId>]
>     [-help <command>]
>
>
> Example:
>
> if your service id's are like nn1,nn2
>
> then you can try like,, hdfs haadmin -getServiceState nn1.
>
>
> Thanks & Regards
> Brahma Reddy Battula
> ________________________________________
> From: Devopam Mittra [devopam@gmail.com]
> Sent: Monday, November 03, 2014 10:33 AM
> To: common-dev@hadoop.apache.org
> Subject: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 ,
> HDFS2.4.0.2.1
>
> hi All,
> I wanted to systematically probe and list all my namenode(s) via CLI.
> An easier way was to maintain a masters conf file , but I want to
> dynamically find the same leveraging the system metadata.
>
> In process of trying to find the same , I tried to use
> hdfs haadmin -ns ... but to my dismay the command always returns "Missing
> Command" on the console as if I am doing something syntactically wrong.
>
> I know my nameserviceId and I tried both capital letters and all small
> (just to be sure to not commit a silly mistake).
>
> Can you please help me in trying to figure out what I am doing wrong here.
>
>
> --
> Devopam Mittra
> Life and Relations are not binary
>



-- 
Devopam Mittra
Life and Relations are not binary

RE: unable to use hdfs haadmin -ns on HDP2.1 , HDFS2.4.0.2.1

Posted by Brahma Reddy Battula <br...@huawei.com>.
Hi Mittra


As far as I knew, "hdfs haadmin -ns" is not availble..(please someone can correct, If I am wrong..)


Please check following help command for haadmin..

[root@linux bin]# ./hdfs haadmin
No GC_PROFILE is given. Defaults to medium.
Usage: DFSHAAdmin [-ns <nameserviceId>]
    [-transitionToActive <serviceId> [--forceactive]]
    [-transitionToStandby <serviceId>]
    [-failover [--forcefence] [--forceactive] <serviceId> <serviceId>]
    [-getServiceState <serviceId>]
    [-checkHealth <serviceId>]
    [-help <command>]


Example:

if your service id's are like nn1,nn2

then you can try like,, hdfs haadmin -getServiceState nn1.


Thanks & Regards
Brahma Reddy Battula
________________________________________
From: Devopam Mittra [devopam@gmail.com]
Sent: Monday, November 03, 2014 10:33 AM
To: common-dev@hadoop.apache.org
Subject: unable to use hdfs haadmin -ns <nameserviceId> on HDP2.1 , HDFS2.4.0.2.1

hi All,
I wanted to systematically probe and list all my namenode(s) via CLI.
An easier way was to maintain a masters conf file , but I want to
dynamically find the same leveraging the system metadata.

In process of trying to find the same , I tried to use
hdfs haadmin -ns ... but to my dismay the command always returns "Missing
Command" on the console as if I am doing something syntactically wrong.

I know my nameserviceId and I tried both capital letters and all small
(just to be sure to not commit a silly mistake).

Can you please help me in trying to figure out what I am doing wrong here.


--
Devopam Mittra
Life and Relations are not binary