<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>9527edu开源博客</title><link>https://9527edu.org/</link><description>本博客为开源博客</description><item><title>Chrony(ntp时间同步服务器)，基于ubuntu,rocky,centos,rhel</title><link>https://9527edu.org/post/228.html</link><description>&lt;h3 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;1. 安装Chrony&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n2&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;银河麒麟V10系统通常默认安装了&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;chrony&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;。如果未安装，可以用以下命令安装：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;查看监听端口（默认&amp;nbsp;UDP&amp;nbsp;123）：sudo&amp;nbsp;ss&amp;nbsp;-ulnp&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;chrony
查询本地同步状态：chronyc&amp;nbsp;tracking
测试客户端连接（从另一台机器执行）：ntpdate&amp;nbsp;-q&amp;nbsp;&amp;lt;本机IP&amp;gt;&amp;nbsp;或使用&amp;nbsp;chronyc&amp;nbsp;sources&amp;nbsp;-v&amp;nbsp;查看是否能看到本机。

基于rhel的发行版系统安装如下
yum&amp;nbsp;install&amp;nbsp;-y&amp;nbsp;chrony

基于debian的发行版系统如ubuntu，桌面版麒麟
apt&amp;nbsp;update
apt&amp;nbsp;install&amp;nbsp;chrony&amp;nbsp;-y&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 cid=&quot;n5&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;2. 配置为时间服务器（&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: inherit;&quot;&gt;/etc/chrony.conf&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;）&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n6&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;如果没有网络自定义网络时间&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;设置时区为亚洲上海
timedatectl&amp;nbsp;set-timezone&amp;nbsp;Asia/Shanghai

设置时间
timedatectl&amp;nbsp;set-time&amp;nbsp;&amp;quot;2026-07-06&amp;nbsp;14:30:00&amp;quot;

同步到硬件时钟：确保重启后时间不丢失
timedatectl&amp;nbsp;set-local-rtc&amp;nbsp;false

使用&amp;nbsp;date&amp;nbsp;命令（备选）
date&amp;nbsp;命令适合临时或脚本化的修改，但配置通常不持久
date&amp;nbsp;-s&amp;nbsp;&amp;quot;2026-07-06&amp;nbsp;14:30:00&amp;quot;

同步到硬件时钟：这一步很重要，否则重启后设置会丢失
hwclock&amp;nbsp;--systohc&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p cid=&quot;n9&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;2.1 设置上游时间源&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n10&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;若服务器能连接外网，可配置公共NTP服务器；若是纯内网环境，则让本机时钟作为时间源：&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n11&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;这是关键步骤，需修改核心配置文件&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;/etc/chrony.conf&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n12&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;2.1.1ubuntu:配置文件&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;softbreak&quot; class=&quot;md-softbreak&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;配置文件/etc/chrony.conf/chrony.conf，操作系统文件可能不同，可以使用tab按键补齐&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;注释掉所有默认的&amp;nbsp;pool&amp;nbsp;或&amp;nbsp;server&amp;nbsp;行
#&amp;nbsp;pool&amp;nbsp;ntp.ubuntu.com&amp;nbsp;iburst

#&amp;nbsp;bindaddress&amp;nbsp;只控制监听地址，不影响&amp;nbsp;allow&amp;nbsp;规则：

#&amp;nbsp;即使绑定到&amp;nbsp;192.168.1.10，如果&amp;nbsp;allow&amp;nbsp;写的是&amp;nbsp;0.0.0.0/0，理论上任意客户端都能连接这个&amp;nbsp;IP。正确做法是配合&amp;nbsp;allow&amp;nbsp;限制来源网段：
bindaddress&amp;nbsp;0.0.0.0


#&amp;nbsp;允许来自&amp;nbsp;192.168.1.0/24&amp;nbsp;网段的客户端访问
allow&amp;nbsp;192.168.1.0/24

#&amp;nbsp;当所有上游服务器不可用时，将自身声明为&amp;nbsp;stratum&amp;nbsp;10&amp;nbsp;的服务器
local&amp;nbsp;stratum&amp;nbsp;10

#&amp;nbsp;没有网络的情况利用本机作为时间同步服务器
server&amp;nbsp;127.0.0.1&amp;nbsp;iburst

#&amp;nbsp;有网络的情况利用阿里云或者别的时间同步服务器
server&amp;nbsp;ntp1.aliyun.com&amp;nbsp;iburst

#默认的配置
pool&amp;nbsp;ntp.ubuntu.com&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;4
pool&amp;nbsp;0.ubuntu.pool.ntp.org&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;1
pool&amp;nbsp;1.ubuntu.pool.ntp.org&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;1
pool&amp;nbsp;2.ubuntu.pool.ntp.org&amp;nbsp;iburst&amp;nbsp;maxsources

#修改为阿里云，把原来的四个选项可以注释掉#前面加#就是注释
pool&amp;nbsp;ntp1.liyun.com&amp;nbsp;&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;1

#&amp;nbsp;将&amp;nbsp;NTP_SERVER_IP&amp;nbsp;替换为你的主NTP服务器IP，也即是你自己服务器的IP地址
server&amp;nbsp;192.168.1.10&amp;nbsp;iburst
或
pool&amp;nbsp;192.168.1.10&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;1

修改好以后重启服务
systemctl&amp;nbsp;restart&amp;nbsp;chronyd&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;2.2 ubuntu:完整配置文件，可以直接拿去使用&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;grep&amp;nbsp;-Ev&amp;nbsp;&amp;#39;^$|#&amp;#39;&amp;nbsp;/etc/chrony/chrony.conf
内容如下
confdir&amp;nbsp;/etc/chrony/conf.d
bindaddress&amp;nbsp;0.0.0.0
server&amp;nbsp;127.0.0.1&amp;nbsp;iburst
local&amp;nbsp;stratum&amp;nbsp;10
allow&amp;nbsp;192.168.1.0/24
sourcedir&amp;nbsp;/run/chrony-dhcp
sourcedir&amp;nbsp;/etc/chrony/sources.d
keyfile&amp;nbsp;/etc/chrony/chrony.keys
driftfile&amp;nbsp;/var/lib/chrony/chrony.drift
ntsdumpdir&amp;nbsp;/var/lib/chrony
logdir&amp;nbsp;/var/log/chrony
maxupdateskew&amp;nbsp;100.0
rtcsync
makestep&amp;nbsp;1&amp;nbsp;3
leapsectz&amp;nbsp;right/UTC&lt;/pre&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;2.3 开机启动和立即启动，修改好以后重启服务&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;systemctl&amp;nbsp;enable&amp;nbsp;chronyd&amp;nbsp;--now
systemctl&amp;nbsp;restart&amp;nbsp;chronyd&lt;/pre&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;2.4 基于rhel(麒麟服务器版本，centos,rocky等)的系统配置文件如下&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;softbreak&quot; class=&quot;md-softbreak&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;配置文件/etc/chrony.conf&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;基于rhel(麒麟服务器版本，centos,rocky等)的系统配置文件如下
#&amp;nbsp;配置文件/etc/chrony.conf

#&amp;nbsp;外网环境：使用阿里云公共NTP服务
server&amp;nbsp;ntp.aliyun.com&amp;nbsp;iburst

#&amp;nbsp;纯内网环境：使用本地时钟作为时间源
server&amp;nbsp;127.127.1.0&amp;nbsp;iburst
local&amp;nbsp;stratum&amp;nbsp;10

#&amp;nbsp;监听所有IP地址
bindaddress&amp;nbsp;0.0.0.0

#&amp;nbsp;允许哪个IP段可以同步时间服务器
allow&amp;nbsp;192.168.1.0/24&lt;/pre&gt;&lt;p&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;2.5 基于rhel(麒麟服务器版本，centos,rocky等)的系统完整配置文件&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;[root@db-1&amp;nbsp;~]#&amp;nbsp;grep&amp;nbsp;-Ev&amp;nbsp;&amp;#39;^$|#&amp;#39;&amp;nbsp;/etc/chrony.conf&amp;nbsp;
#外网使用如下
server&amp;nbsp;ntp.aliyun.com&amp;nbsp;iburst
#内网用如下
#server&amp;nbsp;127.0.0.1&amp;nbsp;iburst
local&amp;nbsp;stratum&amp;nbsp;10
bindaddress&amp;nbsp;0.0.0.0
allow&amp;nbsp;192.168.1.0/24
sourcedir&amp;nbsp;/run/chrony-dhcp
driftfile&amp;nbsp;/var/lib/chrony/drift
makestep&amp;nbsp;1.0&amp;nbsp;3
rtcsync
keyfile&amp;nbsp;/etc/chrony.keys
ntsdumpdir&amp;nbsp;/var/lib/chrony
leapsectz&amp;nbsp;right/UTC
logdir&amp;nbsp;/var/log/chrony&lt;/pre&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;2.6 开机启动和立即启动，修改好以后重启服务&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;systemctl&amp;nbsp;enable&amp;nbsp;chronyd&amp;nbsp;--now
systemctl&amp;nbsp;restart&amp;nbsp;chronyd&lt;/pre&gt;&lt;p&gt;&lt;strong style=&quot;box-sizing: border-box; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;p cid=&quot;n27&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;2.7 修改监听地址与访问控制&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n28&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;Chrony默认监听所有网络接口。可通过&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;bindaddress&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;指令指定监听特定IP。例如只监听&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;192.168.1.10&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;ubuntu:配置文件
配置文件/etc/chrony.conf/chrony.conf，操作系统文件可能不同，可以使用tab按键补齐

基于rhel(麒麟服务器版本，centos,rocky等)的系统配置文件如下
配置文件/etc/chrony.conf

添加如下内容，根据自己的IP修改为自己的IP
bindaddress&amp;nbsp;192.168.1.10

或者监听所有IP地址
bindaddress&amp;nbsp;0.0.0.0&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;同时，通过&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;allow&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;指令控制允许哪些客户端访问。若允许整个局域网访问：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;ubuntu:配置文件
配置文件/etc/chrony.conf/chrony.conf，操作系统文件可能不同，可以使用tab按键补齐

基于rhel(麒麟服务器版本，centos,rocky等)的系统配置文件如下
配置文件/etc/chrony.conf

允许哪些IP网段可以同步时间服务器

allow&amp;nbsp;192.168.1.0/24
allow&amp;nbsp;10.0.0.1/8
allow&amp;nbsp;0.0.0.0/0&lt;/pre&gt;&lt;p&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;2.8 其他常用配置&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;，&lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;可以不用配置&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;driftfile&amp;nbsp;/var/lib/chrony/drift&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;记录时间偏差
makestep&amp;nbsp;1.0&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;允许时间步进
rtcsync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;启用RTC同步&lt;/pre&gt;&lt;p&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 cid=&quot;n36&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;3. 启动与验证&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n37&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;配置完成后，执行以下命令：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;重启服务使配置生效
sudo&amp;nbsp;systemctl&amp;nbsp;restart&amp;nbsp;chronyd
#&amp;nbsp;设置开机自启
sudo&amp;nbsp;systemctl&amp;nbsp;enable&amp;nbsp;chronyd&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;验证服务状态：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;查看时间同步源状态
chronyc&amp;nbsp;sources&amp;nbsp;-v
#&amp;nbsp;查看详细同步信息
chronyc&amp;nbsp;tracking&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; white-space: pre-wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 cid=&quot;n42&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;4. 防火墙与安全&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n43&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin: 0.8em 0px;white-space: pre-wrap;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;别忘了放行NTP服务端口（UDP 123）：&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded md-focus&quot; cid=&quot;n44&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;sudo&amp;nbsp;firewall-cmd&amp;nbsp;--permanent&amp;nbsp;--add-service=ntp
sudo&amp;nbsp;firewall-cmd&amp;nbsp;--reload&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 cid=&quot;n684&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;5.基于rhel客户端(麒麟，centos,rocky等)的系统配置文件如下配置文件/etc/chrony.conf&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;如果没有安装先来安装一下
yum&amp;nbsp;install&amp;nbsp;chrony&amp;nbsp;-y

修改配置文件
vim&amp;nbsp;/etc/chrony.conf

原内容：
pool&amp;nbsp;2.rocky.pool.ntp.org&amp;nbsp;iburst

改后内容
把这一行内容改成你服务器的比如我的服务器ip是192.168.1.10
pool&amp;nbsp;192.168.1.10&amp;nbsp;iburst

或者这个写法
server&amp;nbsp;192.168.1.10&amp;nbsp;iburs

重启服务
systemctl&amp;nbsp;restart&amp;nbsp;chronyd

验证
chronyc&amp;nbsp;&amp;nbsp;sources
MS&amp;nbsp;Name/IP&amp;nbsp;address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Stratum&amp;nbsp;Poll&amp;nbsp;Reach&amp;nbsp;LastRx&amp;nbsp;Last&amp;nbsp;sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
===============================================================================
^?&amp;nbsp;192.168.1.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&amp;nbsp;&amp;nbsp;&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+0ns[&amp;nbsp;&amp;nbsp;&amp;nbsp;+0ns]&amp;nbsp;+/-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0ns
[root@db-1&amp;nbsp;~]#&amp;nbsp;chronyc&amp;nbsp;&amp;nbsp;sources&amp;nbsp;-v

&amp;nbsp;&amp;nbsp;.--&amp;nbsp;Source&amp;nbsp;mode&amp;nbsp;&amp;nbsp;&amp;#39;^&amp;#39;&amp;nbsp;=&amp;nbsp;server,&amp;nbsp;&amp;#39;=&amp;#39;&amp;nbsp;=&amp;nbsp;peer,&amp;nbsp;&amp;#39;#&amp;#39;&amp;nbsp;=&amp;nbsp;local&amp;nbsp;clock.
&amp;nbsp;/&amp;nbsp;.-&amp;nbsp;Source&amp;nbsp;state&amp;nbsp;&amp;#39;*&amp;#39;&amp;nbsp;=&amp;nbsp;current&amp;nbsp;best,&amp;nbsp;&amp;#39;+&amp;#39;&amp;nbsp;=&amp;nbsp;combined,&amp;nbsp;&amp;#39;-&amp;#39;&amp;nbsp;=&amp;nbsp;not&amp;nbsp;combined,
|&amp;nbsp;/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;x&amp;#39;&amp;nbsp;=&amp;nbsp;may&amp;nbsp;be&amp;nbsp;in&amp;nbsp;error,&amp;nbsp;&amp;#39;~&amp;#39;&amp;nbsp;=&amp;nbsp;too&amp;nbsp;variable,&amp;nbsp;&amp;#39;?&amp;#39;&amp;nbsp;=&amp;nbsp;unusable.
||&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.-&amp;nbsp;xxxx&amp;nbsp;[&amp;nbsp;yyyy&amp;nbsp;]&amp;nbsp;+/-&amp;nbsp;zzzz
||&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Reachability&amp;nbsp;register&amp;nbsp;(octal)&amp;nbsp;-.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;xxxx&amp;nbsp;=&amp;nbsp;adjusted&amp;nbsp;offset,
||&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Log2(Polling&amp;nbsp;interval)&amp;nbsp;--.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;yyyy&amp;nbsp;=&amp;nbsp;measured&amp;nbsp;offset,
||&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;zzzz&amp;nbsp;=&amp;nbsp;estimated&amp;nbsp;error.
||&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;\
MS&amp;nbsp;Name/IP&amp;nbsp;address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Stratum&amp;nbsp;Poll&amp;nbsp;Reach&amp;nbsp;LastRx&amp;nbsp;Last&amp;nbsp;sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
===============================================================================
^?&amp;nbsp;192.168.1.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&amp;nbsp;&amp;nbsp;&amp;nbsp;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+0ns[&amp;nbsp;&amp;nbsp;&amp;nbsp;+0ns]&amp;nbsp;+/-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0ns&lt;/pre&gt;&lt;p&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s md-expand&quot; style=&quot;white-space: pre-wrap; box-sizing: border-box; color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; orphans: 4; background-color: #FFFFFF;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 cid=&quot;n685&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;5.1详细配置文件如下&lt;/span&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;grep&amp;nbsp;-Ev&amp;nbsp;&amp;#39;^$|#&amp;#39;&amp;nbsp;/etc/chrony.conf
pool&amp;nbsp;192.168.1.10&amp;nbsp;iburst
sourcedir&amp;nbsp;/run/chrony-dhcp
driftfile&amp;nbsp;/var/lib/chrony/drift
makestep&amp;nbsp;1.0&amp;nbsp;3
rtcsync
keyfile&amp;nbsp;/etc/chrony.keys
ntsdumpdir&amp;nbsp;/var/lib/chrony
leapsectz&amp;nbsp;right/UTC
logdir&amp;nbsp;/var/log/chrony&lt;/pre&gt;&lt;p&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 cid=&quot;n688&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;6.ubuntu客户端配置&lt;/span&gt;&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;如果没有安装先来安装一下
apt&amp;nbsp;update
apt&amp;nbsp;install&amp;nbsp;chrony&amp;nbsp;-y

修改配置文件：
vim&amp;nbsp;/etc/chrony/chrony.conf

原内容：
pool&amp;nbsp;ntp.ubuntu.com&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;4
pool&amp;nbsp;0.ubuntu.pool.ntp.org&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;1
pool&amp;nbsp;1.ubuntu.pool.ntp.org&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;1
pool&amp;nbsp;2.ubuntu.pool.ntp.org&amp;nbsp;iburst&amp;nbsp;maxsources&amp;nbsp;2

改后内容，把原来的删除掉，在下面新增一行
把这一行内容改成你服务器的比如我的服务器ip是192.168.1.10
pool&amp;nbsp;192.168.1.10&amp;nbsp;iburst

或者这个写法
server&amp;nbsp;192.168.1.10&amp;nbsp;iburs

重启服务
systemctl&amp;nbsp;restart&amp;nbsp;chronyd&lt;/pre&gt;&lt;h3 cid=&quot;n45&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/h3&gt;&lt;h4 cid=&quot;n691&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;6.1详细配置文件&lt;/span&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;grep&amp;nbsp;-Ev&amp;nbsp;&amp;#39;^$|#&amp;#39;&amp;nbsp;/etc/chrony/chrony.conf&amp;nbsp;
confdir&amp;nbsp;/etc/chrony/conf.d
pool&amp;nbsp;192.168.1.10&amp;nbsp;iburst
sourcedir&amp;nbsp;/run/chrony-dhcp
sourcedir&amp;nbsp;/etc/chrony/sources.d
keyfile&amp;nbsp;/etc/chrony/chrony.keys
driftfile&amp;nbsp;/var/lib/chrony/chrony.drift
ntsdumpdir&amp;nbsp;/var/lib/chrony
logdir&amp;nbsp;/var/log/chrony
maxupdateskew&amp;nbsp;100.0
rtcsync
makestep&amp;nbsp;1&amp;nbsp;3
leapsectz&amp;nbsp;right/UTC&lt;/pre&gt;&lt;p&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 cid=&quot;n45&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box;&quot;&gt;总结&lt;/span&gt;&lt;/h3&gt;&lt;ul class=&quot;ul-list list-paddingleft-2&quot; cid=&quot;n46&quot; mdtype=&quot;list&quot; data-mark=&quot;*&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; padding-left: 30px; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; white-space: normal;&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n48&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px 0px 0.5rem; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;配置文件&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;：主要编辑 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;/etc/chrony.conf&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n50&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px 0px 0.5rem; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;监听地址&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;：用 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;bindaddress&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; 指定IP。&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n52&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px 0px 0.5rem; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;访问控制&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;：用 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;allow&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; 设置允许的客户端网段。&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n54&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px 0px 0.5rem; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;重启生效&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;：每次修改配置后需重启 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; class=&quot;md-pair-s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;chronyd&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt; 服务。&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n54&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px 0px 0.5rem; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p cid=&quot;n54&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px 0px 0.5rem; white-space: pre-wrap; position: relative;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p cid=&quot;n54&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px 0px 0.5rem; white-space: pre-wrap; position: relative;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 07 Jul 2026 12:50:32 +0800</pubDate></item><item><title>mysql8.0主从配置</title><link>https://9527edu.org/post/226.html</link><description>&lt;p&gt;&lt;span style=&quot;font-size: 24px;&quot;&gt;主库IP:172.16.0.33&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;主库IP:172.16.0.33

主库配置文件如下
[root@db-1&amp;nbsp;~]#&amp;nbsp;vim&amp;nbsp;/etc/my.cnf
&amp;nbsp;&amp;nbsp;
[mysqld]
bind-address=0.0.0.0
server-id=1
log-bin=master-bin
datadir=/data/mysql
socket=/data/mysql/mysql.sock

log-error=/data/mysql/mysql.log
pid-file=/data/mysql/mysql.pid
character-set-server=utf8mb4
[client]
socket=/data/mysql/mysql.sock
default-character-set=utf8mb4

解释
bind-address=0.0.0.0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;监听地址，监听IP地址
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
server-id=1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;主从唯一ID标识，主从的ID不能一样

log-bin=master-bin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;binlog日志名称，建议主库设置为master-bin
&amp;nbsp;&amp;nbsp;&amp;nbsp;
配置好以后重启mysqld服务
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ystemctl&amp;nbsp;restart&amp;nbsp;mysqld
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
进入数据库,回车以后输入密码
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mysql&amp;nbsp;-uroot&amp;nbsp;-p

创建同步账号，账号名称为rep，密码123456，授权IP段为172.16.0.%
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;create&amp;nbsp;user&amp;nbsp;rep@&amp;#39;172.16.0.%&amp;#39;&amp;nbsp;identified&amp;nbsp;with&amp;nbsp;mysql_native_password&amp;nbsp;by&amp;nbsp;&amp;#39;123456&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grant&amp;nbsp;replication&amp;nbsp;slave&amp;nbsp;on&amp;nbsp;*.*&amp;nbsp;to&amp;nbsp;rep@&amp;#39;172.16.0.%&amp;#39;;

查看主库节点的binlog日志名称和Position备份开始点
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;show&amp;nbsp;master&amp;nbsp;status;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;返回结果：
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+-------------------+----------+--------------+------------------+-------------------+
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;File&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;Position&amp;nbsp;|&amp;nbsp;Binlog_Do_DB&amp;nbsp;|&amp;nbsp;Binlog_Ignore_DB&amp;nbsp;|&amp;nbsp;Executed_Gtid_Set&amp;nbsp;|
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+-------------------+----------+--------------+------------------+-------------------+
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;master-bin.000002&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;156&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+-------------------+----------+--------------+------------------+-------------------+
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;row&amp;nbsp;in&amp;nbsp;set&amp;nbsp;(0.00&amp;nbsp;sec)&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap; font-size: 24px;&quot;&gt;从库IP:172.16.0.34&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;从库IP:172.16.0.35

从库配置文件如下
[root@db-1&amp;nbsp;~]#&amp;nbsp;vim&amp;nbsp;/etc/my.cnf
&amp;nbsp;&amp;nbsp;
[mysqld]
bind-address=0.0.0.0
server-id=2
log-bin=slave-bin
datadir=/data/mysql
socket=/data/mysql/mysql.sock

log-error=/data/mysql/mysql.log
pid-file=/data/mysql/mysql.pid
character-set-server=utf8mb4
[client]
socket=/data/mysql/mysql.sock
default-character-set=utf8mb4

解释
bind-address=0.0.0.0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;监听地址，监听IP地址
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
server-id=
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;主从唯一ID标识，主从的ID不能一样

log-bin=slave-bin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;binlog日志名称，建议主库设置为master-bin
&amp;nbsp;&amp;nbsp;&amp;nbsp;
配置好以后重启mysqld服务
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ystemctl&amp;nbsp;restart&amp;nbsp;mysqld
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
进入数据库,回车以后输入密码
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mysql&amp;nbsp;-uroot&amp;nbsp;-p
&amp;nbsp;&amp;nbsp;
添加主库的IP，同步的账号密码和IP，还有bin-log的名称，和Position开始备份点
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;change&amp;nbsp;master&amp;nbsp;to&amp;nbsp;master_host=&amp;#39;172.16.0.34&amp;#39;,master_user=&amp;#39;rep&amp;#39;,master_password=&amp;#39;123456&amp;#39;,master_log_file=&amp;#39;master-bin.000002&amp;#39;,master_log_pos=156;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;解释
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;master_host=&amp;#39;172.16.0.34
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;主库的IP地址
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;master_user=&amp;#39;rep&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;主库同步的账号
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;master_password=&amp;#39;123456&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;主库同步的设置的密码
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;master_log_file=&amp;#39;master-bin.000002&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;binlog名称
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;master_log_pos=156;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Position同步的起始点
&amp;nbsp;
启动从库同步
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start&amp;nbsp;slave;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
查看同步状态是否成功
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;show&amp;nbsp;slave&amp;nbsp;status&amp;nbsp;\G
返回结果：
***************************&amp;nbsp;1.&amp;nbsp;row&amp;nbsp;***************************
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slave_IO_State:&amp;nbsp;Waiting&amp;nbsp;for&amp;nbsp;master&amp;nbsp;to&amp;nbsp;send&amp;nbsp;event
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_Host:&amp;nbsp;172.16.0.34
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_User:&amp;nbsp;rep
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_Port:&amp;nbsp;3306
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Connect_Retry:&amp;nbsp;60
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_Log_File:&amp;nbsp;master-bin.000002
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Read_Master_Log_Pos:&amp;nbsp;156
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Relay_Log_File:&amp;nbsp;db-2-relay-bin.000002
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Relay_Log_Pos:&amp;nbsp;325
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Relay_Master_Log_File:&amp;nbsp;master-bin.000002
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slave_IO_Running:&amp;nbsp;Yes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slave_SQL_Running:&amp;nbsp;Yes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replicate_Do_DB:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replicate_Ignore_DB:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replicate_Do_Table:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replicate_Ignore_Table:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replicate_Wild_Do_Table:&amp;nbsp;
&amp;nbsp;&amp;nbsp;Replicate_Wild_Ignore_Table:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_Errno:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_Error:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Skip_Counter:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Exec_Master_Log_Pos:&amp;nbsp;156
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Relay_Log_Space:&amp;nbsp;533
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Until_Condition:&amp;nbsp;None
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Until_Log_File:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Until_Log_Pos:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_Allowed:&amp;nbsp;No
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_CA_File:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_CA_Path:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_Cert:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_Cipher:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_Key:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Seconds_Behind_Master:&amp;nbsp;0
Master_SSL_Verify_Server_Cert:&amp;nbsp;No
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_IO_Errno:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_IO_Error:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_SQL_Errno:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_SQL_Error:&amp;nbsp;
&amp;nbsp;&amp;nbsp;Replicate_Ignore_Server_Ids:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_Server_Id:&amp;nbsp;1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_UUID:&amp;nbsp;7129cc53-c2df-11f0-b757-bc2411b16047
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_Info_File:&amp;nbsp;mysql.slave_master_info
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQL_Delay:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQL_Remaining_Delay:&amp;nbsp;NULL
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slave_SQL_Running_State:&amp;nbsp;Slave&amp;nbsp;has&amp;nbsp;read&amp;nbsp;all&amp;nbsp;relay&amp;nbsp;log;&amp;nbsp;waiting&amp;nbsp;for&amp;nbsp;more&amp;nbsp;updates
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_Retry_Count:&amp;nbsp;86400
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_Bind:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_IO_Error_Timestamp:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last_SQL_Error_Timestamp:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_Crl:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_SSL_Crlpath:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Retrieved_Gtid_Set:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Executed_Gtid_Set:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Auto_Position:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replicate_Rewrite_DB:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Channel_Name:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_TLS_Version:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Master_public_key_path:&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Get_master_public_key:&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Network_Namespace:&amp;nbsp;
1&amp;nbsp;row&amp;nbsp;in&amp;nbsp;set&amp;nbsp;(0.00&amp;nbsp;sec)

解释：如下两个都为yes说明同步成功
Slave_IO_Running:&amp;nbsp;Yes
Slave_SQL_Running:&amp;nbsp;Yes&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 20px; text-wrap-mode: wrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;</description><pubDate>Sun, 16 Nov 2025 19:55:44 +0800</pubDate></item><item><title>脚本安装frps服务端实现内网穿透</title><link>https://9527edu.org/post/225.html</link><description>&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;写入以下内容
vim&amp;nbsp;install_frps.sh&lt;/pre&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#!/bin/bash
FRP_VERSION=0.51.3
wget&amp;nbsp;https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz
tar&amp;nbsp;-xf&amp;nbsp;frp_${FRP_VERSION}_linux_amd64.tar.gz&amp;nbsp;-C&amp;nbsp;/usr/local/
mv&amp;nbsp;&amp;nbsp;/usr/local/frp_${FRP_VERSION}_linux_amd64&amp;nbsp;/usr/local/frp
cat&amp;nbsp;&amp;gt;&amp;nbsp;/usr/lib/systemd/system/frps.service&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;AOF
[Unit]
Description=frps&amp;nbsp;service
After=network.target&amp;nbsp;syslog.target
Wants=network.target

[Service]
Type=simple
#启动服务的命令（此处写你的frps的实际安装目录）
ExecStart=/usr/local/frp/frps&amp;nbsp;-c&amp;nbsp;/usr/local/frp/frps.ini

[Install]
WantedBy=multi-user.target
AOF

systemctl&amp;nbsp;daemon-reload
systemctl&amp;nbsp;enable&amp;nbsp;frps&amp;nbsp;--now

cp&amp;nbsp;/usr/local/frp/frps.ini{,.bak}
cat&amp;nbsp;&amp;gt;&amp;nbsp;/usr/local/frp/frps.ini&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;AOF
[common]
bind_port&amp;nbsp;=&amp;nbsp;7000
token&amp;nbsp;=&amp;nbsp;Asdf-123password
bind_udp_port&amp;nbsp;=&amp;nbsp;7001

#以下是可选设置
dashboard_port&amp;nbsp;=&amp;nbsp;7500
#&amp;nbsp;dashboard&amp;nbsp;用户名密码，默认都为&amp;nbsp;admin
dashboard_user&amp;nbsp;=&amp;nbsp;admin
dashboard_pwd&amp;nbsp;=&amp;nbsp;Asdf-123password
AOF
systemctl&amp;nbsp;restart&amp;nbsp;frps&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;执行&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;bash&amp;nbsp;install_frps.sh&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sat, 05 Jul 2025 16:41:05 +0800</pubDate></item><item><title>一键安装rustdesk脚本，Centos,，Rocky,Ubuntu</title><link>https://9527edu.org/post/224.html</link><description>&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#!/bin/bash
RUSTDESK_VERSION=1.1.14
#wget&amp;nbsp;https://github.com/rustdesk/rustdesk-server/releases/download/$RUSTDESK_VERSION/rustdesk-server-linux-amd64.zip
unzip&amp;nbsp;rustdesk-server-linux-amd64.zip&amp;nbsp;-d&amp;nbsp;/usr/local/
mv&amp;nbsp;/usr/local/amd64/&amp;nbsp;/usr/local/rustdesk
cat&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/systemd/system/hbbs.service&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;EOF
[Unit]
Description=RustDesk&amp;nbsp;HBBS&amp;nbsp;Server
After=network.target

[Service]
Type=simple
WorkingDirectory=/usr/local/rustdesk
ExecStart=/usr/local/rustdesk/hbbs
Restart=always
RestartSec=5
User=root

[Install]
WantedBy=multi-user.target
EOF

cat&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/systemd/system/hbbr.service&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;EOF
[Unit]
Description=RustDesk&amp;nbsp;HBBR&amp;nbsp;Relay&amp;nbsp;Server
After=network.target

[Service]
Type=simple
WorkingDirectory=/usr/local/rustdesk
ExecStart=/usr/local/rustdesk/hbbr
Restart=always
RestartSec=5
User=root

[Install]
WantedBy=multi-user.target
EOF

#设置开机自启动
systemctl&amp;nbsp;daemon-reload
systemctl&amp;nbsp;enable&amp;nbsp;hbbs&amp;nbsp;--now
systemctl&amp;nbsp;enable&amp;nbsp;hbbr&amp;nbsp;--now

#&amp;nbsp;提高文件描述符限制
echo&amp;nbsp;&amp;quot;*&amp;nbsp;soft&amp;nbsp;nofile&amp;nbsp;1000000&amp;quot;&amp;nbsp;|&amp;nbsp;sudo&amp;nbsp;tee&amp;nbsp;-a&amp;nbsp;/etc/security/limits.conf
echo&amp;nbsp;&amp;quot;*&amp;nbsp;hard&amp;nbsp;nofile&amp;nbsp;1000000&amp;quot;&amp;nbsp;|&amp;nbsp;sudo&amp;nbsp;tee&amp;nbsp;-a&amp;nbsp;/etc/security/limits.conf

#&amp;nbsp;优化网络参数
echo&amp;nbsp;&amp;quot;net.core.rmem_max&amp;nbsp;=&amp;nbsp;67108864&amp;quot;&amp;nbsp;|&amp;nbsp;sudo&amp;nbsp;tee&amp;nbsp;-a&amp;nbsp;/etc/sysctl.conf
echo&amp;nbsp;&amp;quot;net.core.wmem_max&amp;nbsp;=&amp;nbsp;67108864&amp;quot;&amp;nbsp;|&amp;nbsp;sudo&amp;nbsp;tee&amp;nbsp;-a&amp;nbsp;/etc/sysctl.conf
sudo&amp;nbsp;sysctl&amp;nbsp;-p

#查看KEY
cat&amp;nbsp;/usr/local/rustdesk/id_ed25519.pub&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 03 Jul 2025 02:45:30 +0800</pubDate></item><item><title>frp内网穿透linux和windows实现内网穿透</title><link>https://9527edu.org/post/223.html</link><description>&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;frp官网地址：https://github.com/fatedier/frp/releases

windows下载地址
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;https://github.com/fatedier/frp/releases/download/v0.51.3/frp_0.51.3_windows_amd64.zip

linux下载地址：
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wget&amp;nbsp;https://github.com/fatedier/frp/releases/download/v0.51.3/frp_0.51.3_linux_amd64.tar.gz

linux解压，解压到/usr/local/下。并重新命名
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tar&amp;nbsp;-xf&amp;nbsp;frp_0.51.3_linux_amd64.tar.gz&amp;nbsp;-C&amp;nbsp;/usr/local/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mv&amp;nbsp;/usr/local/frp_0.51.3_linux_amd64/&amp;nbsp;/usr/local/frp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
linux服务启动文件配置
vim&amp;nbsp;/usr/lib/systemd/system/frps.service

[Unit]
Description=frps&amp;nbsp;service
After=network.target&amp;nbsp;syslog.target
Wants=network.target

[Service]
Type=simple
#启动服务的命令（此处写你的frps的实际安装目录）
ExecStart=/usr/local/frp/frps&amp;nbsp;-c&amp;nbsp;/usr/local/frp/frps.ini

[Install]
WantedBy=multi-user.target


systemctl&amp;nbsp;daemon-reload
systemctl&amp;nbsp;enable&amp;nbsp;frps&amp;nbsp;--now

服务端配置文件
#[common]
#bind_port&amp;nbsp;=&amp;nbsp;7000

[common]
bind_port&amp;nbsp;=&amp;nbsp;7000
#token&amp;nbsp;=&amp;nbsp;ainiyade
#bind_udp_port&amp;nbsp;=&amp;nbsp;7001

#以下是可选设置
dashboard_port&amp;nbsp;=&amp;nbsp;7500
#&amp;nbsp;dashboard&amp;nbsp;用户名密码，默认都为&amp;nbsp;admin
dashboard_user&amp;nbsp;=&amp;nbsp;admin
dashboard_pwd&amp;nbsp;=&amp;nbsp;Asdf-123password

windows启动,linux无需打理
.\frps.exe&amp;nbsp;-c&amp;nbsp;frps.ini



客户端配置文件
frpc.ini
内容
[common]
server_addr&amp;nbsp;=&amp;nbsp;114.55.42.243(服务器IP)
server_port&amp;nbsp;=&amp;nbsp;7000
auth.method&amp;nbsp;=&amp;nbsp;&amp;#39;token&amp;#39;
auth.token&amp;nbsp;=&amp;nbsp;&amp;#39;Asdf-123password&amp;#39;

[ssh]
type&amp;nbsp;=&amp;nbsp;tcp
local_ip&amp;nbsp;=&amp;nbsp;127.0.0.1
local_port&amp;nbsp;=&amp;nbsp;8080
remote_port&amp;nbsp;=&amp;nbsp;8080

[sshd]
type&amp;nbsp;=&amp;nbsp;tcp
local_ip&amp;nbsp;=&amp;nbsp;127.0.0.1
local_port&amp;nbsp;=&amp;nbsp;9090
remote_port&amp;nbsp;=&amp;nbsp;9090

解释：
[ssh]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;这个语句块，每个单独的语句块，名称不能一样

type&amp;nbsp;=&amp;nbsp;tcp
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;协议，如tcp或者http，一般斗使用tcp

local_ip&amp;nbsp;=&amp;nbsp;127.0.0.1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;内网里面的机器IP地址，如果是本机就写127.0.0.1

local_port&amp;nbsp;=&amp;nbsp;8080
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;本地监听端口

remote_port&amp;nbsp;=&amp;nbsp;8080&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;服务器上使用的端口，可以都用一样的端口80除外，80端口需要备案

windows启动命令
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.\frpc.exe&amp;nbsp;-c&amp;nbsp;frpc.ini

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
linux下载地址：
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wget&amp;nbsp;https://github.com/fatedier/frp/releases/download/v0.51.3/frp_0.51.3_linux_amd64.tar.gz

linux解压，解压到/usr/local/下。并重新命名
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tar&amp;nbsp;-xf&amp;nbsp;frp_0.51.3_linux_amd64.tar.gz&amp;nbsp;-C&amp;nbsp;/usr/local/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mv&amp;nbsp;/usr/local/frp_0.51.3_linux_amd64/&amp;nbsp;/usr/local/frp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;

linux启动
linux下客户端配置
vim&amp;nbsp;/usr/lib/systemd/system/frpc.service

[Unit]
Description=frps&amp;nbsp;service
After=network.target&amp;nbsp;syslog.target
Wants=network.target

[Service]
Type=simple
#启动服务的命令（此处写你的frps的实际安装目录）
ExecStart=/usr/local/frp/frpc&amp;nbsp;-c&amp;nbsp;/usr/local/frp/frpc.ini

[Install]
WantedBy=multi-user.target


systemctl&amp;nbsp;daemon-reload
systemctl&amp;nbsp;enable&amp;nbsp;frps&amp;nbsp;--now


群晖FRPC套件配置文件
serverAddr&amp;nbsp;=&amp;nbsp;&amp;quot;49.232.104.115&amp;quot;
serverPort&amp;nbsp;=&amp;nbsp;7000
auth.method&amp;nbsp;=&amp;nbsp;&amp;#39;token&amp;#39;
auth.token&amp;nbsp;=&amp;nbsp;&amp;#39;Asdf-123password&amp;#39;

[[proxies]]
name&amp;nbsp;=&amp;nbsp;&amp;quot;test-tcp&amp;quot;
type&amp;nbsp;=&amp;nbsp;&amp;quot;tcp&amp;quot;
localIP&amp;nbsp;=&amp;nbsp;&amp;quot;127.0.0.1&amp;quot;
localPort&amp;nbsp;=&amp;nbsp;5001
remotePort&amp;nbsp;=&amp;nbsp;5002&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 30 Jun 2025 02:12:27 +0800</pubDate></item><item><title>安装RustDesk服务器端</title><link>https://9527edu.org/post/222.html</link><description>&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 1.5em; orphans: 4; white-space-collapse: preserve;&quot;&gt;方法一：使用Docker安装（推荐）&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n4&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;这是官方推荐的安装方式，适合生产环境。&lt;/span&gt;&lt;/p&gt;&lt;ol start=&quot;&quot; cid=&quot;n5&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box;margin-top: 0.8em;margin-bottom: 0.8em;padding-left: 30px;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n7&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;安装Docker&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n8&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; apt update&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; apt install docker.io docker-compose-plugin&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; systemctl enable &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;--now&lt;/span&gt; docker&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n10&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;创建配置目录&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n11&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;mkdir&amp;nbsp;-p&amp;nbsp;~/rustdesk-server&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;cd&amp;nbsp;~/rustdesk-server&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n13&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;创建docker-compose.yml&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n14&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;cat&lt;/span&gt; &amp;gt; docker-compose.yml &amp;lt;&amp;lt;EOF&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;version: &lt;span style=&quot;box-sizing: border-box;color: #AA1111&quot;&gt;&amp;#39;3&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;services:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp;hbbs:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;image: rustdesk/rustdesk-server:hbbs&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;container_name: hbbs&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;volumes:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; ./data:/root&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;ports:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;21115&lt;/span&gt;:21115&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;21116&lt;/span&gt;:21116&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;21116&lt;/span&gt;:21116/udp&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;21118&lt;/span&gt;:21118&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;command: hbbs &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-r&lt;/span&gt; rustdesk.example.com:21117 &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #AA5500&quot;&gt;# 替换为你的域名或IP&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;restart&lt;/span&gt;: unless-stopped&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp;hbbr:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;image: rustdesk/rustdesk-server:hbbr&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;container_name: hbbr&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;volumes:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; ./data:/root&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;ports:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;21117&lt;/span&gt;:21117&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;21119&lt;/span&gt;:21119&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;restart&lt;/span&gt;: unless-stopped&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;EOF&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n16&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;修改配置&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n17&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;nano&amp;nbsp;docker-compose.yml&lt;/pre&gt;&lt;/li&gt;&lt;ul cid=&quot;n18&quot; mdtype=&quot;list&quot; data-mark=&quot;-&quot; style=&quot;box-sizing: border-box;padding-left: 30px;position: relative&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n20&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;将&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;rustdesk.example.com&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;替换为你的服务器公网IP或域名&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n22&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;如需自定义密钥，在&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;command&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;行添加&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;-k your_custom_key&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p cid=&quot;n24&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;启动服务器&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n25&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;sudo&amp;nbsp;docker&amp;nbsp;compose&amp;nbsp;up&amp;nbsp;-d&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n27&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;查看密钥&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n28&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;sudo&amp;nbsp;docker&amp;nbsp;exec&amp;nbsp;-it&amp;nbsp;hbbs&amp;nbsp;cat&amp;nbsp;/root/id_ed25519.pub&lt;/pre&gt;&lt;p cid=&quot;n29&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.5rem;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;保存输出的公钥，客户端连接时需要&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 cid=&quot;n31&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;方法二：手动安装（二进制文件）&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n32&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;适合不使用Docker的环境&lt;/span&gt;&lt;/p&gt;&lt;ol start=&quot;&quot; cid=&quot;n33&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box; margin-top: 0.8em; margin-bottom: 0.8em; padding-left: 30px; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-wrap-mode: wrap;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n35&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;下载服务器二进制&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n36&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;wget&lt;/span&gt; https://github.com/rustdesk/rustdesk-server/releases/download/1.1.9/rustdesk-server-linux-amd64.zip&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;unzip rustdesk-server-linux-amd64.zip&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;cd&lt;/span&gt; amd64&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n38&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;运行服务器&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n39&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #AA5500&quot;&gt;# 启动信令服务器 (hbbs)&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;nohup ./hbbs &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-r&lt;/span&gt; your_server_ip:21117 &amp;gt; hbbs.log &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;2&lt;/span&gt;&amp;gt;&amp;amp;1 &amp;amp;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #AA5500&quot;&gt;# 启动中继服务器 (hbbr)&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;nohup ./hbbr &amp;gt; hbbr.log &lt;span style=&quot;box-sizing: border-box;color: #116644&quot;&gt;2&lt;/span&gt;&amp;gt;&amp;amp;1 &amp;amp;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n40&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.5rem;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;替换&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;your_server_ip&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;为你的公网IP&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n42&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;获取公钥&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n43&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;cat&amp;nbsp;id_ed25519.pub&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 4. &lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;配置hbbr和hbbs开机自启动&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 微软雅黑, &amp;quot;Microsoft YaHei&amp;quot;;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; 1.&lt;span style=&quot;color: #333333; orphans: 4; white-space-collapse: preserve;&quot;&gt;为每个服务创建配置文件：&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;vim&amp;nbsp;/etc/systemd/system/hbbs.service&lt;/pre&gt;&lt;p cid=&quot;n106&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;内容如下：&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n107&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;font-weight: 700;color: #0000FF&quot;&gt;[Unit]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;Description&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;RustDesk HBBS Server&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;After&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;network.target&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;font-weight: 700;color: #0000FF&quot;&gt;[Service]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;Type&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;simple&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;WorkingDirectory&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;/usr/local/rustdesk&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;ExecStart&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;/usr/local/rustdesk/hbbs&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;Restart&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;always&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;RestartSec&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;User&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;font-weight: 700;color: #0000FF&quot;&gt;[Install]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;WantedBy&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;multi-user.target&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n108&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;vim&amp;nbsp;/etc/systemd/system/hbbr.service&lt;/pre&gt;&lt;p cid=&quot;n109&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;内容如下：&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n110&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;font-weight: 700;color: #0000FF&quot;&gt;[Unit]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;Description&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;RustDesk HBBR Relay Server&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;After&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;network.target&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;font-weight: 700;color: #0000FF&quot;&gt;[Service]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;Type&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;simple&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;WorkingDirectory&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;/usr/local/rustdesk&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;ExecStart&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;/usr/local/rustdesk/hbbr&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;Restart&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;always&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;RestartSec&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;User&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;font-weight: 700;color: #0000FF&quot;&gt;[Install]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #0000FF&quot;&gt;WantedBy&lt;/span&gt;=&lt;span style=&quot;box-sizing: border-box;color: #009900&quot;&gt;multi-user.target&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3 cid=&quot;n111&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;white-space: pre-wrap; box-sizing: border-box; break-after: avoid-page; break-inside: avoid; orphans: 4; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: 微软雅黑, 宋体, Arial, Helvetica, sans-serif; font-size: 12px;&quot;&gt;2.重新加载system&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n112&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;sudo&amp;nbsp;systemctl&amp;nbsp;daemon-reload&lt;/pre&gt;&lt;h3 cid=&quot;n113&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: 12px;&quot;&gt;3. 启用开机自启动并立即启动服务&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n114&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; systemctl enable hbbs&amp;nbsp; --now&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; systemctl enable hbbr&amp;nbsp; --now&lt;/span&gt;&lt;/pre&gt;&lt;h3 cid=&quot;n115&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: 12px;&quot;&gt;4. 启动服务（可选）&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n116&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; systemctl &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;start&lt;/span&gt; hbbs&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; systemctl &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;start&lt;/span&gt; hbbr&lt;/span&gt;&lt;/pre&gt;&lt;h3 cid=&quot;n117&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: 12px;&quot;&gt;5. 验证服务状态&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n118&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;systemctl status hbbs&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;systemctl status hbbr&lt;/span&gt;&lt;/pre&gt;&lt;h3 cid=&quot;n119&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;关键点说明：&lt;/span&gt;&lt;/h3&gt;&lt;ol start=&quot;&quot; cid=&quot;n120&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box;margin-top: 0.8em;margin-bottom: 0.8em;padding-left: 30px;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n122&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;工作目录&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;WorkingDirectory&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;指定为&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;/usr/local/rustdesk&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;确保服务在正确路径启动&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n124&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;自动重启&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;Restart=always&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;和&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;RestartSec=5&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;使服务崩溃后5秒自动重启&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n126&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;依赖关系&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;After=network.target&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;确保在网络就绪后启动服务&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n128&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;权限设置&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;User=root&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;以root权限运行（根据实际需求可修改为其他用户）&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;blockquote cid=&quot;n129&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box;margin: 0.8em 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(119, 119, 119);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot;&gt;&lt;p cid=&quot;n130&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.8em;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;注意：如果可执行文件需要额外参数（如&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;-k _&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;），修改&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;ExecStart&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box&quot;&gt;行：&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;&lt;br/&gt;&lt;/p&gt;&lt;h3 cid=&quot;n48&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box&quot;&gt;客户端配置&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n49&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;在RustDesk客户端中设置：&lt;/span&gt;&lt;/p&gt;&lt;ol start=&quot;&quot; cid=&quot;n50&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box;margin-top: 0.8em;margin-bottom: 0.8em;padding-left: 30px;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n52&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;ID服务器：你的服务器IP/域名&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n54&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box&quot;&gt;中继服务器：同上&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n56&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;API服务器：留空（除非使用Web控制台）&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n58&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;密钥：从&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;id_ed25519.pub&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;获取的公钥&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr style=&quot;box-sizing: content-box;height: 2px;margin: 16px 0px;border: 0px none;padding: 0px;background-color: rgb(231, 231, 231)&quot;/&gt;&lt;h3 cid=&quot;n60&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;管理命令&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;figure cid=&quot;n61&quot; mdtype=&quot;table&quot; style=&quot;box-sizing: border-box;margin: 1.2em 0px;overflow-x: auto;max-width: calc(100% + 16px);padding: 0px;cursor: default;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot;&gt;&lt;table width=&quot;1140&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;background-color: rgb(248, 248, 248)&quot;&gt;&lt;tr cid=&quot;n62&quot; mdtype=&quot;table_row&quot; style=&quot;box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;box-sizing: border-box;padding: 6px 13px;border-bottom: 0px;border-top-color: rgb(223, 226, 229);border-right-color: rgb(223, 226, 229);border-left-color: rgb(223, 226, 229)&quot;&gt;&lt;span cid=&quot;n63&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 98px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;操作&lt;/span&gt;&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;box-sizing: border-box;padding: 6px 13px;border-bottom: 0px;border-top-color: rgb(223, 226, 229);border-right-color: rgb(223, 226, 229);border-left-color: rgb(223, 226, 229)&quot;&gt;&lt;span cid=&quot;n64&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 653px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;Docker方式&lt;/span&gt;&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;box-sizing: border-box;padding: 6px 13px;border-bottom: 0px;border-top-color: rgb(223, 226, 229);border-right-color: rgb(223, 226, 229);border-left-color: rgb(223, 226, 229)&quot;&gt;&lt;span cid=&quot;n65&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 307px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;二进制方式&lt;/span&gt;&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box&quot;&gt;&lt;tr cid=&quot;n66&quot; mdtype=&quot;table_row&quot; style=&quot;box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px&quot;&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n67&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 98px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;启动&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n68&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 653px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;sudo docker compose up -d&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n69&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 307px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;./hbbs &amp;amp; ./hbbr &amp;amp;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr cid=&quot;n70&quot; mdtype=&quot;table_row&quot; style=&quot;box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px;background-color: rgb(248, 248, 248)&quot;&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n71&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 98px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;停止&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n72&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 653px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;sudo docker compose down&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n73&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 307px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;pkill hbbs &amp;amp;&amp;amp; pkill hbbr&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr cid=&quot;n74&quot; mdtype=&quot;table_row&quot; style=&quot;box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px&quot;&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n75&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 98px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;查看日志&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n76&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 653px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;sudo docker compose logs&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n77&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 307px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;查看&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;hbbs.log&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;/&lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;hbbr.log&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr cid=&quot;n78&quot; mdtype=&quot;table_row&quot; style=&quot;box-sizing: border-box;break-inside: avoid;break-after: auto;border-top: 1px solid rgb(223, 226, 229);padding: 0px;background-color: rgb(248, 248, 248)&quot;&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n79&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 98px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;更新&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n80&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 653px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;code style=&quot;box-sizing: border-box;font-family: var(--monospace);vertical-align: initial;border: 1px solid rgb(231, 234, 237);background-color: rgb(243, 244, 244);border-radius: 3px;padding: 0px 2px;font-size: 0.9em&quot;&gt;sudo docker compose pull &amp;amp;&amp;amp; sudo docker compose up -d&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box;padding: 6px 13px;border-color: rgb(223, 226, 229);min-width: 32px&quot;&gt;&lt;span cid=&quot;n81&quot; mdtype=&quot;table_cell&quot; style=&quot;box-sizing: border-box;display: inline-block;min-width: 1ch;width: 307px;min-height: 10px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;重新下载二进制替换&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;hr style=&quot;box-sizing: content-box;height: 2px;margin: 16px 0px;border: 0px none;padding: 0px;background-color: rgb(231, 231, 231)&quot;/&gt;&lt;h3 cid=&quot;n83&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.5em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.43;cursor: text;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;注意事项&lt;/span&gt;&lt;/h3&gt;&lt;ol start=&quot;&quot; cid=&quot;n84&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box;margin-top: 0.8em;margin-bottom: 0.8em;padding-left: 30px;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n86&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;域名要求&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：如果使用域名：&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;ul cid=&quot;n87&quot; mdtype=&quot;list&quot; data-mark=&quot;-&quot; style=&quot;box-sizing: border-box;padding-left: 30px;position: relative&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p cid=&quot;n89&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;需设置DNS A记录指向服务器IP&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n91&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;建议申请SSL证书（可通过Let&amp;#39;s Encrypt）&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p cid=&quot;n93&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;性能优化&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n94&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #AA5500&quot;&gt;# 提高文件描述符限制&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #AA1111&quot;&gt;&amp;quot;* soft nofile 1000000&amp;quot;&lt;/span&gt; | &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;tee&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-a&lt;/span&gt; /etc/security/limits.conf&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #AA1111&quot;&gt;&amp;quot;* hard nofile 1000000&amp;quot;&lt;/span&gt; | &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;tee&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-a&lt;/span&gt; /etc/security/limits.conf&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #AA5500&quot;&gt;# 优化网络参数&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #AA1111&quot;&gt;&amp;quot;net.core.rmem_max = 67108864&amp;quot;&lt;/span&gt; | &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;tee&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-a&lt;/span&gt; /etc/sysctl.conf&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #AA1111&quot;&gt;&amp;quot;net.core.wmem_max = 67108864&amp;quot;&lt;/span&gt; | &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;tee&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-a&lt;/span&gt; /etc/sysctl.conf&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;span style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; sysctl &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-p&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n96&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0px;margin-bottom: 0.5rem;white-space-collapse: preserve;position: relative&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;监控状态&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; cid=&quot;n97&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;border: 1px solid rgb(231, 234, 237);border-radius: 3px;padding: 8px 4px 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;position: relative !important&quot;&gt;watch&amp;nbsp;-n&amp;nbsp;1&amp;nbsp;&amp;quot;sudo&amp;nbsp;docker&amp;nbsp;compose&amp;nbsp;exec&amp;nbsp;hbbs&amp;nbsp;hbbs&amp;nbsp;--status&amp;nbsp;||&amp;nbsp;./hbbs&amp;nbsp;--status&amp;quot;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p cid=&quot;n100&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box;line-height: inherit;orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;position: relative;color: rgb(51, 51, 51);font-family: &amp;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size: 16px&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 30 Jun 2025 00:35:39 +0800</pubDate></item><item><title>Centos7/麒麟V10升级ssh脚本</title><link>https://9527edu.org/post/221.html</link><description>&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;zlib下载地址&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;https://www.zlib.net/fossils/&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-family: sans-serif;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: sans-serif;&quot;&gt;OpenSSH&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;openssl&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;https://openssl-library.org/source/&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;脚本如下&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;vim&amp;nbsp;update_ssh.sh&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;脚本内容&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#!/bin/bash






#install&amp;nbsp;zlib&amp;nbsp;start&amp;nbsp;!!!!


lujing=$(pwd)


cd&amp;nbsp;$lujing


tar&amp;nbsp;-xf&amp;nbsp;zlib-1.3.1.tar.gz


cd&amp;nbsp;zlib-1.3.1


./configure&amp;nbsp;--prefix=/usr/local/zlib.1.3.1


make&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;make&amp;nbsp;test&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;make&amp;nbsp;install


ll&amp;nbsp;/usr/local/zlib.1.3.1/


ldconfig&amp;nbsp;-V


sleep&amp;nbsp;2


/sbin/ldconfig


sleep&amp;nbsp;2






#install&amp;nbsp;openssl&amp;nbsp;start&amp;nbsp;!!!


cd&amp;nbsp;$lujing


tar&amp;nbsp;zxf&amp;nbsp;openssl-3.2.0.tar.gz


cd&amp;nbsp;openssl-3.2.0


./config&amp;nbsp;--prefix=/usr/local/openssl-3.2.0&amp;nbsp;--openssldir=/usr/shared


make&amp;nbsp;clean&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;make&amp;nbsp;-j&amp;nbsp;4&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;make&amp;nbsp;install


#更新函数库


echo&amp;nbsp;&amp;quot;/usr/local/openssl-3.2.0/lib&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/ld.so.conf


ldconfig


sleep&amp;nbsp;3


bak_data=$(date&amp;nbsp;+&amp;quot;%Y%m%d&amp;quot;)


mv&amp;nbsp;/usr/bin/openssl&amp;nbsp;/usr/bin/openssl_${bak_data}.bak


ln&amp;nbsp;-s&amp;nbsp;/usr/local/openssl-3.2.0/bin/openssl&amp;nbsp;/usr/bin/openssl


ln&amp;nbsp;-s&amp;nbsp;/usr/local/openssl-3.2.0/lib64/libssl.so.3&amp;nbsp;/usr/lib64/libssl.so.3


ln&amp;nbsp;-s&amp;nbsp;/usr/local/openssl-3.2.0/lib64/libcrypto.so.3&amp;nbsp;/usr/lib64/libcrypto.so.3


openssl&amp;nbsp;version&amp;nbsp;-a&amp;nbsp;


sleep&amp;nbsp;3






#install&amp;nbsp;opensssh&amp;nbsp;start&amp;nbsp;!!


mkdir&amp;nbsp;~/ssh_openssh_${bak_data}_bak


cp&amp;nbsp;/etc/ssh/sshd_config&amp;nbsp;~/ssh_openssh_${bak_data}_bak


cp&amp;nbsp;/etc/pam.d/sshd&amp;nbsp;~/ssh_openssh_${bak_data}_bak


rpm&amp;nbsp;-e&amp;nbsp;--nodeps&amp;nbsp;`rpm&amp;nbsp;-qa&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;openssh`


#&amp;nbsp;安装OpenSSH


cd&amp;nbsp;$lujing


tar&amp;nbsp;-xf&amp;nbsp;openssh-9.7p1.tar.gz


cd&amp;nbsp;openssh-9.7p1


./configure&amp;nbsp;--prefix=/usr/local/ssh&amp;nbsp;--sysconfdir=/etc/ssh&amp;nbsp;--with-ssl-dir=/usr/local/openssl-3.2.0&amp;nbsp;--with-zlib=/usr/local/zlib.1.3.1


chmod&amp;nbsp;0600&amp;nbsp;/etc/ssh/ssh_host_rsa_key


chmod&amp;nbsp;0600&amp;nbsp;/etc/ssh/ssh_host_ecdsa_key


chmod&amp;nbsp;0600&amp;nbsp;/etc/ssh/ssh_host_ed25519_key


make&amp;nbsp;-j&amp;nbsp;4&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;make&amp;nbsp;install


/usr/local/ssh/bin/ssh&amp;nbsp;-V


#&amp;nbsp;复制新ssh文件


cp&amp;nbsp;-rf&amp;nbsp;contrib/redhat/sshd.init&amp;nbsp;/etc/init.d/sshd


cp&amp;nbsp;-rf&amp;nbsp;contrib/redhat/sshd.pam&amp;nbsp;/etc/pam.d/sshd.pam


cp&amp;nbsp;-rf&amp;nbsp;sshd_config&amp;nbsp;/etc/ssh/sshd_config


cp&amp;nbsp;-rf&amp;nbsp;/usr/local/ssh/sbin/sshd&amp;nbsp;/usr/sbin/sshd


cp&amp;nbsp;-rf&amp;nbsp;/usr/local/ssh/bin/*&amp;nbsp;/usr/bin/






#&amp;nbsp;开启sshd


cp&amp;nbsp;-rf&amp;nbsp;/usr/local/ssh/sbin/sshd&amp;nbsp;/usr/sbin/sshd


cp&amp;nbsp;-rf&amp;nbsp;/usr/local/ssh/bin/ssh&amp;nbsp;/usr/bin/ssh


cp&amp;nbsp;-rf&amp;nbsp;/usr/local/ssh/bin/ssh-keygen&amp;nbsp;/usr/bin/ssh-keygen


cp&amp;nbsp;{$bak_data}/openssh-9.6p1/contrib/ssh-copy-id&amp;nbsp;/bin/


chmod&amp;nbsp;0755&amp;nbsp;/bin/ssh-copy-id


chmod&amp;nbsp;u+x&amp;nbsp;/etc/init.d/sshd&amp;nbsp;


chkconfig&amp;nbsp;--add&amp;nbsp;sshd


chkconfig&amp;nbsp;--list&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;sshd


systemctl&amp;nbsp;daemon-reload


chkconfig&amp;nbsp;sshd&amp;nbsp;on


#&amp;nbsp;允许root登录


echo&amp;nbsp;&amp;quot;PermitRootLogin&amp;nbsp;yes&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/ssh/sshd_config


sed&amp;nbsp;-i&amp;nbsp;&amp;quot;/Subsystem/s/^/#&amp;nbsp;/&amp;quot;&amp;nbsp;&amp;quot;/etc/ssh/sshd_config&amp;quot;


echo&amp;nbsp;&amp;quot;Subsystem&amp;nbsp;sftp&amp;nbsp;/usr/local/ssh/libexec/sftp-server&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/ssh/sshd_config


#&amp;nbsp;添加加密算法


echo&amp;nbsp;&amp;quot;KexAlgorithms&amp;nbsp;curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/ssh/sshd_config


echo&amp;nbsp;&amp;quot;HostKeyAlgorithms&amp;nbsp;+ssh-rsa&amp;quot;&amp;nbsp;&amp;gt;&amp;gt;&amp;nbsp;/etc/ssh/sshd_config


#&amp;nbsp;重启sshd服务


/etc/init.d/sshd&amp;nbsp;restart


/etc/init.d/sshd&amp;nbsp;status


#&amp;nbsp;查看升级后ssh版本


ssh&amp;nbsp;-V&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 19 Feb 2025 01:03:33 +0800</pubDate></item><item><title>Rocky9同步dnf源到本地</title><link>https://9527edu.org/post/220.html</link><description>&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; font-size: 16px;&quot;&gt;在 Rocky Linux 9 上，你可以使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem; color: rgb(64, 64, 64); text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;dnf&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; font-size: 16px;&quot;&gt;&amp;nbsp;或&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem; color: rgb(64, 64, 64); text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;reposync&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; font-size: 16px;&quot;&gt;&amp;nbsp;工具将远程的 DNF 软件源同步到本地目录（如&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem; color: rgb(64, 64, 64); text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;/data&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; font-size: 16px;&quot;&gt;）。以下是具体步骤：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; font-size: 16px;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;方法 1：使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;reposync&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;工具&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;reposync&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;是&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;dnf&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;的一个工具，专门用于将远程仓库同步到本地。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;1. 安装&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;dnf-utils&lt;/span&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;如果尚未安装&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;dnf-utils&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;，先安装它：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;&amp;nbsp;dnf&amp;nbsp;install&amp;nbsp;dnf-utils&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;2. 创建本地目录&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;创建一个目录用于存储同步的软件包，例如&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;/data/repo&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;mkdir&amp;nbsp;-p&amp;nbsp;/data/repo&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;3. 同步仓库&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;reposync&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;将远程仓库同步到本地。假设你要同步&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;baseos&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;和&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;appstream&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;仓库：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;reposync&amp;nbsp;--download-metadata&amp;nbsp;--download-path=/data/repo&amp;nbsp;--repoid=baseos&amp;nbsp;--repoid=appstream&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;ul style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; padding-left: calc(var(--ds-md-zoom)*24px); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;--download-metadata&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：同时下载仓库元数据（如 repodata）。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;--download-path&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：指定本地存储路径。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;--repoid&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：指定要同步的仓库 ID。你可以通过&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;dnf repolist&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;查看所有仓库 ID。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;4. 创建本地仓库元数据&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;同步完成后，需要为本地仓库生成元数据：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;createrepo&amp;nbsp;/data/repo/baseos
createrepo&amp;nbsp;/data/repo/appstream&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; font-size: 16px;&quot;&gt;如果&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem; color: rgb(64, 64, 64); text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;createrepo&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; font-size: 16px;&quot;&gt;&amp;nbsp;未安装，可以通过以下命令安装：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;dnf&amp;nbsp;install&amp;nbsp;createrepo_c&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;方法 2：使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;dnf&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;直接下载 RPM 包&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;如果你只需要下载特定软件包而不是整个仓库，可以使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;dnf download&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;1. 创建本地目录&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;mkdir&amp;nbsp;-p&amp;nbsp;/data/rpms&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;2. 下载软件包&lt;/strong&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;例如，下载&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;nginx&lt;/code&gt;&amp;nbsp;和&amp;nbsp;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;httpd&lt;/code&gt;&amp;nbsp;的 RPM 包：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;dnf&amp;nbsp;download&amp;nbsp;--destdir=/data/rpms&amp;nbsp;nginx&amp;nbsp;httpd&lt;/pre&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;--destdir&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：指定下载的 RPM 包存储路径。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;hr style=&quot;height: 1px; margin: calc(var(--ds-md-zoom)*12px)0; background-image: ; background-position-x: ; background-position-y: ; background-size: ; background-repeat: ; background-attachment: ; background-origin: ; background-clip: ; border: none; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot;/&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;方法 3：使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;rsync&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;同步远程仓库&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;如果你有远程仓库的访问权限，可以直接使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;rsync&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;将远程仓库同步到本地。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;1. 安装&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;rsync&lt;/span&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;dnf&amp;nbsp;install&amp;nbsp;rsync&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;2. 同步远程仓库&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;假设远程仓库地址为&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;rsync://example.com/repo&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;，同步到本地&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;/data/repo&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;rsync&amp;nbsp;-avz&amp;nbsp;rsync://example.com/repo&amp;nbsp;/data/repo&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;ul style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; padding-left: calc(var(--ds-md-zoom)*24px); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;-a&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：归档模式，保留文件属性。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;-v&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：显示详细信息。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;-z&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;：压缩传输。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;验证同步结果&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;同步完成后，检查&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;/data&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;目录下的内容：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;ls&amp;nbsp;-l&amp;nbsp;/data/repo&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;如果同步的是完整仓库，确保&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;repodata&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;目录存在。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;hr style=&quot;height: 1px; margin: calc(var(--ds-md-zoom)*12px)0; background-image: ; background-position-x: ; background-position-y: ; background-size: ; background-repeat: ; background-attachment: ; background-origin: ; background-clip: ; border: none; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot;/&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;配置本地仓库&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;如果你希望将本地仓库作为 DNF 源使用，可以创建一个本地 repo 文件：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;1. 创建 repo 文件&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;vi&amp;nbsp;/etc/yum.repos.d/local.repo&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;2. 添加以下内容&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;[local-repo]
name=Local&amp;nbsp;Repository
baseurl=file:///data/repo
enabled=1
gpgcheck=0&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: 16.002px; line-height: var(--ds-md-line-height); margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;3. 清理缓存并测试&lt;/strong&gt;&lt;/span&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;dnf&amp;nbsp;clean&amp;nbsp;all
dnf&amp;nbsp;repolist&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 05 Feb 2025 14:44:21 +0800</pubDate></item><item><title>lvm扩容</title><link>https://9527edu.org/post/219.html</link><description>&lt;p style=&quot;font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;要将新增的120G硬盘用于扩容现有的LVM逻辑卷（LV）&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;现有的vg_data个lv_data9&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;查看命令看vg&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;vgdisplay
或vgs&lt;/pre&gt;&lt;p style=&quot;line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;查看pv命令&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;pvdisplay
或
pvs&lt;/pre&gt;&lt;p style=&quot;line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; text-wrap-mode: wrap;&quot;&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; text-wrap-mode: wrap;&quot;&gt;查看命令看lv&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;lvdisplay
或
lvs&lt;/pre&gt;&lt;p style=&quot;line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; text-wrap-mode: wrap;&quot;&gt;&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;你可以按照以下步骤操作：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;1. 确认新硬盘&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;首先，确认系统已识别新硬盘。使用&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;lsblk&lt;/code&gt;&amp;nbsp;或&amp;nbsp;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;fdisk -l&lt;/code&gt;&amp;nbsp;查看：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;lsblk&lt;/strong&gt;&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;或&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;fdisk&amp;nbsp;-l&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;假设新硬盘为&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;/dev/sdb&lt;/code&gt;。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;2. 创建物理卷（PV）&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;将新硬盘初始化为物理卷：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;pvcreate&amp;nbsp;/dev/sdb&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;3. 扩展卷组（VG）&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;将新物理卷加入现有卷组&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;vg_data&lt;/code&gt;：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;vgextend&amp;nbsp;vg_data&amp;nbsp;/dev/sdb&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;4. 扩展逻辑卷（LV）&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;扩展逻辑卷&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;lv_data&lt;/code&gt;，假设你想将全部120G用于扩容：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;lvextend&amp;nbsp;-l&amp;nbsp;+100%FREE&amp;nbsp;/dev/vg_data/lv_data&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;5. 调整文件系统&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;扩展文件系统以使用新增空间。根据文件系统类型选择命令：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; padding-left: calc(var(--ds-md-zoom)*24px); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 4px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height);&quot;&gt;&lt;strong&gt;ext4&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;resize2fs&amp;nbsp;/dev/vg_data/lv_data&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style=&quot;color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot;&gt;xfs&lt;/strong&gt;&lt;span style=&quot;color: #404040; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot;&gt;:&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;xfs_growfs&amp;nbsp;/dev/vg_data/lv_data&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;6. 验证&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;使用&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;df -h&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&amp;nbsp;查看文件系统大小，确认扩容成功：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;df&amp;nbsp;-h&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;font-weight: var(--ds-font-weight-strong); font-size: calc(var(--ds-md-zoom)*16px); line-height: 1.5; margin: calc(var(--ds-md-zoom)*16px)0 calc(var(--ds-md-zoom)*12px)0; color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;总结&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;ol start=&quot;1&quot; style=&quot;margin: calc(var(--ds-md-zoom)*12px)0; padding-left: calc(var(--ds-md-zoom)*24px); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16.002px; text-wrap-mode: wrap;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;确认新硬盘。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;创建物理卷：&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;pvcreate /dev/sdb&lt;/code&gt;。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;扩展卷组：&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;vgextend vg_data /dev/sdb&lt;/code&gt;。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;扩展逻辑卷：&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;lvextend -l +100%FREE /dev/vg_data/lv_data&lt;/code&gt;。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;调整文件系统：&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;resize2fs&lt;/code&gt;&amp;nbsp;或&amp;nbsp;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;xfs_growfs&lt;/code&gt;。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 0px; font-size: var(--ds-md-font-size); line-height: var(--ds-md-line-height); margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;验证：&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;df -h&lt;/code&gt;。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;font-size: 16.002px; line-height: var(--ds-md-line-height); color: rgb(64, 64, 64); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Noto Sans&amp;quot;, Ubuntu, Cantarell, &amp;quot;Helvetica Neue&amp;quot;, Oxygen, &amp;quot;Open Sans&amp;quot;, sans-serif; text-wrap-mode: wrap; margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;&lt;strong&gt;完成这些步骤后，你的&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;code style=&quot;font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;&quot;&gt;lv_data&lt;/code&gt;&amp;nbsp;逻辑卷将扩容120G。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 05 Feb 2025 14:08:33 +0800</pubDate></item><item><title>mysql create创建命令帮助</title><link>https://9527edu.org/post/218.html</link><description>&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;mysql&amp;gt;&amp;nbsp;help&amp;nbsp;create
Many&amp;nbsp;help&amp;nbsp;items&amp;nbsp;for&amp;nbsp;your&amp;nbsp;request&amp;nbsp;exist.
To&amp;nbsp;make&amp;nbsp;a&amp;nbsp;more&amp;nbsp;specific&amp;nbsp;request,&amp;nbsp;please&amp;nbsp;type&amp;nbsp;&amp;#39;help&amp;nbsp;&amp;lt;item&amp;gt;&amp;#39;,
where&amp;nbsp;&amp;lt;item&amp;gt;&amp;nbsp;is&amp;nbsp;one&amp;nbsp;of&amp;nbsp;the&amp;nbsp;following
topics:
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;DATABASE
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;EVENT
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;FUNCTION
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;FUNCTION&amp;nbsp;LOADABLE&amp;nbsp;FUNCTION
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;INDEX
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;LOGFILE&amp;nbsp;GROUP
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;PROCEDURE
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;SCHEMA
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;SERVER
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;TABLE
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;TABLESPACE
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;TRIGGER
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;USER
&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;VIEW
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW&amp;nbsp;CREATE&amp;nbsp;DATABASE
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW&amp;nbsp;CREATE&amp;nbsp;EVENT
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW&amp;nbsp;CREATE&amp;nbsp;FUNCTION
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW&amp;nbsp;CREATE&amp;nbsp;PROCEDURE
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW&amp;nbsp;CREATE&amp;nbsp;SCHEMA
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW&amp;nbsp;CREATE&amp;nbsp;TABLE
&amp;nbsp;&amp;nbsp;&amp;nbsp;SHOW&amp;nbsp;CREATE&amp;nbsp;USER
&amp;nbsp;&amp;nbsp;&amp;nbsp;SPATIAL&amp;nbsp;INDEXES&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 20 Dec 2024 14:52:16 +0800</pubDate></item></channel></rss>