mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-08-31 05:52:52 +08:00
移除 PVE 服务器定时重启内容
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ $ apt full-upgrade
|
|||||||
$ apt update
|
$ apt update
|
||||||
|
|
||||||
## 安装系统软件
|
## 安装系统软件
|
||||||
$ apt install btop lm-sensors curl tmux cronie neovim unattended-upgrades powermgmt-base sshguard knot-dnsutils
|
$ apt install btop lm-sensors curl tmux neovim unattended-upgrades powermgmt-base sshguard knot-dnsutils
|
||||||
|
|
||||||
## 安装 CPU 调度调整工具
|
## 安装 CPU 调度调整工具
|
||||||
$ apt install linux-cpupower
|
$ apt install linux-cpupower
|
||||||
|
|||||||
+10
-33
@@ -224,32 +224,9 @@ $ watch cat /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_cur_freq
|
|||||||
$ watch -d sensors
|
$ watch -d sensors
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3. PVE 定时重启
|
## 3. PVE 自动更新
|
||||||
|
|
||||||
有时需要让 PVE 服务器周期性的定时重启,则可执行以下命令。
|
### 3.1.系统定时器
|
||||||
|
|
||||||
参数表示每月 `1` 、 `16` 号的 `02:30` 执行系统重启命令。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
## 创建 PVE 定时重启任务
|
|
||||||
$ tee /etc/cron.d/pve-reboot >/dev/null <<'EOF'
|
|
||||||
30 2 1,16 * * root /usr/sbin/shutdown --reboot now
|
|
||||||
EOF
|
|
||||||
|
|
||||||
## 设置定时任务文件权限
|
|
||||||
$ chmod 0644 /etc/cron.d/pve-reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
系统全局定时任务排期状态可使用以下命令进行查看。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
## 查看系统定时任务
|
|
||||||
$ cronnext -acl
|
|
||||||
```
|
|
||||||
|
|
||||||
## 4. PVE 自动更新
|
|
||||||
|
|
||||||
### 4.1.系统定时器
|
|
||||||
|
|
||||||
配置系统自动更新之前,需检查系统当前定时器状态。
|
配置系统自动更新之前,需检查系统当前定时器状态。
|
||||||
|
|
||||||
@@ -270,7 +247,7 @@ $ systemctl status apt-daily-upgrade.timer
|
|||||||
Aug 10 09:51:05 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities.
|
Aug 10 09:51:05 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities.
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4.2.配置更新策略
|
### 3.2.配置更新策略
|
||||||
|
|
||||||
执行以下命令,启用系统自动更新。
|
执行以下命令,启用系统自动更新。
|
||||||
|
|
||||||
@@ -356,7 +333,7 @@ Unattended-Upgrade::Automatic-Reboot-Time "02:30";
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4.3.重设触发器
|
### 3.3.重设触发器
|
||||||
|
|
||||||
系统自动更新配置文件修改完成后,需要重设自动更新定时器,执行以下命令。
|
系统自动更新配置文件修改完成后,需要重设自动更新定时器,执行以下命令。
|
||||||
|
|
||||||
@@ -403,9 +380,9 @@ Aug 10 10:35:09 node01 systemd[1]: Stopped apt-daily-upgrade.timer - Daily apt u
|
|||||||
Aug 10 10:35:09 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities.
|
Aug 10 10:35:09 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt upgrade and clean activities.
|
||||||
```
|
```
|
||||||
|
|
||||||
## 5.硬件直通
|
## 4.硬件直通
|
||||||
|
|
||||||
### 5.1.修改 Grub
|
### 4.1.修改 Grub
|
||||||
|
|
||||||
参考官方文档 [qm_pci_passthrough](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_pci_passthrough) 和 [Pci passthrough](https://pve.proxmox.com/wiki/Pci_passthrough) 开启 PVE 硬件直通功能。
|
参考官方文档 [qm_pci_passthrough](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_pci_passthrough) 和 [Pci passthrough](https://pve.proxmox.com/wiki/Pci_passthrough) 开启 PVE 硬件直通功能。
|
||||||
|
|
||||||
@@ -441,7 +418,7 @@ GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
|
|||||||
$ update-grub
|
$ update-grub
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5.2.添加内核模块
|
### 4.2.添加内核模块
|
||||||
|
|
||||||
编辑 **内核模块** 配置文件,增加必要的系统模块,执行以下命令。
|
编辑 **内核模块** 配置文件,增加必要的系统模块,执行以下命令。
|
||||||
|
|
||||||
@@ -464,7 +441,7 @@ EOF
|
|||||||
$ update-initramfs -u -k all
|
$ update-initramfs -u -k all
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5.3.检查硬件直通
|
### 4.3.检查硬件直通
|
||||||
|
|
||||||
PVE 服务器重启完成后,再次使用终端工具登录,并执行以下命令检查硬件直通状态。
|
PVE 服务器重启完成后,再次使用终端工具登录,并执行以下命令检查硬件直通状态。
|
||||||
|
|
||||||
@@ -528,7 +505,7 @@ $ find /sys/kernel/iommu_groups/ -type l
|
|||||||
/sys/kernel/iommu_groups/9/devices/0000:00:14.1
|
/sys/kernel/iommu_groups/9/devices/0000:00:14.1
|
||||||
```
|
```
|
||||||
|
|
||||||
## 6. BTRFS 调整
|
## 5. BTRFS 调整
|
||||||
|
|
||||||
**额外说明:**
|
**额外说明:**
|
||||||
- 本节专为 `BTRFS` 单盘 `RAID0`(条带模式)安装的 PVE 系统设计,使用其他安装模式时,请跳过此节
|
- 本节专为 `BTRFS` 单盘 `RAID0`(条带模式)安装的 PVE 系统设计,使用其他安装模式时,请跳过此节
|
||||||
@@ -582,7 +559,7 @@ proc /proc proc defaults 0 0
|
|||||||
/swap/swapfile none swap defaults 0 0
|
/swap/swapfile none swap defaults 0 0
|
||||||
```
|
```
|
||||||
|
|
||||||
## 7.系统清理
|
## 6.系统清理
|
||||||
|
|
||||||
PVE 系统配置完成后,可执行以下命令,对系统进行清理。
|
PVE 系统配置完成后,可执行以下命令,对系统进行清理。
|
||||||
|
|
||||||
|
|||||||
@@ -394,6 +394,13 @@ EOF
|
|||||||
$ sudo chmod 0644 /etc/cron.d/guest-os-reboot
|
$ sudo chmod 0644 /etc/cron.d/guest-os-reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
系统全局定时任务排期状态可使用以下命令进行查看。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
## 查看系统定时任务
|
||||||
|
$ sudo cronnext -acl
|
||||||
|
```
|
||||||
|
|
||||||
### 1.10.清理系统
|
### 1.10.清理系统
|
||||||
|
|
||||||
Debian 模板虚拟机已经配置完成,在将其转换为模板前需要对系统进行清理。
|
Debian 模板虚拟机已经配置完成,在将其转换为模板前需要对系统进行清理。
|
||||||
|
|||||||
Reference in New Issue
Block a user