Details
Description
1、 Create docker, namenode format failed. ERROR log:
[1;31mError: Could not start Service[hadoop-hdfs-namenode]: Execution of '/sbin/service hadoop-hdfs-namenode start' returned 1: WARNING: Use of this script to start HDFS daemons is deprecated.
WARNING: Attempting to execute replacement "hdfs --daemon start" instead.
Failed to start Hadoop namenode. Return value: 1[FAILED]
Wrapped exception:
Execution of '/sbin/service hadoop-hdfs-namenode start' returned 1: WARNING: Use of this script to start HDFS daemons is deprecated.
WARNING: Attempting to execute replacement "hdfs --daemon start" instead.
Failed to start Hadoop namenode. Return value: 1[FAILED][0m
[1;31mError: /Stage[main]/Hadoop::Namenode/Service[hadoop-hdfs-namenode]/ensure: change from stopped to running failed: Could not start Service[hadoop-hdfs-namenode]: Execution of '/sbin/service hadoop-hdfs-namenode start' returned 1: WARNING: Use of this script to start HDFS daemons is deprecated.
WARNING: Attempting to execute replacement "hdfs --daemon start" instead.
Failed to start Hadoop namenode. Return value: 1[FAILED][0m
2 、Enter the docker env, the log file /var/lib/hadoop-hdfs/nn.format.log, ERROR log :
2022-10-20 17:03:18,258 INFO namenode.FSImage: Allocated new BlockPoolId: BP-1575806489-172.24.0.2-1666256598253
2022-10-20 17:03:18,258 WARN namenode.NameNode: Encountered exception during format
java.io.IOException: Cannot create directory /data/1/namenode/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:447)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:591)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:613)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:189)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1278)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1726)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1834)
2022-10-20 17:03:18,505 INFO namenode.FSNamesystem: Stopping services started for active state
3、In docker env, using the user hdfs to check file failed. ERROR log:
[root@b3eb4f5cebef hadoop-hdfs]# ll /data/
drwxr-x--- 5 root root 4.0K Oct 20 17:03 1
drwxr-x--- 5 root root 4.0K Oct 20 17:03 2
[root@b3eb4f5cebef hadoop-hdfs]# su hdfs
bash-5.1$ cd /data/
bash: cd: /data/: Permission denied