hadoop namenode not starting/formatting on Ubuntu

别说谁变了你拦得住时间么 提交于 2020-01-04 03:17:14

问题


am trying to set up a hadoop instance on Ubuntu. The namenode is not starting up. When i do jps command I can see all but namenode . Here is my hdfs-site.xml file.

<configuration>
    <property>
        <name>dfs.datanode.data.dir</name>
        <value>/home/ac/hadoop/dfs</value>
    </property>
    <property>
        <name>dfs.namenode.name.dir</name>
        <value>/home/ac/hadoop/dfs</value>
    </property>
    <property>
        <name>dfs.replication</name>
        <value>1</value>    
    </property>
</configuration>

and heres my core-site.xml

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

The error that i got is

ERROR org.apache.hadoop.hdfs.server.namenode.FSNamesystem: FSNamesystem initialization failed.
java.io.IOException: NameNode is not formatted.

When I formatted namenode I got this on prompt

STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = hanu/127.0.1.1
STARTUP_MSG:   args = [–format]
STARTUP_MSG:   version = 1.2.1
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.2 -r 1503152; compiled by 'mattf' on Mon Jul 22 15:23:09 PDT 2013
STARTUP_MSG:   java = 1.8.0_31
************************************************************/
Usage: java NameNode [-format [-force ] [-nonInteractive]] | [-upgrade] | [-rollback] | [-finalize] | [-importCheckpoint] | [-recover [ -force ] ]
15/02/03 15:03:41 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at hanu/127.0.1.1

I've tried to to change files as per various suggestions out there but nothing is working. I think namenode is not formatting properly. Whats wrong in my setup and how can I get it corrected.Any help is appreciated. Thanks


回答1:


The reason you are seeing the error message is because of command typo, that is why namenode class is showing the Usage error, may be you have issued the command option improperly.

Make sure you type the command properly:

bin/hadoop namenode -format

and then try to start the NameNode, you could start NameNode service on foreground just to see if everything is working out properly and if you don't see any errors you could kill the process and start all the services using start-all.sh script.

Here's how you could start NameNode process on foreground:

bin/hadoop namenode

once started these are the log messages to look for to validate a proper startup:

15/02/04 10:42:44 INFO http.HttpServer: Jetty bound to port 50070
15/02/04 10:42:44 INFO mortbay.log: jetty-6.1.26
15/02/04 10:42:45 INFO mortbay.log: Started SelectChannelConnector@0.0.0.0:50070
15/02/04 10:42:45 INFO namenode.NameNode: Web-server up at: 0.0.0.0:50070
15/02/04 10:42:45 INFO ipc.Server: IPC Server Responder: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server listener on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 0 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 1 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 2 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 3 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 4 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 5 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 6 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 7 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 8 on 8020: starting
15/02/04 10:42:45 INFO ipc.Server: IPC Server handler 9 on 8020: starting

you could kill the service by sending <Ctrl+C> to the process.



来源:https://stackoverflow.com/questions/28307847/hadoop-namenode-not-starting-formatting-on-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!