centos7安装配置时间服务器
前言:
时间服务器是S/C模型服务,需要配置服务端和客户端

NTP服务端配置:(服务端的IP为1.1.1.14)
安装ntp服务:
# yum -y install ntp
查询网络中的NTP服务器:
# ntpq -p
No association ID's returned
修改配置文件:
# vim /etc/ntp.conf
修改如下:
#restrict default nomodify notrap nopeer noquery
restrict default nomodify
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
重启服务:
# systemctl restart ntpd.service
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*LOCAL(0) .LOCL. 5 l 40 64 1 0.000 0.000 0.000
NTP客户端配置:(客户端IP1.1.1.15)
# yum -y install ntp
修改配置文件:
# vim /etc/ntp.conf
server 1.1.1.14
# server 0.centos.pool.ntp.org iburst
# server 1.centos.pool.ntp.org iburst
# server 2.centos.pool.ntp.org iburst
# server 3.centos.pool.ntp.org iburst
进行时间同步:
# ntpdate -d 1.1.1.14
17 Aug 18:16:12 ntpdate[2420]: ntpdate 4.2.6p5@1.2349-o Fri Apr 13 12:52:28 UTC 2018 (1)
Looking for host 1.1.1.14 and service ntp
host found : iscsi-1
transmit(1.1.1.14)
receive(1.1.1.14)
transmit(1.1.1.14)
receive(1.1.1.14)
transmit(1.1.1.14)
receive(1.1.1.14)
transmit(1.1.1.14)
receive(1.1.1.14)
server 1.1.1.14, port 123
stratum 6, precision -25, leap 00, trust 000
refid [1.1.1.14], delay 0.02583, dispersion 0.00078
transmitted 4, in filter 4
reference time: df211ec3.f61979fc Fri, Aug 17 2018 18:15:31.961
originate timestamp: df211ef2.5e99e99c Fri, Aug 17 2018 18:16:18.369
transmit timestamp: df211ef2.7a146907 Fri, Aug 17 2018 18:16:18.476
filter delay: 0.02596 0.02591 0.02583 0.02591
0.00000 0.00000 0.00000 0.00000
filter offset: -0.10994 -0.10912 -0.10834 -0.10754
0.000000 0.000000 0.000000 0.000000
delay 0.02583, dispersion 0.00078
offset -0.108343
17 Aug 18:16:18 ntpdate[2420]: adjust time server 1.1.1.14 offset -0.108343 sec (ceph默认的时间差为0.05sec)
将时间同步到硬件:
# hwclock -w
开启自动同步:
# systemctl start ntpd.service
查看服务状态:
# systemctl status ntpd.service
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2018-08-17 18:23:53 CST; 7s ago
Process: 2451 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 2452 (ntpd)
CGroup: /system.slice/ntpd.service
└─2452 /usr/sbin/ntpd -u ntp:ntp -g
Aug 17 18:23:53 iscsi-2 ntpd[2452]: 0.0.0.0 c01d 0d kern kernel time sync enabled
Aug 17 18:23:53 iscsi-2 ntpd[2452]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Aug 17 18:23:53 iscsi-2 ntpd[2452]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Aug 17 18:23:53 iscsi-2 ntpd[2452]: Listen and drop on 1 v6wildcard :: UDP 123
Aug 17 18:23:53 iscsi-2 ntpd[2452]: Listen normally on 2 lo 127.0.0.1 UDP 123
Aug 17 18:23:53 iscsi-2 ntpd[2452]: Listen normally on 3 ens33 1.1.1.15 UDP 123
Aug 17 18:23:53 iscsi-2 ntpd[2452]: Listening on routing socket on fd #20 for interface updates
Aug 17 18:23:53 iscsi-2 ntpd[2452]: 0.0.0.0 c016 06 restart
Aug 17 18:23:53 iscsi-2 ntpd[2452]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Aug 17 18:23:53 iscsi-2 ntpd[2452]: 0.0.0.0 c011 01 freq_not_set
centos7安装配置时间服务器的更多相关文章
- CentOS7安装配置SAMBA服务器
假设我们有这样一个场景 共享名 路径 权限 SHAREDOC /smb/docs 所有人员包括来宾均可以访问 RDDOCS /smb/tech 仅允许特定组的用户进行读写访问 特定组的组名为RD,目前 ...
- CentOS7 安装配置DNS服务器
一.安装 yum install bind 二.配置 1. /etc/named.conf // // named.conf // // Provided by Red Hat bind packag ...
- CentOS7安装配置FTP服务器
假设我们有以下要求 路径 权限 备注 /ftp/open 公司所有人员包括来宾均可以访问 只读 /ftp/private 仅允许Alice.Jack.Tom三个人访问 Alice.Jack只允许下载, ...
- CentOS7安装配置DNS服务器
准备工作(假设名称为bigcloud.local) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #更改主机名称 #vi /etc/sysconfig/netwo ...
- (7)centos7安装配置ftp服务器
1.安装vsftpd yum install vsftpd -y 2.设置开机启动vsftpd ftp服务 systemctl enable vsftpd.service 3.启动vsftpd服务 s ...
- CentOS 7.2 安装配置Samba服务器
1背景 转Linux刚刚1年,vim操作还不能应对工程代码,之前一直都是Gnome桌面 + Clion 作开发环境,无奈在服务器上没有这样的环境, 看同事是(Windows)Source Insigh ...
- Centos7安装搭建NTP服务器和NTP客户端同步时间
NTP简介: NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各个计算机的时间的协议. 在计算机的世界里,时间非常地重要 例如:对于火箭发射这种科研活动,对时间的 ...
- 大数据项目之_15_帮助文档_NTP 配置时间服务器+Linux 集群服务群起脚本+CentOS6.8 升级到 python 到 2.7
一.NTP 配置时间服务器1.1.检查当前系统时区1.2.同步时间1.3.检查软件包1.4.修改 ntp 配置文件1.5.重启 ntp 服务1.6.设置定时同步任务二.Linux 集群服务群起脚本2. ...
- Centos7安装配置jenkins(Tomcat)
Centos7安装配置jenkins(Tomcat) 一.准备工作 1.1 安装JDK1.8 具体安装过程不在赘述. 1.2 下载jenkins的war包 jenkins官网下载地址:https:// ...
随机推荐
- 机器学习:偏差方差权衡(Bias Variance Trade off)
一.什么是偏差和方差 偏差(Bias):结果偏离目标位置: 方差(Variance):数据的分布状态,数据分布越集中方差越低,越分散方差越高: 在机器学习中,实际要训练模型用来解决一个问题,问题本身可 ...
- 天梯L2-001. 紧急救援(25分)
L2-001. 紧急救援 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国 ...
- 基于OpenCV的火焰检测(三)——HSI颜色判据
上文向大家介绍了如何用最简单的RGB判据来初步提取火焰区域,现在我要给大家分享的是一种更加直观的判据--HSI判据. 为什么说HSI判据是更加直观的判据呢?老规矩,先介绍一下HSI色彩模型: HSI颜 ...
- Java学习之系统高可用性渲染接口日志自动服务降级
背景:公司都追求系统的高可用性,这里不可用时间就是其中很重要的一个指标,为此在做系统功能升级迭代的过程中如何快速处理异常恢复正常功能极为重要.现在对新增模块的要求是都增加开关,方便快速关闭异常模块,但 ...
- nfs cron shell 作业
作业一: nginx反向代理三台web服务器,实现负载均衡 所有的web服务共享一台nfs的存储 2台服务器 nginx [lb] :101.200.206.6 nginx [web]:101.200 ...
- Spring MVC F5刷新问题
转自:https://bbs.csdn.net/topics/390771056 post操作成功后重定向到B,这样浏览器里F5的时候就不会让提交A了
- AFNetworking-2.5-源码阅读剖析--网络请求篇
一.前言 AFNetworking,非常友好简单的网络请求第三方框架,在GitHub中已经获得了25000++的star,链接地址:https://github.com/AFNetworking/AF ...
- Result Maps、Auto-mapping、cache
1. Result Maps resultMap元素是Mybatis里面最重要的并且功能最强大的一个元素.(The resultMapelement is the most important an ...
- sys模块 进度条百分比
用于提供对Python解释器相关的操作: sys.argv 命令行参数List,第一个元素是程序本身路径 sys.exit(n) 退出程序,正常退出时exit(0) ...
- Halcon从某一个图片以指定区域绘制到另一个图像
************************************************************* * Halcon从某一个图片以指定区域绘制到另一个图像 * Author: ...