dfsput操作报“There are 0 datanode(s) running and no node(s) are excluded in this operation”

时间:2025-02-19 08:15:47
[root@centos128 hadoop]# ll /tmp
total 0
drwxr-xr-x. 3 root root 20 Jun 27 23:46 hadoop
drwxr-xr-x. 4 root root 31 Jun 27 23:46 hadoop-root
drwxr-xr-x. 2 root root  6 Jun 28 00:57 hsperfdata_root
drwxr-xr-x. 3 root root 21 Jun 28 00:48 Jetty_0_0_0_0_50070_hdfs____w2cu08
drwxr-xr-x. 3 root root 21 Jun 28 00:48 Jetty_0_0_0_0_50090_secondary____y6aanv
drwxr-xr-x. 3 root root 21 Jun 27 23:01 Jetty_localhost_33451_datanode____ihzion
drwxr-xr-x. 3 root root 21 Jun 28 00:19 Jetty_localhost_34384_datanode____gijfbp
drwxr-xr-x. 3 root root 21 Jun 28 00:48 Jetty_localhost_38324_datanode____wwolqv
drwxr-xr-x. 3 root root 21 Jun 27 23:49 Jetty_localhost_40770_datanode____.cx9tc5
drwxr-xr-x. 3 root root 21 Jun 27 23:59 Jetty_localhost_43407_datanode____.hgiwfx
drwxr-xr-x. 3 root root 16 Jun  9 06:34 pip-build-hv2v27iz
drwx------. 3 root root 17 Jun 28 00:27 -j5KhNK
[root@centos128 hadoop]# cd /tmp
[root@centos128 tmp]# rm -rf hsp* Jett* systemd* hadopp*
[root@centos128 tmp]# ll
total 0
drwxr-xr-x. 3 root root 20 Jun 27 23:46 hadoop
drwxr-xr-x. 4 root root 31 Jun 27 23:46 hadoop-root
drwxr-xr-x. 3 root root 16 Jun  9 06:34 pip-build-hv2v27iz
[root@centos128 tmp]# rm -rf hadoop*
[root@centos128 tmp]# ll
total 0
drwxr-xr-x. 3 root root 16 Jun  9 06:34 pip-build-hv2v27iz


重新format namenode
bin/hdfs namenode -format
sbin/


Browse the web interface for the NameNode; by default it is available at:
    NameNode - http://192.168.44.128:50070/
发现有一个live nodes ,并且Datanode Information 有信息

[root@centos128 hadoop]# bin/hdfs dfs -mkdir /user
[root@centos128 hadoop]# bin/hdfs dfs -mkdir /user/root
[root@centos128 hadoop]# bin/hdfs dfs -put etc/hadoop input
没有报错,正常。下面继续操作

[root@centos128 hadoop]# bin/hdfs dfs -ls
Found 2 items
drwxr-xr-x   - root supergroup          0 2017-06-28 01:05 input
drwxr-xr-x   - root supergroup          0 2017-06-28 01:06 output
[root@centos128 hadoop]# bin/hdfs dfs -ls output
Found 2 items
-rw-r--r--   1 root supergroup          0 2017-06-28 01:06 output/_SUCCESS
-rw-r--r--   1 root supergroup        220 2017-06-28 01:06 output/part-r-00000
[root@centos128 hadoop]# bin/hdfs dfs -ls input/hadoop
ls: `input/hadoop': No such file or directory
[root@centos128 hadoop]# bin/hdfs dfs -ls input
Found 29 items
-rw-r--r--   1 root supergroup       4942 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       1335 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup        318 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup        884 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       3804 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       4696 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       2490 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       2598 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       9683 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup        867 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       1449 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       1657 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup         21 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup        620 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       3518 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       1611 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       1631 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       5546 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup      13661 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup        951 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       1383 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       4113 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup        758 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup         10 2017-06-28 01:05 input/slaves
-rw-r--r--   1 root supergroup       2316 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       2697 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       2250 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup       4567 2017-06-28 01:05 input/
-rw-r--r--   1 root supergroup        690 2017-06-28 01:05 input/
[root@centos128 hadoop]# bin/hdfs dfs -get output output
[root@centos128 hadoop]# cat output/*
cat: output/output: Is a directory
1    dfsadmin