Linux build local NTP time server

Source: Internet
Author: User
Tags local time

Linux Build local time server

Pre-Experiment Description:

Lab Machine: VMware 10

Experimental system: CentOS6.6

Experimental purpose: To make all CentOS systems on VMware the same time, convenient to do cluster experiment;

#

1, compile and install NTP (on the machine you want to do time server) I this machine IP: 172.16.249.135

# Install the GCC compiler

Yum Install Gcc-y

# Download Packages

wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.6p4.tar.gz

# Unzip Package

Tar XF ntp-4.2.6p4.tar.gz

# Enter the extracted directory to prepare the installation

CD NTP-4.2.6P4

# Detect compiled installation environment

./configure--PREFIX=/USR/LOCAL/NTP--enable-all-clocks--enable-parse-clocks

# installation

Make && make install

2. Configure the NTP server

# Modify the NFP configuration file

Vim/etc/ntp.conf

Comment on the line,

# Restrict default Kod nomodify notrap nopeer noquery

Restrict default nomodify

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/58/2A/wKiom1SqgriTE-1GAAB6QlncmR4835.jpg "title=" 2015-01-05_202459.png "alt=" Wkiom1sqgrite-1gaab6qlncmr4835.jpg "/>

3. Start the NTP service;

#/usr/local/ntp/bin/ntpd-c/etc/ntp.conf-p/tmp/ntpd.pid

And then...


And then you wait, like, 15 minutes or so,


Use commands on other virtual machines after a period of time

# ntpdate 172.16.249.135 can synchronize time;

1, where the IP is the IP as the time server

2, recommended more than 20 minutes in sync, otherwise it will prompt "No server suitable for synchronization found" this error;

#####################

In some cases, you may wait 15 minutes after the update, or will prompt the above error;

At this point, you add the following two lines to the/etc/ntp.conf file, casually find a place to add in, waiting for 5 minutes; OK;

Server 127.127.1.0

Fudge 127.127.1.0 Stratum 8


Linux build local NTP time server

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.