Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 08-09-2018 07:24 PM
I have one live datanode:
NameNode Started No alertsSNameNode Started No alertsDataNodes1/1
StartedDataNodes Status1 live / 0 dead / 0 decommissioning
Still i have this exception
File "/usr/lib/ambari-agent/lib/resource_management/libraries/providers/hdfs_resource.py", line 250, in _run_command
raise WebHDFSCallException(err_msg, result_dict)
resource_management.libraries.providers.hdfs_resource.WebHDFSCallException: Execution of 'curl -sS -L -w '%{http_code}' -X PUT 'http://ambari:50070/webhdfs/v1/ats/done?op=SETPERMISSION&user.name=hdfs&permission=755'' returned status_code=403.
{
"RemoteException": {
"exception": "SafeModeException",
"javaClassName": "org.apache.hadoop.hdfs.server.namenode.SafeModeException", "message": "Cannot set permission for /ats/done. Name node is in safe mode.\nThe reported blocks 9118 needs additional 21 blocks to reach the threshold 1.0000 of total blocks 9138.\nThe number of live datanodes 1 has reached the minimum number 0. Safe mode will be turned off automatically once the thresholds have been reached."
Created 08-09-2018 10:46 PM
Looks like your NameNode is started but it is still in SafeMode hence it will not allow any mutable operations to be performed on HDFS. Thats the reason you are getting this SafeMode related error.
In order to validate the same you can try creating a simple directory on HDFS and you might get the same error kind of
# su - hdfs -c "hdfs dfs -mkdir /tmp/test"
If you want to know if the NameNode is in SafeMode or not then you can run the following command:
# su - hdfs -c "hdfs dfsadmin -safemode get"
In order to tell NameNode to leave the safe mode you can run the following command:
# su - hdfs -c "hdfs dfsadmin -safemode leave"
If the NameNode still does not come out of SafeMode then you will need to try restarting the NameNode once and check the NameNode log for any error/warning.
# su -l hdfs -c "/usr/hdp/current/hadoop-hdfs-namenode/../hadoop/sbin/hadoop-daemon.sh stop namenode" # su -l hdfs -c "/usr/hdp/current/hadoop-hdfs-namenode/../hadoop/sbin/hadoop-daemon.sh start namenode" # tail -f /var/log/hadoop/hdfs/hadoop-hdfs-namenod*
.
Please share the NN logs if it still does not start cleanly.
.
Created 08-09-2018 07:32 PM
happened after I removed "home" from NameNode and DataNode directories
Created 08-09-2018 07:46 PM
@Victor L looks like your namenode has issues -can you restart namenode and then attempt again to see if that helps?
Created 08-09-2018 10:46 PM
Looks like your NameNode is started but it is still in SafeMode hence it will not allow any mutable operations to be performed on HDFS. Thats the reason you are getting this SafeMode related error.
In order to validate the same you can try creating a simple directory on HDFS and you might get the same error kind of
# su - hdfs -c "hdfs dfs -mkdir /tmp/test"
If you want to know if the NameNode is in SafeMode or not then you can run the following command:
# su - hdfs -c "hdfs dfsadmin -safemode get"
In order to tell NameNode to leave the safe mode you can run the following command:
# su - hdfs -c "hdfs dfsadmin -safemode leave"
If the NameNode still does not come out of SafeMode then you will need to try restarting the NameNode once and check the NameNode log for any error/warning.
# su -l hdfs -c "/usr/hdp/current/hadoop-hdfs-namenode/../hadoop/sbin/hadoop-daemon.sh stop namenode" # su -l hdfs -c "/usr/hdp/current/hadoop-hdfs-namenode/../hadoop/sbin/hadoop-daemon.sh start namenode" # tail -f /var/log/hadoop/hdfs/hadoop-hdfs-namenod*
.
Please share the NN logs if it still does not start cleanly.
.
Created 08-10-2018 02:51 PM
Getting it out of safe mode solved the problem