2012-12-05 04:07:52,870 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:mapred cause:org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot delete /tmp/hadoop-root/mapred/system. Name node is in safe mode.
[root@centos-1 ~]# hadoop fs -copyFromLocal .bash_history /tmp/ copyFromLocal: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create file/tmp/.bash_history. Name node is in safe mode.
A workaround to this issue is to manually move the NameNode out of safe mode. Before doing this, confirm you know and understand why the NameNode is stuck in safe mode by reviewing the status of all DataNodes and the NameNode logs. In some cases manually disabling safemode can lead to dataloss.
Please note that you must run the command using the HDFS OS user which is the default super user for HDFS. Otherwise, you will encounter the following error: "Access denied for user Hadoop. Superuser privilege is required".
sudo -u hdfs hadoop dfsadmin -safemode leave
[root@centos-1 ~]# hadoop fs -copyFromLocal .bash_history /tmp/ [root@centos-1 ~]# hadoop fs -ls /tmp
Found 6 items -rw-r--r-- 3 root supergroup 14904 2012-12-05 17:06 /tmp/.bash_history drwxrwxrwx - root supergroup 0 2012-11-28 23:56 /tmp/hadoop-mapred drwxr-xr-x - hdfs supergroup 0 2012-11-28 23:56 /tmp/hadoop-root drwxr-xr-x - root supergroup 0 2012-11-28 23:27 /tmp/test_input drwxrwxrwx - root supergroup  0 2012-11-28 23:56 /tmp/test_output