CentOS学习20_centos 6.4 NTP服务器的搭建过程
来源:互联网 发布:从数组中删除指定元素 编辑:程序博客网 时间:2024/05/22 14:19
1
2
3
4
5
6
7
8
以源代码为例
# wget http://ntp.buptnet.edu.cn/ntp_chinese/down/server/ntp-4.2.0.tar.gz
# tar -zxvf ntp-4.2.0.tar.gz –C /usr/local/src;cd /usr/local/src/ntp-4.2.0
2. 开始设定参数、编译与安装:
#./configure --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks
# make clean ; make
# make check
# make install
1
2
3
4
5
6
7
8
6.1.2.1. Can I use my system clock as reference clock? YES,as you
do
like so
#server 127.127.1.1 #LCL,local clock,最好不要这样。引发时间混乱
6.1.3.1. How can I configure the amount of logging information?
6.1.3.2. How can I speed up initial Synchronization?
6.1.3.3. How
do
I configure remote administration?
6.1.3.4. How
do
I use authentication keys?
6.1.3.5. What are all the different Keys used
for
?
6.1.3.6. How
do
I use the new autokey feature?
具体解决方法,查看文首提示的官网链接
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# write the server time and local BIOS time in it ,and count it.
driftfile
/var/lib/ntp/drift
#restrict default kod nomodify notrap nopeer noquery
#restrict -6 default kod nomodify notrap nopeer noquery
# the Usage
# restrict [ your IP address ] mask [ netmask ] [ power ]
# power: ignore --> deny all of types NTP connection
# power: nomodify --> deny clients use ntpq or ntpc to change the time of NTP server
# power: noquery --> deny clients use ntpq or ntpc to checkout time , that means deny clients use the NTP server.
# power: notrap --> dont't support remote event logging.
# power: notrust --> deny clients that not be authored.
# if "[ power ]" is null , it means every client can use this host of NTP server.
restrict default nomodify notrap noquery
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.255.0 nomodify
restrict -6 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# server 210.72.145.44 is BJ Time Station.
# source of ntp-server ; and prefer is priority
server asia.pool.ntp.org prefer
server 210.72.145.44
# local network lo interface
server 127.127.1.1
# LCL does't sync
fudge 127.127.1.1 stratum 10 refid NIST
# broadcast delay frequency
Broadcastdelay 0.008
#server 127.127.1.1
logfile
/var/log/ntp
.log
#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
# 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
1
2
[root@gang ~]
# /etc/init.d/ntpd start
Starting ntpd: [ OK ]4. 一下为正常
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Mar 24 18:29:45 gang ntpd[3547]: ntpd 4.2.6p5@1.2349-o Sat Nov 23 18:21:48 UTC 2013 (1)
Mar 24 18:29:45 gang ntpd[3548]: proto: precision = 0.628 usec
Mar 24 18:29:45 gang ntpd[3548]: 0.0.0.0 c01d 0d kern kernel
time
sync
enabled
Mar 24 18:29:45 gang ntpd[3548]: line 32 column 1 syntax error, unexpected T_String, expecting $end
Mar 24 18:29:45 gang ntpd[3548]: syntax error
in
/etc/ntp
.conf line 32, column 1
Mar 24 18:29:45 gang ntpd[3548]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Mar 24 18:29:45 gang ntpd[3548]: Listen and drop on 1 v6wildcard :: UDP 123
Mar 24 18:29:45 gang ntpd[3548]: Listen normally on 2 lo 127.0.0.1 UDP 123
Mar 24 18:29:45 gang ntpd[3548]: Listen normally on 3 br0 192.168.0.199 UDP 123
Mar 24 18:29:45 gang ntpd[3548]: Listen normally on 4 eth0 fe80::eea8:6bff:fea4:912b UDP 123
Mar 24 18:29:45 gang ntpd[3548]: Listen normally on 5 br0 fe80::eea8:6bff:fea4:912b UDP 123
Mar 24 18:29:45 gang ntpd[3548]: Listen normally on 6 lo ::1 UDP 123
Mar 24 18:29:45 gang ntpd[3548]: peers refreshed
Mar 24 18:29:45 gang ntpd[3548]: Listening on routing socket on fd
#23 for interface updates
1
2
3
4
[root@gang ~]
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
proxy02.ispros. .INIT. 16 u - 256 0 0.000 0.000 0.000
1
2
3
4
5
[root@gang ~]
# ping asia.pool.ntp.org
PING asia.pool.ntp.org (78.111.50.2) 56(84) bytes of data.
^C
--- asia.pool.ntp.org
ping
statistics ---
28 packets transmitted, 0 received, 100% packet loss,
time
27241ms
1
2
3
4
5
6
[root@gang ~]
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*time2.isu.net.s .GPS. 1 u 2 64 27 341.015 -64.352 16.181
210.72.145.44 .INIT. 16 u - 64 0 0.000 0.000 0.000
LOCAL(1) .NIST. 10 l 13 64 177 0.000 0.000 0.000
0 0
- CentOS学习20_centos 6.4 NTP服务器的搭建过程
- centos 6.4 NTP服务器的搭建过程
- CentOS搭建NTP服务器
- centos 7 搭建ntp 服务器
- centos服务器搭建ntp服务
- CentOS学习10_CentOS系统安装过程和配置细节
- CentOS 6搭建局域网NTP服务器
- CentOS 7 搭建ntp时钟服务器
- Ntp时间服务器的搭建
- 关于Centos NTP服务器的设置
- CentOS NTP服务搭建
- centos安装ntp服务器
- CentOS 设置NTP服务器
- CentOS NTP服务器
- (Ubuntu+Centos) ntp时间同步服务器搭建与使用
- 搭建自己的NTP时间服务器
- 搭建自己的NTP时间服务器
- NTP服务器的搭建与错误分析
- 如何封装 opengl 流程 – 以为android-opengl-canvas例
- C语言二级指针
- mysql 数据库引擎
- spring自定义注解
- UITableViewCell中嵌套UITableView,用UITextView加载HTML数据
- CentOS学习20_centos 6.4 NTP服务器的搭建过程
- Multisim使用中出现的问题以及解决
- AndroidStudio常用插件及使用
- react native项目中的问题记录
- activemq中对单独的监听器开启线程
- 无线热点认证解决方案 WifiDog
- Faster RCNN中间层可视化
- Enabling Thumbnails with the Nivo Slider
- 阶段学习总结_1109