更新文案描述

This commit is contained in:
CallMeR
2025-01-20 18:55:03 +08:00
parent d613ea63a1
commit cb205dda2f
+32 -30
View File
@@ -4,6 +4,8 @@
在 PVE 系统调整之前,请确认必要的软件包已经安装完成,本文后续命令均在 SSH 终端下执行。 在 PVE 系统调整之前,请确认必要的软件包已经安装完成,本文后续命令均在 SSH 终端下执行。
关于 [Neovim](https://neovim.io/) 的基础使用方法,请参阅:[Neovim 基本操作](https://www.bing.com/search?q=neovim+%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C) 。
```bash ```bash
## 同步镜像仓库 ## 同步镜像仓库
$ apt update $ apt update
@@ -38,7 +40,7 @@ $ timedatectl set-timezone Asia/Shanghai
$ date -R $ date -R
#### 系统时间示例输出 #### 系统时间示例输出
Sun, 25 Jun 2023 12:12:12 +0800 Mon, 20 Jan 2025 18:24:41 +0800
``` ```
Debian 系统常用 `systemd-timesyncd.service` 来同步时间,而 PVE 系统使用 `chrony.service` 来同步时间。 Debian 系统常用 `systemd-timesyncd.service` 来同步时间,而 PVE 系统使用 `chrony.service` 来同步时间。
@@ -47,7 +49,7 @@ Debian 系统常用 `systemd-timesyncd.service` 来同步时间,而 PVE 系统
```bash ```bash
## 编辑 chrony 配置文件 ## 编辑 chrony 配置文件
$ nano /etc/chrony/chrony.conf $ nvim /etc/chrony/chrony.conf
``` ```
在编辑器对话框中,将 `pool 2.debian.pool.ntp.org iburst` “注释” 掉,并添加国内的 NTP 服务器。 在编辑器对话框中,将 `pool 2.debian.pool.ntp.org iburst` “注释” 掉,并添加国内的 NTP 服务器。
@@ -77,12 +79,12 @@ $ chronyc sources -V
#### 系统 NTP 服务器示例输出 #### 系统 NTP 服务器示例输出
MS Name/IP address Stratum Poll Reach LastRx Last sample MS Name/IP address Stratum Poll Reach LastRx Last sample
=============================================================================== ===============================================================================
^- 203.107.6.88 2 6 7 2 +987us[+1251us] +/- 23ms ^* 203.107.6.88 2 6 17 0 -875us[-2496us] +/- 22ms
^? 106.55.184.199 2 6 11 1 -501us[ -501us] +/- 60ms ^- 106.55.184.199 2 6 17 3 -1331us[-1331us] +/- 50ms
^- electrode.felixc.at 2 6 7 2 +3532us[ +663us] +/- 121ms ^- time.neu.edu.cn 2 6 17 8 +935us[ +935us] +/- 23ms
^* 119.28.206.193 2 6 15 1 +184us[-2686us] +/- 53ms ^- 119.28.206.193 2 6 65 5 +33us[ +33us] +/- 65ms
^- 119.28.183.184 2 6 7 2 +512us[-2358us] +/- 47ms ^- electrode.felixc.at 2 6 17 11 -1320us[-1320us] +/- 126ms
^+ time.cloudflare.com 3 6 13 1 -85us[-2955us] +/- 106ms ^- dns1.synet.edu.cn 1 6 17 13 -44us[ -44us] +/- 22ms
``` ```
## 2. CPU 调度器 ## 2. CPU 调度器
@@ -102,10 +104,10 @@ analyzing CPU 0:
hardware limits: 800 MHz - 2.70 GHz hardware limits: 800 MHz - 2.70 GHz
available cpufreq governors: conservative ondemand userspace powersave performance schedutil available cpufreq governors: conservative ondemand userspace powersave performance schedutil
current policy: frequency should be within 800 MHz and 2.70 GHz. current policy: frequency should be within 800 MHz and 2.70 GHz.
The governor "ondemand" may decide which speed to use The governor "performance" may decide which speed to use
within this range. within this range.
current CPU frequency: Unable to call hardware current CPU frequency: Unable to call hardware
current CPU frequency: 800 MHz (asserted by call to kernel) current CPU frequency: 2.60 GHz (asserted by call to kernel)
boost state support: boost state support:
Supported: yes Supported: yes
Active: yes Active: yes
@@ -141,7 +143,7 @@ analyzing CPU 0:
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#### 设备 CPU - J4125 示例输出 #### 设备 CPU - J4125 示例输出
ondemand performance
#### 设备 CPU - N6005 示例输出 #### 设备 CPU - N6005 示例输出
performance performance
@@ -168,11 +170,11 @@ performance powersave
- CPU 驱动为 `intel_pstate` 时,推荐使用 `powersave` 调度器。 - CPU 驱动为 `intel_pstate` 时,推荐使用 `powersave` 调度器。
本文使用 `powersave` 调度器为演示,使用 `nano` 编辑器创建 `cpupower` 的配置文件。 本文使用 `powersave` 调度器为演示,使用 `neovim` 编辑器创建 `cpupower` 的配置文件。
```bash ```bash
## 创建 cpupower 配置文件 ## 创建 cpupower 默认配置文件
$ nano /etc/default/cpupower $ nvim /etc/default/cpupower
``` ```
在配置文件中修改以下配置项,并保存。 在配置文件中修改以下配置项,并保存。
@@ -186,11 +188,11 @@ CPUPOWER_STOP_OPTS="frequency-set -g performance"
``` ```
使用 `nano` 编辑器创建 `cpupower` 服务配置文件,以满足系统自动化设置需求。 进一步创建 `cpupower` 服务配置文件,以满足系统自动化设置需求。
```bash ```bash
## 创建 cpupower 服务配置文件 ## 创建 cpupower.service 配置文件
$ nano /etc/systemd/system/cpupower.service $ nvim /etc/systemd/system/cpupower.service
``` ```
在服务配置文件中修改以下配置项,并保存。 在服务配置文件中修改以下配置项,并保存。
@@ -280,11 +282,11 @@ $ systemctl status apt-daily-upgrade.timer
#### 系统定时器示例输出 #### 系统定时器示例输出
● apt-daily-upgrade.timer - Daily apt upgrade and clean activities ● apt-daily-upgrade.timer - Daily apt upgrade and clean activities
Loaded: loaded (/lib/systemd/system/apt-daily-upgrade.timer; enabled; preset: enabled) Loaded: loaded (/lib/systemd/system/apt-daily-upgrade.timer; enabled; preset: enabled)
Active: active (waiting) since Tue 2023-08-01 13:01:19 CST; 27min ago Active: active (waiting) since Mon 2025-01-20 18:12:44 CST; 19min ago
Trigger: Wed 2023-08-02 06:14:50 CST; 16h left Trigger: Tue 2025-01-21 06:52:19 CST; 12h left
Triggers: ● apt-daily-upgrade.service Triggers: ● apt-daily-upgrade.service
Aug 01 13:01:19 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities. Jan 20 18:12:44 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities.
``` ```
### 4.2.配置更新策略 ### 4.2.配置更新策略
@@ -308,7 +310,7 @@ $ dpkg-reconfigure -plow unattended-upgrades
$ cd /etc/apt/apt.conf.d $ cd /etc/apt/apt.conf.d
## 编辑 20auto-upgrades 配置文件 ## 编辑 20auto-upgrades 配置文件
$ nano /etc/apt/apt.conf.d/20auto-upgrades $ nvim /etc/apt/apt.conf.d/20auto-upgrades
``` ```
删除里面全部内容,添加以下配置项,并保存。 删除里面全部内容,添加以下配置项,并保存。
@@ -329,7 +331,7 @@ APT::Periodic::CleanInterval "1";
```bash ```bash
## 编辑 50unattended-upgrades 配置文件 ## 编辑 50unattended-upgrades 配置文件
$ nano /etc/apt/apt.conf.d/50unattended-upgrades $ nvim /etc/apt/apt.conf.d/50unattended-upgrades
``` ```
配置文件中,被修改的参数解释如下: 配置文件中,被修改的参数解释如下:
@@ -420,13 +422,13 @@ $ systemctl status apt-daily-upgrade.timer
Loaded: loaded (/lib/systemd/system/apt-daily-upgrade.timer; enabled; preset: enabled) Loaded: loaded (/lib/systemd/system/apt-daily-upgrade.timer; enabled; preset: enabled)
Drop-In: /etc/systemd/system/apt-daily-upgrade.timer.d Drop-In: /etc/systemd/system/apt-daily-upgrade.timer.d
└─override.conf └─override.conf
Active: active (waiting) since Tue 2023-08-01 13:37:41 CST; 9s ago Active: active (waiting) since Mon 2025-01-20 18:43:03 CST; 7s ago
Trigger: Wed 2023-08-02 01:30:00 CST; 11h left Trigger: Tue 2025-01-21 01:30:00 CST; 6h left
Triggers: ● apt-daily-upgrade.service Triggers: ● apt-daily-upgrade.service
Aug 01 13:37:41 node01 systemd[1]: Stopped apt-daily-upgrade.timer - Daily apt upgrade and clean activities. Jan 20 18:43:03 node01 systemd[1]: Stopped apt-daily-upgrade.timer - Daily apt upgrade and clean activities.
Aug 01 13:37:41 node01 systemd[1]: Stopping apt-daily-upgrade.timer - Daily apt upgrade and clean activities... Jan 20 18:43:03 node01 systemd[1]: Stopping apt-daily-upgrade.timer - Daily apt upgrade and clean activities...
Aug 01 13:37:41 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities. Jan 20 18:43:03 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities.
``` ```
## 5.硬件直通 ## 5.硬件直通
@@ -439,7 +441,7 @@ Aug 01 13:37:41 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt u
```bash ```bash
## 编辑 Grub 配置文件 ## 编辑 Grub 配置文件
$ nano /etc/default/grub $ nvim /etc/default/grub
``` ```
在编辑器对话框中修改 `GRUB_CMDLINE_LINUX_DEFAULT` 参数,注意命令中间的空格。 在编辑器对话框中修改 `GRUB_CMDLINE_LINUX_DEFAULT` 参数,注意命令中间的空格。
@@ -473,7 +475,7 @@ $ update-grub
```bash ```bash
## 编辑系统配置文件 ## 编辑系统配置文件
$ nano /etc/modules $ nvim /etc/modules
``` ```
在配置文件中添加以下配置项,并保存。 在配置文件中添加以下配置项,并保存。
@@ -599,7 +601,7 @@ $ swapon /swap/swapfile
```bash ```bash
## 编辑 fstab 配置文件 ## 编辑 fstab 配置文件
$ nano /etc/fstab $ nvim /etc/fstab
``` ```
`fstab` 为系统关键配置文件,直接影响系统启动,修改此文件时,请注意以下几点: `fstab` 为系统关键配置文件,直接影响系统启动,修改此文件时,请注意以下几点: