You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by Stephen Boesch <ja...@gmail.com> on 2012/08/10 01:04:47 UTC

Recommended way to check if namenode already formatted

Hi,  what's your take?   I was thinking to check if a certain
always-present file exists  via a  hadoop dfs -ls <file> .  Other
suggestions  welcome.

thanks

stephenb

Re: Recommended way to check if namenode already formatted

Posted by Frederick Kautz <fr...@gridx.com>.
Also, VERSION appears in the operating system's filesystem, not on HDFS.

Check out the dfs.name.dir property in ${HADOOP_HOME}/conf/hdfs-site.xml
for the location. The file is current/VERSION.

On Thu, Aug 9, 2012 at 4:41 PM, Harsh J <ha...@cloudera.com> wrote:

> Stephen,
>
> A NameNode can be considered 'formatted' if its up (it does not start
> otherwise).
>
> If you mean to check if the NameNode has been _freshly_ formatted,
> then checking the count of "hadoop fs -ls /" to be non-zero may help,
> cause by default the NameNode carries no files.
>
> $ hadoop fs -ls / | wc -l
> 0
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>
>
>
> --
> Harsh J
>

Re: Recommended way to check if namenode already formatted

Posted by Frederick Kautz <fr...@gridx.com>.
Also, VERSION appears in the operating system's filesystem, not on HDFS.

Check out the dfs.name.dir property in ${HADOOP_HOME}/conf/hdfs-site.xml
for the location. The file is current/VERSION.

On Thu, Aug 9, 2012 at 4:41 PM, Harsh J <ha...@cloudera.com> wrote:

> Stephen,
>
> A NameNode can be considered 'formatted' if its up (it does not start
> otherwise).
>
> If you mean to check if the NameNode has been _freshly_ formatted,
> then checking the count of "hadoop fs -ls /" to be non-zero may help,
> cause by default the NameNode carries no files.
>
> $ hadoop fs -ls / | wc -l
> 0
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>
>
>
> --
> Harsh J
>

Re: Recommended way to check if namenode already formatted

Posted by Frederick Kautz <fr...@gridx.com>.
Also, VERSION appears in the operating system's filesystem, not on HDFS.

Check out the dfs.name.dir property in ${HADOOP_HOME}/conf/hdfs-site.xml
for the location. The file is current/VERSION.

On Thu, Aug 9, 2012 at 4:41 PM, Harsh J <ha...@cloudera.com> wrote:

> Stephen,
>
> A NameNode can be considered 'formatted' if its up (it does not start
> otherwise).
>
> If you mean to check if the NameNode has been _freshly_ formatted,
> then checking the count of "hadoop fs -ls /" to be non-zero may help,
> cause by default the NameNode carries no files.
>
> $ hadoop fs -ls / | wc -l
> 0
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>
>
>
> --
> Harsh J
>

Re: Recommended way to check if namenode already formatted

Posted by Frederick Kautz <fr...@gridx.com>.
Also, VERSION appears in the operating system's filesystem, not on HDFS.

Check out the dfs.name.dir property in ${HADOOP_HOME}/conf/hdfs-site.xml
for the location. The file is current/VERSION.

On Thu, Aug 9, 2012 at 4:41 PM, Harsh J <ha...@cloudera.com> wrote:

> Stephen,
>
> A NameNode can be considered 'formatted' if its up (it does not start
> otherwise).
>
> If you mean to check if the NameNode has been _freshly_ formatted,
> then checking the count of "hadoop fs -ls /" to be non-zero may help,
> cause by default the NameNode carries no files.
>
> $ hadoop fs -ls / | wc -l
> 0
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>
>
>
> --
> Harsh J
>

Re: Recommended way to check if namenode already formatted

Posted by Harsh J <ha...@cloudera.com>.
Stephen,

A NameNode can be considered 'formatted' if its up (it does not start
otherwise).

If you mean to check if the NameNode has been _freshly_ formatted,
then checking the count of "hadoop fs -ls /" to be non-zero may help,
cause by default the NameNode carries no files.

$ hadoop fs -ls / | wc -l
0

On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb



-- 
Harsh J

Re: Recommended way to check if namenode already formatted

Posted by Stephen Boesch <ja...@gmail.com>.
Hi,
      VERSION does not appear to show up when running  "hadoop dfs -lsr /"
   it displays the files previously placed into hdfs . but nothing about
VERSION.      I can see the VERSION file  on the datanodes under the hdfs
managed data  directoy

find /data | xargs ls -lrta | grep VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/1/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/2/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/3/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION

But using hadoop dfs does not see it ?


2012/8/9 Mohammad Tariq <do...@gmail.com>

> Hello Stephen,
>
>     You can use the VERSION file to verify that.
>
> Regards,
>     Mohammad Tariq
>
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>

Re: Recommended way to check if namenode already formatted

Posted by Stephen Boesch <ja...@gmail.com>.
Hi,
      VERSION does not appear to show up when running  "hadoop dfs -lsr /"
   it displays the files previously placed into hdfs . but nothing about
VERSION.      I can see the VERSION file  on the datanodes under the hdfs
managed data  directoy

find /data | xargs ls -lrta | grep VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/1/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/2/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/3/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION

But using hadoop dfs does not see it ?


2012/8/9 Mohammad Tariq <do...@gmail.com>

> Hello Stephen,
>
>     You can use the VERSION file to verify that.
>
> Regards,
>     Mohammad Tariq
>
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>

Re: Recommended way to check if namenode already formatted

Posted by Stephen Boesch <ja...@gmail.com>.
Hi,
      VERSION does not appear to show up when running  "hadoop dfs -lsr /"
   it displays the files previously placed into hdfs . but nothing about
VERSION.      I can see the VERSION file  on the datanodes under the hdfs
managed data  directoy

find /data | xargs ls -lrta | grep VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/1/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/2/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/3/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION

But using hadoop dfs does not see it ?


2012/8/9 Mohammad Tariq <do...@gmail.com>

> Hello Stephen,
>
>     You can use the VERSION file to verify that.
>
> Regards,
>     Mohammad Tariq
>
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>

Re: Recommended way to check if namenode already formatted

Posted by Stephen Boesch <ja...@gmail.com>.
Hi,
      VERSION does not appear to show up when running  "hadoop dfs -lsr /"
   it displays the files previously placed into hdfs . but nothing about
VERSION.      I can see the VERSION file  on the datanodes under the hdfs
managed data  directoy

find /data | xargs ls -lrta | grep VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/1/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/2/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs   hdfs     154 Aug  9 16:28 /data/3/dfs/dn/current/VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION
-rw-rw-r-- 1 hdfs hdfs    154 Aug  9 16:28 VERSION

But using hadoop dfs does not see it ?


2012/8/9 Mohammad Tariq <do...@gmail.com>

> Hello Stephen,
>
>     You can use the VERSION file to verify that.
>
> Regards,
>     Mohammad Tariq
>
>
> On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
> >
> > Hi,  what's your take?   I was thinking to check if a certain
> always-present
> > file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
> >
> > thanks
> >
> > stephenb
>

Re: Recommended way to check if namenode already formatted

Posted by Mohammad Tariq <do...@gmail.com>.
Hello Stephen,

    You can use the VERSION file to verify that.

Regards,
    Mohammad Tariq


On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb

Re: Recommended way to check if namenode already formatted

Posted by Harsh J <ha...@cloudera.com>.
Stephen,

A NameNode can be considered 'formatted' if its up (it does not start
otherwise).

If you mean to check if the NameNode has been _freshly_ formatted,
then checking the count of "hadoop fs -ls /" to be non-zero may help,
cause by default the NameNode carries no files.

$ hadoop fs -ls / | wc -l
0

On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb



-- 
Harsh J

Re: Recommended way to check if namenode already formatted

Posted by Harsh J <ha...@cloudera.com>.
Stephen,

A NameNode can be considered 'formatted' if its up (it does not start
otherwise).

If you mean to check if the NameNode has been _freshly_ formatted,
then checking the count of "hadoop fs -ls /" to be non-zero may help,
cause by default the NameNode carries no files.

$ hadoop fs -ls / | wc -l
0

On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb



-- 
Harsh J

Re: Recommended way to check if namenode already formatted

Posted by Harsh J <ha...@cloudera.com>.
Stephen,

A NameNode can be considered 'formatted' if its up (it does not start
otherwise).

If you mean to check if the NameNode has been _freshly_ formatted,
then checking the count of "hadoop fs -ls /" to be non-zero may help,
cause by default the NameNode carries no files.

$ hadoop fs -ls / | wc -l
0

On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb



-- 
Harsh J

Re: Recommended way to check if namenode already formatted

Posted by Mohammad Tariq <do...@gmail.com>.
Hello Stephen,

    You can use the VERSION file to verify that.

Regards,
    Mohammad Tariq


On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb

Re: Recommended way to check if namenode already formatted

Posted by Mohammad Tariq <do...@gmail.com>.
Hello Stephen,

    You can use the VERSION file to verify that.

Regards,
    Mohammad Tariq


On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb

Re: Recommended way to check if namenode already formatted

Posted by Mohammad Tariq <do...@gmail.com>.
Hello Stephen,

    You can use the VERSION file to verify that.

Regards,
    Mohammad Tariq


On Fri, Aug 10, 2012 at 4:34 AM, Stephen Boesch <ja...@gmail.com> wrote:
>
> Hi,  what's your take?   I was thinking to check if a certain always-present
> file exists  via a  hadoop dfs -ls <file> .  Other suggestions  welcome.
>
> thanks
>
> stephenb