This is the 12th day of my participation in Gwen Challenge
Hadoop fully distributed operating mode of the case, xiaobian has put the fully distributed operating mode of the detailed construction process to demonstrate again, I believe that we have learned! Today, xiaobian take you to solve the cluster time synchronization problem, time synchronization is also a must do in the time work. None of this is difficult when you master Linux’s system time synchronization commands. Today’s main topic is synchronizing scheduled tasks and cluster time in the Crond system.
Before we learn about cluster time synchronization, let’s review the Crond system timing task. This is actually covered in the previous section. Today, xiaobian or take you to review it again.
Task scheduling: refers to a specific command or program executed by the system at a certain time. Task scheduling classification:
1. Systems work: Some important work must be performed on a recurring basis. Such as virus scanning;
2. Individual user work: Individual users may want to perform certain programs, such as backups of the mysql database.
Restart the Crond service: Servicecrond restart
Append “yanjing” to bailongma. TXT every 1 minute as follows:
Time synchronization method: find a machine, as the time server, all machines and this cluster time synchronization, for example, every 10 minutes, once.
(1) Configure 10 minutes for synchronization with the time service machine on other machines; (2) Modify NTP configuration files. (3) Modify the /etc/sysconfig/ntpd file. (4) Restart NTPD service; (5) Set the NTPD service to start upon startup.
(1) Check whether NTP is installed. (2) Modify any machine time; (3) Check whether it is synchronized with the time machine service machine after ten minutes.
(1) check whether the NTP installation: RPM – qa | grep NTP
(2) Modify the NTP configuration file vim /etc/ntp.conf
This step can not be set, because later to turn off (my computer performance is poor, let alone in the virtual machine, in order not to affect the performance of not set). However, it must be set in real enterprise development.
[root@hadoop103 desktop]#crontab -e
*/10 * * * * /usr/sbin/ntpdate hadoop102
[root@hadoop103 desktop]#date -s “2017-9-11 11:11:11”
Note: When testing, you can adjust 10 minutes to 1 minute to save time.
Hadoop103 synchronizes time with Hadoop102 every minute
This article is a supplement to the case study of Hadoop’s fully distributed mode of operation, where the cluster must be set up for time synchronization. Of course, the specific synchronization set what tasks, this needs to be combined with the actual work requirements. Today, xiaobian supplementary explanation content ends here, please keep your attention, continue to update more dry goods. Xiaobian will continue to update big data and other content, please stay tuned. More exciting content, please pay attention to the public number: Xiao Han senior take you to learn