天天看点

hadoop 服务器修改时间后,Hadoop历史服务器、日志聚集、集群时间同步

历史服务器

在mapred-site.xml中添加配置:

mapreduce.jobhistory.address

yjy-pt03:10020

mapreduce.jobhistory.webapp.address

yjy-pt03:19888

(在配置的机器)启动历史服务器:sbin/mr-jobhistory-daemon.sh start historyservice

上面的过时了 bin/mapred --daemon start historyserver

查看历史服务器是否启动:jps

日志聚集

1.在yarn-site.xml中新增配置:

yarn.log-aggregation-enable

true

yarn.log-aggregation.retain-seconds

604800

2.关闭NodeManager、ResourceManager、HistoryServer

stop-dfs.sh

stop-yarn.sh

mr-jobhistory-daemon.sh stop historyserver

3.启动NodeManager、ResourceManager、HistoryServer

start-dfs.sh

start-yarn.sh

mr-jobhistory-daemon.sh start historyserver

集群时间同步

hbase机器之间的时间差是毫秒级的,不能超过1秒

hdfs和yarn还好,差几周还能起得来

ntp服务

1.查看是否有ntp服务

rpm -qa|grep ntp

或者systemctl status ntpd

查看是否有ntp和ntpdate

安装ntp服务

如果正在运行需要关闭server ntpd stop再chkconfig ntpd off

2.修改/etc/ntp.conf配置文件

将注释开放

retrict 192.168.1.0 mask 225.225.225.0 nomodify notrap

将开放注释

#server 0.centos.pool.ntp.org.iburst

#server 1.centos.pool.ntp.org.iburst

#server 2.centos.pool.ntp.org.iburst

#server 3.centos.pool.ntp.org.iburst

将本地时间作为节点时间

server 127.127.1.0

fudge 127.127.1.0 startum 10

3.修改文件 vim /etc/sysconfig/ntpd

增加

SYNC_HWCLOCK=yes

4.启动ntpdservice ntpd start

5.设置ntpd开机启动chkconfig ntpd on

6.其他节点使用corntab工具去配置的节点拉取时间

crontab -e

编写如下定时任务

*/10 * * * * /usr/sbin/ntpdate yjy-pt01

p.s.修改任意机器的时间date -s "2020-05-21 00:00:00"查看时间date