Do anything to withstand setbacks, to have the perseverance and perseverance, with confidence to stick it out

Hadoop configures cluster event synchronization

Time synchronization mode

Find a machine to act as a time server, and synchronize all machines with this cluster time periodically, say, every ten minutes

Configure time synchronization steps

1. Time server configuration (root user required)

rpm -qa|grep ntpCopy the code

2. Modify the NTP configuration file

Conf a) Modify 1 (Authorize all machines on network segment 192.168.1.0 to query and synchronize time from this machine.) Enable # RESTRICT 192.168.1.0 mask 255.255.255.0 Nomodify notrap is set to Restrict 192.168.1.0 Mask 255.255.255.0 nomodify notrap b. Do not use other network time) 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 is #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 c) added 3 (when this node loses network connection, You can still use this as a time server to synchronize time to other nodes in the cluster.) Server 127.127.1.0 fudge 127.127.1.0 stratum 10Copy the code

3. Modify the /etc/sysconfig/ntpd file

Vim /etc/sysconfig/ntpd Add the following information (synchronize hardware time with system time) SYNC_HWCLOCK=yesCopy the code

4. Restart NTPD

service ntpd status
service ntpd startCopy the code

5. Add configuration items

chkconfig ntpd onCopy the code

6. Other machine configurations (must be root user)

(1) Write a scheduled task and synchronize it with the master time server once in 10 minutes

Crontab -e Write scheduled tasks as follows: */10 * * * * /usr/sbin/ntpdate hadoop102Copy the code

(2) Modify any time

date -s "2017-9-11 11:11:11"Copy the code

(3) Check whether the synchronization is successful ten minutes later

dateCopy the code

The relevant data

GitHub: github.com/zhutiansama…

FocusBigData is the public account for this article

Reply [big data interview] [Big data interview experience] [Big data learning roadmap] there will be surprise oh