You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@hadoop.apache.org by Gary Yang <ga...@yahoo.com> on 2010/03/23 20:19:23 UTC

bin/hadoop namenode -format IOException: Invalid argument

Hi All,

I got exception below. I followed the Quick Start for the Pseudo-Distributed Operation. I did what the quick start says. Can someone help?

cat conf/core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>

  <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value>
  </property>

</configuration>


cat conf/hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
</configuration>


cat conf/mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
  <property>
    <name>mapred.job.tracker</name>
    <value>localhost:9001</value>
  </property> 
</configuration>



Below are errors:


-bash-3.2# bin/hadoop namenode -format
10/03/23 11:54:54 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = Board2/192.168.0.185
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 0.20.2
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010
************************************************************/
10/03/23 11:54:56 INFO namenode.FSNamesystem: fsOwner=root,root,bin,daemon,sys,adm,disk,wheel
10/03/23 11:54:56 INFO namenode.FSNamesystem: supergroup=supergroup
10/03/23 11:54:56 INFO namenode.FSNamesystem: isPermissionEnabled=true
10/03/23 11:54:56 INFO common.Storage: java.io.IOException: Invalid argument
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
        at java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)

10/03/23 11:54:56 ERROR namenode.NameNode: java.io.IOException: Invalid argument
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
        at java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)

10/03/23 11:54:56 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at Board2/192.168.0.185
************************************************************/




Thanks,


Gary





      

Re: bin/hadoop namenode -format IOException: Invalid argument

Posted by Konstantin Shvachko <sh...@yahoo-inc.com>.
This may be a problem with the underlying local file system.
Some file systems just don't support locks. Some NFS, e.g.
Some may have buggy native java implementation.

Are your name-node directories in /tmp, which is the default?
/tmp can behave strangely.
You should set "dfs.name.dir" pointing to a local HD directory in hdfs-site.xml.

--Konstantin

On 3/24/2010 3:17 AM, Steve Loughran wrote:
> Gary Yang wrote:
>> No. The namenode is not running. "bin/hadoop namenode -format" was the
>> very first command. I have not got chance to start the namenode yet.
>> Any idea?
>
>>>
>>> 10/03/23 11:54:56 ERROR namenode.NameNode:
>>> java.io.IOException: Invalid argument
>>>         at
>>> sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
>>>         at
>>> java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
>>>         at
>>> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
>>>
>>>         at
>>> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
>>>
>>>         at
>>> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
>>>         at
>>> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
>>>         at
>>> org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
>>>
>>>         at
>>> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
>>>
>>>         at
>>> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)
>
>
> That could be the filesystem being unhappy about some directory
>
> Check all your namenode dir settings, make sure they are valid paths,
> try to create them as the hadoop user


Re: bin/hadoop namenode -format IOException: Invalid argument

Posted by Steve Loughran <st...@apache.org>.
Gary Yang wrote:
> No. The namenode is not running. "bin/hadoop namenode -format" was the very first command. I have not got chance to start the namenode yet. Any idea?

>>
>> 10/03/23 11:54:56 ERROR namenode.NameNode:
>> java.io.IOException: Invalid argument
>>         at
>> sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
>>         at
>> java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
>>         at
>> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
>>         at
>> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
>>         at
>> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
>>         at
>> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
>>         at
>> org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
>>         at
>> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
>>         at
>> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)


That could be the filesystem being unhappy about some directory

Check all your namenode dir settings, make sure they are valid paths, 
try to create them as the hadoop user

Re: bin/hadoop namenode -format IOException: Invalid argument

Posted by Gary Yang <ga...@yahoo.com>.
No. The namenode is not running. "bin/hadoop namenode -format" was the very first command. I have not got chance to start the namenode yet. Any idea?

--- On Tue, 3/23/10, Suresh Srinivas <su...@yahoo-inc.com> wrote:

> From: Suresh Srinivas <su...@yahoo-inc.com>
> Subject: Re: bin/hadoop namenode -format          IOException: Invalid argument
> To: "general@hadoop.apache.org" <ge...@hadoop.apache.org>
> Date: Tuesday, March 23, 2010, 12:27 PM
> Is namenode running when you tried
> this operation? If so shutdown the namenode process and try
> it again.
> 
> 
> On 3/23/10 11:19 AM, "Gary Yang" <ga...@yahoo.com>
> wrote:
> 
> Hi All,
> 
> I got exception below. I followed the Quick Start for the
> Pseudo-Distributed Operation. I did what the quick start
> says. Can someone help?
> 
> cat conf/core-site.xml
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl"
> href="configuration.xsl"?>
> 
> <!-- Put site-specific property overrides in this file.
> -->
> 
> <configuration>
> 
>   <property>
>     <name>fs.default.name</name>
>    
> <value>hdfs://localhost:9000</value>
>   </property>
> 
> </configuration>
> 
> 
> cat conf/hdfs-site.xml
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl"
> href="configuration.xsl"?>
> 
> <!-- Put site-specific property overrides in this file.
> -->
> 
> <configuration>
>   <property>
>     <name>dfs.replication</name>
>     <value>1</value>
>   </property>
> </configuration>
> 
> 
> cat conf/mapred-site.xml
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl"
> href="configuration.xsl"?>
> 
> <!-- Put site-specific property overrides in this file.
> -->
> 
> <configuration>
>   <property>
>     <name>mapred.job.tracker</name>
>     <value>localhost:9001</value>
>   </property>
> </configuration>
> 
> 
> 
> Below are errors:
> 
> 
> -bash-3.2# bin/hadoop namenode -format
> 10/03/23 11:54:54 INFO namenode.NameNode: STARTUP_MSG:
> /************************************************************
> STARTUP_MSG: Starting NameNode
> STARTUP_MSG:   host = Board2/192.168.0.185
> STARTUP_MSG:   args = [-format]
> STARTUP_MSG:   version = 0.20.2
> STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20
> -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC
> 2010
> ************************************************************/
> 10/03/23 11:54:56 INFO namenode.FSNamesystem:
> fsOwner=root,root,bin,daemon,sys,adm,disk,wheel
> 10/03/23 11:54:56 INFO namenode.FSNamesystem:
> supergroup=supergroup
> 10/03/23 11:54:56 INFO namenode.FSNamesystem:
> isPermissionEnabled=true
> 10/03/23 11:54:56 INFO common.Storage: java.io.IOException:
> Invalid argument
>         at
> sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
>         at
> java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
>         at
> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
>         at
> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
>         at
> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
>         at
> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
>         at
> org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
>         at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
>         at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)
> 
> 10/03/23 11:54:56 ERROR namenode.NameNode:
> java.io.IOException: Invalid argument
>         at
> sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
>         at
> java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
>         at
> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
>         at
> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
>         at
> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
>         at
> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
>         at
> org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
>         at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
>         at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)
> 
> 10/03/23 11:54:56 INFO namenode.NameNode: SHUTDOWN_MSG:
> /************************************************************
> SHUTDOWN_MSG: Shutting down NameNode at
> Board2/192.168.0.185
> ************************************************************/
> 
> 
> 
> 
> Thanks,
> 
> 
> Gary
> 
> 
> 
> 
> 
> 
> 
> 


      

Re: bin/hadoop namenode -format IOException: Invalid argument

Posted by Suresh Srinivas <su...@yahoo-inc.com>.
Is namenode running when you tried this operation? If so shutdown the namenode process and try it again.


On 3/23/10 11:19 AM, "Gary Yang" <ga...@yahoo.com> wrote:

Hi All,

I got exception below. I followed the Quick Start for the Pseudo-Distributed Operation. I did what the quick start says. Can someone help?

cat conf/core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>

  <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value>
  </property>

</configuration>


cat conf/hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
</configuration>


cat conf/mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
  <property>
    <name>mapred.job.tracker</name>
    <value>localhost:9001</value>
  </property>
</configuration>



Below are errors:


-bash-3.2# bin/hadoop namenode -format
10/03/23 11:54:54 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = Board2/192.168.0.185
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 0.20.2
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010
************************************************************/
10/03/23 11:54:56 INFO namenode.FSNamesystem: fsOwner=root,root,bin,daemon,sys,adm,disk,wheel
10/03/23 11:54:56 INFO namenode.FSNamesystem: supergroup=supergroup
10/03/23 11:54:56 INFO namenode.FSNamesystem: isPermissionEnabled=true
10/03/23 11:54:56 INFO common.Storage: java.io.IOException: Invalid argument
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
        at java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)

10/03/23 11:54:56 ERROR namenode.NameNode: java.io.IOException: Invalid argument
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:900)
        at java.nio.channels.FileChannel.tryLock(FileChannel.java:974)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.tryLock(Storage.java:527)
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:505)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1087)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)

10/03/23 11:54:56 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at Board2/192.168.0.185
************************************************************/




Thanks,


Gary