企业网站建设公司司,北京婚恋网站哪家最好,微信支付需要网站备案,成品1688网站一、搭建时间同步服务器1、编译安装ntp serverrpm -qa | grep ntp若没有找到#xff0c;则说明没有安装ntp包#xff0c;从光盘上找到ntp包#xff0c;使用rpm -Uvh ntp***.rpm进行安装2、修改ntp.conf配置文件vi /etc/ntp.conf①、第一种配置#xff1a;允许任何IP的客户机…一、搭建时间同步服务器1、编译安装ntp serverrpm -qa | grep ntp若没有找到则说明没有安装ntp包从光盘上找到ntp包使用rpm -Uvh ntp***.rpm进行安装2、修改ntp.conf配置文件vi /etc/ntp.conf①、第一种配置允许任何IP的客户机都可以进行时间同步将“restrict default nomodify notrap noquery”这行修改成restrict default nomodify notrap配置文件示例/etc/ntp.conf②、第二种配置只允许192.168.211.***网段的客户机进行时间同步在restrict default nomodify notrap noquery表示默认拒绝所有IP的时间同步之后增加一行restrict 192.168.211.0 mask 255.255.255.0 nomodify notrap3、启动ntp服务service ntpd start开机启动服务chkconfig ntpd on4、ntpd启动后客户机要等几分钟再与其进行时间同步否则会提示“no server suitable for synchronization found”错误。 二、配置时间同步客户机手工执行 ntpdate ntp server 来同步或者利用crontab来执行crontab -e0 21 * * * ntpdate 192.168.211.22 /root/ntpdate.log 21每天晚上9点进行同步附当用ntpdate -d 来查询时会发现导致 no server suitable for synchronization found 的错误的信息有以下2个错误1.Server dropped: Strata too high在ntp客户端运行ntpdate serverIP出现no server suitable for synchronization found的错误。在ntp客户端用ntpdate –d serverIP查看发现有“Server dropped: strata too high”的错误并且显示“stratum 16”。而正常情况下stratum这个值得范围是“0~15”。这是因为NTP server还没有和其自身或者它的server同步上。以下的定义是让NTP Server和其自身保持同步如果在/ntp.conf中定义的server都不可用时将使用local时间作为ntp服务提供给ntp客户端。server 127.127.1.0fudge 127.127.1.0 stratum 8在ntp server上重新启动ntp服务后ntp server自身或者与其server的同步的需要一个时间段这个过程可能是5分钟在这个时间之内在客户端运行ntpdate命令时会产生no server suitable for synchronization found的错误。那么如何知道何时ntp server完成了和自身同步的过程呢在ntp server上使用命令# watch ntpq -p出现画面Every 2.0s: ntpq -p Thu Jul 10 02:28:32 2008 remote refid st t when poll reach delay offset jitter192.168.30.22 LOCAL(0) 8 u 22 64 1 2.113 179133. 0.001LOCAL(0) LOCAL(0) 10 l 21 64 1 0.000 0.000 0.001注意LOCAL的这个就是与自身同步的ntp server。注意reach这个值在启动ntp server服务后这个值就从0开始不断增加当增加到17的时候从0到17是5次的变更每一次是poll的值的秒数是64秒*5320秒的时间。如果之后从ntp客户端同步ntp server还失败的话用ntpdate –d来查询详细错误信息再做判断。错误2.Server dropped: no data从客户端执行netdate –d时有错误信息如下transmit(192.168.30.22) transmit(192.168.30.22)transmit(192.168.30.22)transmit(192.168.30.22)transmit(192.168.30.22)192.168.30.22: Server dropped: no dataserver 192.168.30.22, port 123.....28 Jul 17:42:24 ntpdate[14148]: no server suitable for synchronization found出现这个问题的原因可能有21。检查ntp的版本如果你使用的是ntp4.2包括4.2之后的版本在restrict的定义中使用了notrust的话会导致以上错误。使用以下命令检查ntp的版本# ntpq -c version下面是来自ntp官方网站的说明The behavior of notrust changed between versions 4.1 and 4.2.In 4.1 (and earlier) notrust meant Dont trust this host/subnet for time.In 4.2 (and later) notrust means Ignore all NTP packets that are not cryptographically authenticated. This forces remote time servers to authenticate themselves to your (client) ntpd解决把notrust去掉。2。检查ntp server的防火墙。可能是server的防火墙屏蔽了upd 123端口。可以用命令#service iptables stop来关掉iptables服务后再尝试从ntp客户端的同步如果成功证明是防火墙的问题需要更改iptables的设置。转载于:https://www.cnblogs.com/hllnj2008/p/3986554.html