[hadoop@localhost ~]$ hdfs dfs -ls
Found 1 items
drwxr-xr-x - hadoop supergroup 0 2018-02-22 23:41 output
[hadoop@localhost ~]$ vi my-local.txt
hello boy!
yehyeh
上传本地文件至集群
[hadoop@localhost ~]$ hdfs dfs -mkdir upload
[hadoop@localhost ~]$ hdfs dfs -ls upload
[hadoop@localhost ~]$ hdfs dfs -ls
Found 2 items
drwxr-xr-x - hadoop supergroup 0 2018-02-22 23:41 output
drwxr-xr-x - hadoop supergroup 0 2018-02-23 22:38 upload
[hadoop@localhost ~]$ hdfs dfs -ls upload
[hadoop@localhost ~]$ hdfs dfs -put my-local.txt upload
[hadoop@localhost ~]$ hdfs dfs -ls upload
Found 1 items
-rw-r--r-- 3 hadoop supergroup 18 2018-02-23 22:45 upload/my-local.txt
[hadoop@localhost ~]$ hdfs dfs -cat upload/my-local.txt
hello boy!
yehyeh
[hadoop@localhost ~]$
ps:注意本地java版本与master拷贝过来的文件中/etc/hadoop-env.sh配置的JAVA_HOME是否要保持一致没有验证过,本文是保持一致的。
Hadoop项目之基于CentOS7的Cloudera 5.10.1(CDH)的安装部署
Ubuntu 14.04下Hadoop集群安装
Ubuntu 16.04上构建分布式Hadoop-2.7.3集群