Linux Cluster time synchronization

Source: Internet
Author: User
Tags set time

Source: http://blog.csdn.net/jiangheng0535/article/details/10287609

Description: Due to the high time requirement of Hadoop cluster, the hosts in the cluster should be synchronized frequently. This document is suitable for Ubuntu, Redhat series.

Note: A lot of content is in the online excerpt, and then after the test summary, if there is doubt can leave a message to discuss.

1. Set the host time accurately (any machine can). //If you do not need to synchronize network time, you can omit this step

1.1 View native time and time zone (date)

1.2 Set time zone (tzselect; execute cp/usr/share/zoneinfo/asia/shanghai/etc/localtime after selection ) (This is Redhat's modified time zone, Ubuntu is easier, Command Online search)

1.3 Modification Time (date-s 00:00:00 or network sync:apt-get install ntpdate; ntpdate cn.pool.ntp.org)

1.4 Write Hard Disk Time (hwclock-w)

This completes the host time setting.

2. Time synchronization (host )

Configuring the Host Environment (yum install NTP) ( also available with Ubuntu Master, set reference ubuntu time sync)

•vi/etc/ntp.conf

Add in the back

Server 127.127.1.0

Fudge 127.127.1.0 Stratum 10

• Turn off firewall: #service iptables Stop

• Restart the service:

Service ntpd Stop (Ubuntu is service NTP stop)

Service NTPD Start

This way the host is ready to complete.

3. Synchronization of other machines

• Wait for about five minutes, then sync the machine time to another machine (make sure the time zone is the same, otherwise the timing is sometimes bad)

Ntpdate IP address (host)

Date to see if the time is complete synchronously.

4. Depending on the need, this allows the machine to synchronize time automatically.

4.1.yum Install Crontabs (atp-get)

4.2.crontab-e Edit content: * */12 * * * */usr/sbin/ntpdate 172.72.103.228 ( updated every 12 hours, also can be updated at a specific time, the format can be found online)

4.3 Save to exit, you can view the record under/var/spool/mail/

Linux Cluster time synchronization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.