Hadoop job asks to disable safe node

Tag: hadoop Author: vinidomoto Date: 2011-09-03

Hadoop job is asking to disable safe mode manually. It says the resources are not available. How to disable safe mode?

Best Answer

You can leave safemode by using the following command:

hadoop dfsadmin -safemode leave

The documentation touches briefly on other safemode states. However, typically your Hadoop instance enters safe mode for a reason, so this may not be a permanent fix.

comments:

Thanks for the solution. The job is saying that the Namenode is on safe mode, so the resources are on a low. And is asking to disable safemode manually. What can be the cause and permanent fix?
Usually it goes into safe mode when files are under-replicated. You may have lost too many data nodes or too few data nodes. You can either set the replication lower or spin up more data nodes. It could be something else though, may be hard to tell. Take a look at the NameNode logs, perhaps?

Other Answer1

Not sure why you want to leave the safe mode manually. dfsadmin command can be used to enter/leave the safe mode manually. Normally the safe mode is entered manually when there should only be read-only operations to HDFS.

According to the Hadoop documentation

Safe mode is entered automatically at Namenode startup, and leaves safe mode automatically when the configured minimum percentage of blocks satisfies the minimum replication condition. Safe mode can also be entered manually, but then it can only be turned off manually as well.

Here is the command

hadoop dfsadmin -safemode leave

Other Answer2

In my case it enters safe mode whenever I turn off my system without shutting down the hadoop and hbase. So make sure that you have shut down the hadoop and hbase before shut-down of your system.