每周总结--Hadoop的学习(2)

这周完成内容:

1.添加shell脚本-xsync,实现集群间的文件复制

#!/bin/bash
#1. 判断参数个数
if [ $# lt 1 ]
then
echo Not Enough Arguement!
exit;
fi

#2. 遍历集群所有机器

for host in centos01 centos02 centos03
do
echo ==================== $host ====================
#3. 遍历所有目录,挨个发送
for file in $@
do
#4. 判断文件是否存在
if [ e $file ]
then
#5. 获取父目录
pdir=$(cd P $(dirname $file); pw d)
#6. 获取当前文件的名称
fname=$(basename $file)
ssh $host "mkdir p $pdir"
rsync av $pdir/$fname $host:$pdir
else
echo $file does not exists!
fi
done
done

2.ssh无密码登录

3.集群配置

修改core-site.xml,hdfs-site.xml,yarn-site.xml,mapred-site.xml

配置workers

首次启动,格式化NameNode

配置历史服务器

遇到问题:

hadoop运行出错

解决:https://www.cnblogs.com/cslgzl/p/10684730.html

无法启动JobHistorysServer

解决:https://blog.csdn.net/GoSaint/article/details/88061456

 下周目标:继续学习hadoop

原文地址:https://www.cnblogs.com/leiyu1905/p/15119309.html