Linux知识库
Linux基础知识!
Linux格式化硬盘以及格式化分区
linux基础常用知识
linux更换yum源
linux挂载windows SMB共享目录
linux开机启动级别
linux网卡配置
linux配置SMB服务
CentOS 8 firewalld配置
Linux软件管理:RPM软件包与YUM管理
Linux用户与组概念
Linux文件与目录权限基础
Linux计划任务管理
Linux中文本文件内容的查看
Linux基础-服务(service)和systemd管理服务
Vim编辑器基本操作
apt更换国内源
Linux程序服务!
Code-server在线编程服务器部署
Cloudreve网盘搭建
Emby多媒体影音系统搭建
chevereto图床搭建教程
Frp内网穿透服务器搭建
FTP服务器搭建
gitlab服务器搭建
Plex搭建
syncthing同步服务器搭建
Wordpress博客搭建
Typecho博客搭建
zabbix搭建(失败)
Aria2离线下载服务器搭建
KMS激活服务器搭建
CentOS搭建NTP服务
Grafana部署与Zabbix集成,部署开源IT系统监控平台
Linux应用环境搭建配置!
nginx编译安装
PHP8编译安装
Linux 关闭selinux
yum安装redis数据库
宝塔环境无法删除.user.ini
宝塔面板安装
mysql8.0.29编译安装
nginx安装(yum方式)
Linux系统基础知识
Linux命令行基础知识
使用Cerbot申请免费证书
ModSecurity 安装编译与连接nginx
Zabbix6.4.8安装部署
本文档使用 MrDoc 发布
-
+
首页
CentOS搭建NTP服务
# Centos 搭建NTP服务器 背景:公司服务器时间不同步导致一些认证功能无法使用,网络设备时间不同步日志信息不准确,因此想要在内网搭建一个NTP服务器,作为客户端同步网络时间服务器,作为服务端为内网其他终端提供授时服务。 服务器:Centos8 软件:chronyd 系统好像自带了chronyd这个服务,然后我通过yum无法安装ntpdate和ntp,所以百度后直接使用chronyd进行ntp服务搭建。 ## 服务端安装部署 ```linux # 如果没有的先安装 yum install chrony # 使用systemctl管理进程 systemctl start chronyd # 开启自启 systemctl enable chronyd # 修改配置文件,一般默认在/etc/chrony.conf # 注释掉原有的"pool 2.centos.pool.ntp.org iburst",前面+#号 server 210.72.145.44 iburst server ntp1.aliyun.com iburst server ntp2.aliyun.com iburst # 然后找到allow关键字,填写内网网段,表示运行指定客户端使用这个服务器 # Allow NTP client access from local network. allow 192.168.0.0/16 allow 10.0.0.0/8 # :wq保存 # 重启下服务 systemctl restart chronyd # 配置正确的时区 timedatectl set-timezone Asia/Shanghai # 查看时区列表 timedatectl list-timezones # 查看系统时间 date # 检查ntp服务同步状态 timedatectl # 显示如下表示同步正常 time: 三 2023-11-01 10:34:28 CST Universal time: 三 2023-11-01 02:34:28 UTC RTC time: 三 2023-11-01 02:30:46 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: yes NTP service: active RTC in local TZ: no ``` ## 客户端配置 linux客户端配置: ```linux # 安装如果没有的话 yum install chrony # 启动进程 systemctl start chronyd # 开机启动 systemctl enable chronyd # 修改配置文件,服务器地址为内网服务器地址 vim /etc/chrony.conf server 192.168.80.3 iburst # 重启服务 systemctl restart chronyd # 配置正确的时区 timedatectl set-timezone Asia/Shanghai # 检查配置 timedatectl ``` ## 网络设备配置 H3C 网络设备配置 ```ssh # 配置时区 clock timezone Beijing add 08:00:00 # 启用NTP协议支持 clock protocol ntp # 开启NTP服务 ntp-service enable # 定义内网ntp服务器 ntp-service unicast-peer 192.168.80.3 # 保存配置 save f ```
Chuck
2023年11月1日 10:40
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码