无法在HDFS中创建目录。名称节点处于安全模式

时间:2019-01-05 18:10:12

标签: hadoop hdfs namenode datanode

我已经在Hadoop上部署了Hadoop,该docker在aws ec2 ubuntu AMI实例上运行。

当我尝试在hdfs中创建目录时,它说无法创建目录。名称节点处于安全模式

下面是hdfs-site.xml中的属性

name: dfs.replication
value: 1

name: dfs.namenode.name.dir
value: /usr/local/hadoop/data

当我检查hdfs报告时,它给出以下输出。

bash-4.1# hdfs dfsadmin -report
19/01/05 12:34:20 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Safe mode is ON
Configured Capacity: 0 (0 B)
Present Capacity: 335872 (328 KB)
DFS Remaining: 0 (0 B)
DFS Used: 335872 (328 KB)
DFS Used%: 100.00%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0
Missing blocks (with replication factor 1): 0

下面是有关名称节点的一些细节。

bash-4.1# hdfs dfs -df
19/01/05 12:37:20 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Filesystem                Size    Used  Available       Use%
hdfs://0cd4da30c603:9000     0  335872          0  Infinity%

如果我设置为退出安全模式,则在几秒钟内它将返回安全模式。

bash-4.1# hdfs dfsadmin -safemode leave
19/01/05 12:42:26 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Safe mode is OFF
bash-4.1# hdfs dfsadmin -safemode get  
19/01/05 12:42:36 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Safe mode is ON

下面是我的文件系统信息

bash-4.1# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          25G  6.2G   19G  26% /
tmpfs            64M     0   64M   0% /dev
tmpfs           492M     0  492M   0% /sys/fs/cgroup
/dev/xvda1       25G  6.2G   19G  26% /data/lab
/dev/xvda1       25G  6.2G   19G  26% /etc/resolv.conf
/dev/xvda1       25G  6.2G   19G  26% /etc/hostname
/dev/xvda1       25G  6.2G   19G  26% /etc/hosts
shm              64M     0   64M   0% /dev/shm
tmpfs           492M     0  492M   0% /proc/acpi
tmpfs            64M     0   64M   0% /proc/kcore
tmpfs            64M     0   64M   0% /proc/keys
tmpfs            64M     0   64M   0% /proc/timer_list
tmpfs            64M     0   64M   0% /proc/sched_debug
tmpfs           492M     0  492M   0% /proc/scsi
tmpfs           492M     0  492M   0% /sys/firmware

我期望在hdfs中创建一个目录以执行MapReduce操作

0 个答案:

没有答案