您的位置:首页 > 运维架构

hadoop环境搭建的测试

2016-11-20 00:00 465 查看
hadoop fs -ls hdfs://localhost:9000/

hadooop -put jdkxxx.tar.gz /
【报错】
------------------------------------------------------------------------
put: File /jdk-7u60-linux-i586.tar.gz._COPYING_ could only be replicated to 0 nodes instead of minReplication (=1). There are 0 datanode(s) running and no node(s) are excluded in this operation.
------------------------------------------------------------------------
【若是 DataNode 没有启动】
-----------------------------------------------------
# 针对 DataNode 没法启动的解决方法
./sbin/stop-dfs.sh # 关闭
rm -r ./tmp # 删除 tmp 文件,注意这会删除 HDFS 中原有的所有数据
./bin/hdfs namenode -format # 重新格式化 NameNode
./sbin/start-dfs.sh # 重启
----------------------------------------------------- http://www.powerxing.com/install-hadoop/ 搭建过程的
地址

查看数据块block(hdfs-site.xml文件中) /home/hadoop/local/hadoop/tmp/dfs/data/current/BP-333563086-192.168.31.235-1479593039948/current/finalized

取文件
hadooop fs -get /jdk-7u60-linux-i586 /

新建一个文本
随便输入一些内容

cd /home/hadoop/app/hadoop-2.4.1/share/hadoop/mapreduce
·hadoop-mapreduce-examples-2.4.1.jar

test.data
随便输入内容

放到hadoop上的目录
蒋test.data,put到上/去
命令
hadoop jar hadoop-mapreduce-examples-2.4.1.jar wordcount /input/test.data(源) /output/data(结果保存,该目录应不存在,否则报错)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: