From 5ad063bda221d22024b752f554b203f6eacaa65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=90=E7=8B=B8Nomad?= <9463297+callmer@user.noreply.gitee.com> Date: Sun, 4 Dec 2022 07:36:34 +0000 Subject: [PATCH] =?UTF-8?q?update=203.PVE=E7=B3=BB=E7=BB=9F=E8=B0=83?= =?UTF-8?q?=E6=95=B4.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 狐狸Nomad <9463297+callmer@user.noreply.gitee.com> --- 3.PVE系统调整.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/3.PVE系统调整.md b/3.PVE系统调整.md index 60dcd9b..b7e0a68 100644 --- a/3.PVE系统调整.md +++ b/3.PVE系统调整.md @@ -38,8 +38,56 @@ date -R Wed, 20 Jul 2022 16:21:28 +0800 ``` -输出结果如果和北京时间一致,则代表修改正确。 +输出结果如果和北京时间一致,则代表修改正确。 +Debian 系统常用 `systemd-timesyncd.service` 来同步时间,而 PVE 系统使用 `chrony.service` 来同步时间。 + +为了使用国内的 NTP 服务器,需要对 `chrony.service` 进行配置。 + +执行以下命令对 `chrony` 的配置文件进行修改: + +```bash +## 编辑 chrony 配置文件 +sudo nano /etc/chrony/chrony.conf +``` + +在编辑器对话框中,将 `pool 2.debian.pool.ntp.org iburst` 这行内容 “注释” 掉,并添加国内的 NTP 服务器,参考如下内容: + +```bash +## chrony 服务配置文件示例 + +# Use Debian vendor zone. +# pool 2.debian.pool.ntp.org iburst ## 在这行前面增加注释符 # 来注释 + +# Use Custom vendor zone. +pool ntp.tencent.com iburst +pool ntp.aliyun.com iburst +``` + +保存该配置文件后,重启 `chrony` 服务: + +```bash +## 重启 chrony 服务 +sudo systemctl restart chrony.service +``` + +再检查系统 NTP 服务器是否被正确修改: + +```bash +## 检查系统 NTP 服务器 +chronyc sources -V +``` + +如果输出以下类似内容,则表示系统 NTP 服务设置正确: + +```bash +## NTP 服务示例输出 + +MS Name/IP address Stratum Poll Reach LastRx Last sample +=============================================================================== +^+ 139.199.215.251 2 10 177 244 -1669us[-1757us] +/- 67ms +^* 203.107.6.88 2 10 377 105 -1005us[-1094us] +/- 19ms +``` ## 2.CPU调度器配置