实验步骤:
1、启动Hadoop
[root@neusoft-master ~]# jps
2、在/usr/local/filecotent下新建hellodemo文件,并写入以下内容,以\t(tab键隔开)
[root@neusoft-master filecontent]# vi hellodemo
hello you
hello me
3、在SecureCRT中运行执行以下步骤:
①hdfs中创建data目录
[root@neusoft-master filecontent]# hadoop dfs -mkdir /data
②将/usr/local/filecontent/hellodemo 上传到hdfs的data目录中
[root@neusoft-master filecontent]# hadoop dfs -put hellodemo /data
③查看data目录下的内容
[root@neusoft-master filecontent]# hadoop dfs -ls /data
④查看hellodemo的文件内容