大数据||hadoop分布式部署分发、基本测试及监控

先看文章大数据||hadoop分布式集群安装
分发包括:通过主节点给子节点分发数据。免密形式
基本测试包括:创建目录,上传文件、读取文件等

HDFS

  • namenode节点格式化(131)

命令bin/hdfs namenode -format
说明:只有第一次部署的格式化。后面不要格式化要不datanode节点启动会报错。

  • 启动hdfs

命令:sbin/start-dfs.sh



查看启动结果:jps

  • web页面方式查看

http://hadoop-senior.beifeng.com:50070/dfshealth.html#tab-datanode

  • 常见错误

如果hostname配置的不正确导致无法启动datanode,修改后重启服务
如果slaves 没有配置导致只启动一个datanode。
错误排查方式:查看logs下的对应日志文件。
sbin/stop-dfs.sh 命令执行的日志也可以查看错误。

停止hdfs时错误

  • 测试hdfs

测试命令(创建hdfs系统中文件夹):bin/hdsf dfs -mkdir -p /user/beifeng/temp


查看结果

上传文件测试命令: bin/hdfs dfs -put etc/hadoop/*-site.xml /user/beifeng/temp
向132服务器同步数据时报错


报错

意思就是坏的连接 网络未通你把防火墙一关就好了。(浪费我2个小时时间

  1. 重启后生效
    开启: chkconfig iptables on
    关闭: chkconfig iptables off
  2. 即时生效,重启后失效
    开启: service iptables start
    关闭: service iptables stop
    解决办法添加端口50010。vi /etc/sysconfig/iptables
  • 测试文件上传put

命令:bin/hdfs dfs -put etc/hadoop/*-site.xml /user/root/user/beifeng/


yarn启动

sbin/start-yarn.sh

  • 启动结果正常




测试yarn服务
  • 创建MapReduce的input目录

bin/hdfs dfs -mkdir -p /user/beifeng/mapreduce/wordcount/input
bin/hdfs dfs -ls /user/beifeng/mapreduce/wordcount/input

  • 上传wordcount需要计算的文件

bin/hdfs dfs -put /opt/modules/hadoop-2.5.0/wc.input /user/beifeng/mapreduce/wordcount/input

  • 测试yarn服务上的MapReduce

命令: bin/yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.0.jar wordcount /user/beifeng/mapreduce/wordcount/input /user/beifeng/mapreduce/wordcount/output
查看运行结果
bin/hdfs dfs -text /user/beifeng/mapreduce/wordcount/output/part*




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值