## 1. 安装ntp
在线安装:`yum install ntp -y`
离线安装:
根据实际环境下载(按以下顺序安装rpm)
`autogen-libopts-5.18-5.el7.x86_64.rpm`
`ntpdate-4.2.6p5-29.el7.centos.2.x86_64.rpm`
`ntp-4.2.6p5-29.el7.centos.2.x86_64.rpm`
## 2. ntp服务端配置
```
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
restrict 192.168.0.0 mask 255.255.254.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 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org
restrict 0.cn.pool.ntp.org nomodify notrap noquery
restrict 1.cn.pool.ntp.org nomodify notrap noquery
restrict 2.cn.pool.ntp.org nomodify notrap noquery
restrict 3.cn.pool.ntp.org nomodify notrap noquery
server 127.0.0.1 # local clock
fudge 127.0.0.1 stratum 10
#broadcast 192.168.1.255 autokey # broadcast server
```
## 3. ntp客户端配置
```
#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 192.168.0.92
restrict 192.168.0.92 nomodify notrap noquery
server 127.0.0.1 # local clock
fudge 127.0.0.1 stratum 10
#broadcast 192.168.1.255 autokey # broadcast server
```
## 4.补充
```
systemctl enable ntpd // 设置开机自启动
systemctl start ntpd // 启动服务
ntpq -p // 查看网络中的NTP服务器
ntpstat // 查看时间同步状态,需要等几分钟才能看到同步信息。
// 需要将所有host设置在同一时区
// inappropriate address 127.0.0.1 for the fudge command, line ignored
// 将/etc/ntp.conf里的 fudge 改为 Fudge
```
- Golang
- 基础知识
- 变量
- CLI命令
- Golang内置类型和函数
- init函数和main函数
- go实现Windows命令
- 数组
- 切片
- select
- string操作
- Map及实现原理
- 网络编程
- 互联网协议
- socket编程
- 并发编程
- 并发介绍
- channel
- 优雅地关闭channel
- Goroutine
- Mutex
- GMP原理与调度
- Go Web
- HTTP Server
- gin框架
- 快速入门
- HTML渲染
- JSONP
- Multipart/Urlencoded绑定
- PureJSON
- gin路由
- beego框架
- Bee工具安装
- 配置模块
- Web模块
- 路由
- 数据操作
- Go操作Mysql数据库
- Go操作redis
- mongo-driver
- sqlx库
- 操作etcd
- msgpack
- 网络爬虫
- 获取页面
- 标准库
- IO操作
- 文件操作
- fmt
- 格式化输出
- flag
- log
- time
- strconv
- template
- os
- sync.Mutex
- 第三方库
- zap库
- viper
- validator参数校验
- GORM
- 基础
- CRUD接口
- INI
- 数据结构和算法
- 链表
- Golang GUI
- fyne基础
- 显示时间
- RabbitMQ-Go
- centos7 安装rabbitmq-server
- RabbitMQ介绍
- 工作队列
- 单元测试
- golang自举编译
- 了解sync.Once
- 知识碎片
- 常见问题
- 开源项目
- gRPC
- Anaconda
- 介绍、使用教程
- Python
- Python基础知识
- Python运维
- 基础语法
- Python内置工具
- 包管理工具pip
- 小爬虫笔记
- I/O操作
- requests库
- requests基本使用
- BeautifulSoup库
- BeautifulSoup基本使用
- 数据可视化
- Django
- Django起步
- PHP
- PHP数组操作
- PHP上传文件
- PHP类与对象
- PHP图片处理
- ThinkPHP框架
- 常见问题
- tp3.2.3
- 基础
- 配置
- 模型
- 模型定义
- 模型实例化
- PHP知识点
- header函数
- 前端
- CSS
- CSS权重计算
- Javascript
- JS基础知识
- 监听事件
- 字符串操作
- 数组操作
- 输入输出
- 定时器
- 样式操作
- 获取url参数
- Vue.js
- Vue.js介绍
- Vue.js基础
- Vue指令
- v-model
- v-for
- 指令修饰符
- Q&A
- 命令
- Vue3
- node.js
- node.js基础
- npm遇到的问题
- 相关工具安装
- nvm使用教程
- 工程化webpack
- Linux
- Linux基础
- 符号链接
- Shell
- 脚本执行中的问题
- tcpdump
- Docker
- Docker的基础概念与操作
- Docker 安装
- 容器技术原理
- Docker核心概念
- Docker基本操作
- 镜像相关操作
- 容器相关操作
- 镜像加速器
- Dockerfile
- Docker所遇问题
- k8s
- 安装工具
- kubectl
- Git
- gitlab
- gitlab备份与恢复
- gitlab基本使用
- git使用
- git常用命令
- git提交问题
- 数据库
- MySQL
- MySQL介绍
- mariadb安装
- 主主复制
- 数据库问题集结
- 开启binlog
- Redis
- Redis简单使用
- Redis常见问题
- Redis集群
- Redis Cluster概述
- 数据分布
- 搭建集群
- MongoDB
- miniprogram
- 小程序基本知识
- app.json文件详解
- 小程序学习过程中的问题
- 服务器
- CentOS
- 配置阿里云的yum源和epel源
- centos7 实现NFS文件共享
- rsync
- centos7 源码编译rsync
- rsync实现文件同步
- 添加删除swap分区
- 清除buff/cache
- 配置ntp时间同步
- centos7安装pip
- centos7虚拟机启动报xfs错误
- centos7常用命令
- centos7安装mysql
- centos7安装python3.x
- centos7升级gcc、g++
- centos7安装nginx
- centos7部署Nexus
- centos7离线安装python3
- centos7.6编译mariadb10.5.22
- CentOS8
- 银河麒麟V4
- nginx编译
- 银河麒麟V10_x86
- 安装VNC
- 单用户模式
- UOS
- 配置本地apt源
- apt安装vnc-server
- UOS单用户模式
- UOS创建自启动脚本
- 源码编译
- oniguruma编译
- Proxmox VE
- PVE基本使用
- PVE故障
- KVM
- KVM相关命令
- 银河麒麟V10_x86安装kvm
- UOS_arm64安装kvm
- yum、rpm、apt
- dpkg、apt-get、yum和rpm的区别
- rpm打包
- yum相关问题
- 内建银河麒麟的apt源
- 其他软件
- JuiceFS
- nacos
- 常见命令
- 硬盘分区
- Linux常见问题
- 其他
- Cloc代码统计工具
- onlyoffice 在线文档编辑
- onlyoffice添加中文字体
- 遇到的问题
- 网络通信协议
- 部署相关记录
- Vmware workstation虚拟机迁移到PVE指南
- 小操作