1. 程式人生 > >NTP服務同步時間

NTP服務同步時間

sever conf配置

# For more information about this file, see the man pages

# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
 
driftfile /var/lib/ntp/drift
 
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
 
# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1
 
# Hosts on local network are less restricted.
# 允許內網其他機器同步時間
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
 restrict default nomodify
 
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# 中國這邊最活躍的時間伺服器 : http://www.pool.ntp.org/zone/cn
server 210.72.145.44 perfer   # 中國國家受時中心
server 202.112.10.36             # 1.cn.pool.ntp.org
server 59.124.196.83             # 0.asia.pool.ntp.org
 
#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
 
# allow update time by the upper server 
# 允許上層時間伺服器主動修改本機時間
restrict 210.72.145.44 nomodify notrap noquery
restrict 202.112.10.36 nomodify notrap noquery
restrict 59.124.196.83 nomodify notrap noquery
 
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. 
# 外部時間伺服器不可用時,以本地時間作為時間服務
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
 
# Enable public key cryptography.
#crypto
 
includefile /etc/ntp/crypto/pw
 
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography. 
keys /etc/ntp/keys
 
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
 
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
 
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
 
# Enable writing of statistics records.

#statistics clockstats cryptostats loopstats peerstats

client 配置

driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict -6 ::1
 
server 172.16.0.86
 
restrict 172.16.0.86 nomodify notrap noquery
 
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
 
includefile /etc/ntp/crypto/pw
 
keys /etc/ntp/keys

相關推薦

利用ntp服務同步時間(史上最簡單)

說明(文末附XShell下載地址):        本文僅適用於測試環境下,解決叢集時間同步問題。        生產環境ntp服務配置一般不能連外網,需要自行指定一臺伺服器作為ntp伺服器,此伺服器可以通過手動設定時間並寫入cmos硬體(防止重啟失效),其餘機器從指定的伺服

使用ntp服務同步時間

今天要在公司的叢集上做時間同步,一臺機子作為ntp伺服器,其餘的當做ntp客戶端。上網搜了一些資料,總結如下: ntp服務端配置 修改ntp配置檔案 # vi /etc/ntp.conf 注意修改中文處註釋 # Hosts on

NTP服務同步時間

sever conf配置 # For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5)

免費的NTP服務器-時間在線同步

免費的NTP服務器-時間在線同步免費的NTP服務器NTP服務器地址為:42.51.222.2使用方法:(win10系統為例。其他系統都一樣)打開控制面板的時間設置免費的NTP服務器-時間在線同步

Linux集群的NTP服務時間同步

inux art .org str 使用 rontab 定時任務 emc 用戶 我們搭建集群環境的時候,時間必須是要統一的,才能保證集群數據的一致性。 一般操作是直接使用NTP,跟默認的時間服務器同步,但是最好還是讓所有節點跟集群中的某臺作為時間服務器的節點同步。 步驟:(

NTP服務時間同步

位置 之前 時間同步 unity logs 選擇 --date 內容 sha 一、簡要說明 二、安裝步驟 三、配置文件 四、常用命令 五、註意事項 六、運行截圖 七、參考資料 一、簡要說明????????? 搭建Kubernetes環境,需要幾臺、幾十臺機器配合運作,許

ntp服務時間同步問題

今有一小型專案,完全自主弄,原來以為很簡單的NTP服務,我給折騰了2個多小時才整撐頭(以前都是運維搞,沒太注意,所以這技術的東西,在簡單都需要親嘗啊),這裡記錄為以後別再浪費時間。    目標環境,5臺linux centos 6.3, 一臺作為NTPD服務與外部公共NT

NTP服務時間同步(CentOS6.x)

今有一小型專案,完全自主弄,原來以為很簡單的NTP服務,我給折騰了2個多小時才整撐頭(以前都是運維搞,沒太注意,所以這技術的東西,在簡單都需要親嘗啊),這裡記錄為以後別再浪費時間。 目標環境,5臺linux centos 6.3, 一臺作為NTPD服務與外部公共NTP服

NTP服務時間同步

  今有一小型專案,完全自主弄,原來以為很簡單的NTP服務,我給折騰了2個多小時才整撐頭(以前都是運維搞,沒太注意,所以這技術的東西,在簡單都需要親嘗啊),這裡記錄為以後別再浪費時間。    目標環境,5臺linux centos 6.3, 一臺作為NTPD服務與外部公共NTP服務同步時間,同時作為

ntp時間服務同步

nom trap con ets 時間段 每天 ntp服務 開始 導致 第一種方式:同步到網絡時間服務器   # ntpdate time.windows.com將硬件時間設置為當前系統時間。   #hwclock –w   加入crontab:   30 8 *

Linux配置NTP服務器,時間同步

dir entos 日誌文件 light ont evel hwclock eve str 當服務器多了,時間準確與否,一致與否是個大問題。雖然這個問題總是被忽略,但是統一一致的時間是很有必要的。下面說一下在局域網內配置Linux時間服務器的方法。 配置的環境及要求: 假設

NTP及Chrony時間同步服務設置

ntpNTP服務設置Chronyd服務設置內容詳見附件本文出自 “Linux” 博客,請務必保留此出處http://837244.blog.51cto.com/827244/1980308NTP及Chrony時間同步服務設置

Linux之使用NTP服務管理/同步伺服器時間

當有多臺Web Server時,而且每臺伺服器的時間需要保持一致,這時就可以考慮使用NTP 服務了。 1.先用用ntpstat檢視一下NTP service當前的狀態。 #ntpstat 如果輸出下面內容,說明還沒有啟動,需要設定伺服器重啟時NTP服務自啟動: Unable to talk to N

專案開發環境部署:Linux上搭建ntp服務,實現時間同步

一 引言目前的專案有多個伺服器,排查BUG,發現各個伺服器的時間不一致,遂網上查詢資源,使得時間保持一致。二 步驟1)以第一臺伺服器為“服務端”,其他臺伺服器為“客戶端”,“客戶端”從“服務端”同步時間。2)所有伺服器安裝ntp服務:yum install ntp     

ntp同步時間服務

第二種方式:同步到區域網內部的一臺時間同步伺服器 一、搭建時間同步伺服器 1、編譯安裝ntp server rpm -qa | grep ntp 若沒有找到,則說明沒有安裝ntp包,從光碟上找到ntp包,使用 rpm -Uvh ntp***.rpm 進行安裝 2、修改ntp.conf配置檔案 vi /etc/

基於【CentOS-7+ Ambari 2.7.0 + HDP 3.0】搭建HAWQ資料倉庫——安裝配置NTP服務,保證叢集時間保持同步

一、所有節點上使用yum安裝配置NTP服務yum install ntp -y 二、選定一臺節點作為NTP server, 192.168.58.11修改/etc/ntp.conf vim /etc/ntp.conf 1,註釋掉restrict 127.0.0.1 ,修改為: restrict 192

NTP服務時間同步方案

一、NTP Server部分 若要將內部時間伺服器配置為與外部時間源同步,請按照下列步驟操作:     1. 將伺服器型別更改為 NTP。為此,請按照下列步驟操作:         a. 單擊“開始”,單擊“執行”,鍵入 regedit,然後單擊“確定”。        

移植ntp服務至嵌入式開發板 與伺服器同步時間

開發板: helper2416  CPU: 三星2416  linux核心版本:3.2.6 2. 編譯: # cd ntp-4.2.8p2/ # ./configure --host=arm-linux --with-yielding-select=yes# make &

配置NTP服務時間同步(suse)

為了確保叢集內時間一致,需要配置NTP 時間同步伺服器,本文使用中國國家授時中心的時鐘同步伺服器,p地址210.72.145.44。因此叢集中每臺機器和210.72.145.44時鐘伺服器進行同步即可。 配置步驟如下: 1) 編輯/etc/sysconfig/ntp, 新增

區域網時間同步NTP服務架設

本文主要介紹當局域網內伺服器不能連線外網,但是又必須保持各伺服器時間同步 1.選用區域網內的其中一臺機器做為ntp時間同步源伺服器,其他節點機器從源時間同步伺服器同步時間 例如我選用的機器為:172.16.19.156(機器名稱:centos-1) 2.時間源同步伺服器1