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:// ...
随机推荐
- vector向量容器元素排序与查找
1.利用标准库函数sort()对vector进行排序 参考源码: #include <algorithm> #include <vector> vector<int> ...
- HTTP-Runoob:教程
ylbtech-HTTP-Runoob:教程 1.返回顶部 1. HTTP 教程 HTTP协议(HyperText Transfer Protocol,超文本传输协议)是因特网上应用最为广泛的一种网络 ...
- CreateMutex实现只能打开一个客户端
#include "stdafx.h" #include <Windows.h> #include <iostream> using namespace s ...
- 第十三章 Spring框架的设计理念与设计模式分析(待续)
Spring的骨骼架构 核心组件详解 Spring中AOP的特性详解 设计模式解析之代理模式 设计模式解析之策略模式
- MySQL组合索引最左匹配原则
几个重要的概念 1.对于mysql来说,一条sql中,一个表无论其蕴含的索引有多少,但是有且只用一条. 2.对于多列索引来说(a,b,c)其相当于3个索引(a),(a,b),(a,b,c)3个索引,又 ...
- 01-19asp.net基础--网站登录及验证
第一步: 1)首先使用“CodeSmith”将Examinee类实体化,并生成实体类连接数据库的方法,存在解决方案下的“App_Code”文件夹下. 修改一下连接某个数据库: private SqlC ...
- 10-21C#基础--集合
二.集合 //定义一个集合,集合是一个类, 1. 定义: ArrayList al = new ArrayList(); 2.添加数据:al.add();//添加数值,可以添加无数个元素,集合中没有 ...
- 第4章_Java仿微信全栈高性能后台+移动客户端
基于web端使用netty和websocket来做一个简单的聊天的小练习.实时通信有三种方式:Ajax轮询.Long pull.websocket,现在很多的业务场景,比方说聊天室.或者手机端onli ...
- ubuntu16.04 安装opencv3.4
1.去官网下载opencv,在本教程中选用的时opencv3.4.1,其他版本的配置方法异曲同工. 下载链接http://opencv.org/releases.html,选择sources版本 2. ...
- 算法Sedgewick第四版-第1章基础-004一封装交易对象
1. package ADT; /****************************************************************************** * Co ...