Centos6 system time synchronization ntpdate

Source: Internet
Author: User

Centos6 system time synchronization ntpdate

The newly installed linux system server may be set incorrectly. The cluster time is very important during cluster creation. It is very likely that cluster errors occur due to time. Therefore, you need to adjust the time zone and adjust the time.

As follows, the CentOS6 system uses NTP to synchronize time from a time server so that the time is synchronized at regular intervals.

Perform the following steps to synchronize time in CentOS6:

1. Some versions do not contain netdate, so you need to download

# Yum install-y ntpdate

2. Change the current time zone to Shanghai, that is, Beijing time + 8.

If you want to change other time zones, you can go to the/usr/share/zoneinfo directory.

# Yes | cp-f/usr/share/zoneinfo/Asia/Shanghai/etc/localtime

3. Use NTP to synchronize time

# Ntpdate us.pool.ntp.org

4. We have timed synchronization of time.

Add scheduled tasks and synchronize the clock every 10 minutes

# Crontab-l>/tmp/crontab. bak

# Echo "*/10 *****/usr/sbin/ntpdate us.pool.ntp.org | logger-t NTP">/tmp/crontab. bak

# Crontab/tmp/crontab. bak

In this way, we have solved the problem of inaccurate time.

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.