<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Cheug's Blog</title><link>https://cheug.com/</link><description></description><item><title>mysql基于 Binlog 的主从复制平滑迁移</title><link>https://cheug.com/?id=325</link><description>&lt;h4 data-path-to-node=&quot;4&quot;&gt;第一步：配置旧库（主库）&lt;/h4&gt;&lt;p data-path-to-node=&quot;5&quot;&gt;旧库必须开启了 &lt;code data-path-to-node=&quot;5&quot; data-index-in-node=&quot;8&quot;&gt;binlog&lt;/code&gt;（二进制日志），这是同步数据的基石。&lt;/p&gt;&lt;p data-path-to-node=&quot;6,0,0&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.检查旧库配置 (&lt;code data-path-to-node=&quot;6,0,0&quot; data-index-in-node=&quot;8&quot;&gt;/etc/mysql/my.cnf&lt;/code&gt; 或 &lt;code data-path-to-node=&quot;6,0,0&quot; data-index-in-node=&quot;28&quot;&gt;/etc/mysql/mysql.conf.d/mysqld.cnf&lt;/code&gt;)，确保有以下参数：&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;code-block _nghost-ng-c1194707174=&quot;&quot; class=&quot;ng-tns-c1194707174-358 ng-star-inserted&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;code-block ng-tns-c1194707174-358 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_1ed9728e7ad6517a&amp;quot;,&amp;quot;c_985a0ec9d70303c1&amp;quot;,null,&amp;quot;rc_8e68a6850422dead&amp;quot;,null,null,&amp;quot;zh&amp;quot;,null,1,null,null,1,0]]&quot; data-hveid=&quot;0&quot; decode-data-ved=&quot;1&quot; data-ved=&quot;0CAAQhtANahgKEwjGvPeepPKSAxUAAAAAHQAAAAAQzgI&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c1194707174-358&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;animated-opacity ng-tns-c1194707174-358&quot;&gt;&lt;pre _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;prism-highlight prism-language-bash&quot;&gt;[mysqld]server-id&amp;nbsp;=&amp;nbsp;1
log_bin&amp;nbsp;=&amp;nbsp;/var/log/mysql/mysql-bin.log&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code-block&gt;&lt;/response-element&gt;&lt;p data-path-to-node=&quot;6,0,2&quot;&gt;&lt;em data-path-to-node=&quot;6,0,2&quot; data-index-in-node=&quot;0&quot;&gt;(如果修改了配置，需要重启旧库。如果已经开启了，则跳过重启)&lt;/em&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;6,1,0&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.在旧库上创建一个专门用于同步的账号：&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;code-block _nghost-ng-c1194707174=&quot;&quot; class=&quot;ng-tns-c1194707174-359 ng-star-inserted&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;code-block ng-tns-c1194707174-359 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_1ed9728e7ad6517a&amp;quot;,&amp;quot;c_985a0ec9d70303c1&amp;quot;,null,&amp;quot;rc_8e68a6850422dead&amp;quot;,null,null,&amp;quot;zh&amp;quot;,null,1,null,null,1,0]]&quot; data-hveid=&quot;0&quot; decode-data-ved=&quot;1&quot; data-ved=&quot;0CAAQhtANahgKEwjGvPeepPKSAxUAAAAAHQAAAAAQzwI&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c1194707174-359&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;animated-opacity ng-tns-c1194707174-359&quot;&gt;&lt;pre _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;prism-highlight prism-language-bash&quot;&gt;CREATE&amp;nbsp;USER&amp;nbsp;&amp;#39;repl_user&amp;#39;@&amp;#39;%&amp;#39;&amp;nbsp;IDENTIFIED&amp;nbsp;BY&amp;nbsp;&amp;#39;你的同步密码&amp;#39;;GRANT&amp;nbsp;REPLICATION&amp;nbsp;SLAVE&amp;nbsp;ON&amp;nbsp;*.*&amp;nbsp;TO&amp;nbsp;&amp;#39;repl_user&amp;#39;@&amp;#39;%&amp;#39;;
FLUSH&amp;nbsp;PRIVILEGES;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code-block&gt;&lt;/response-element&gt;&lt;h4 data-path-to-node=&quot;7&quot;&gt;第二步：获取旧库的“快照”和“位点”（关键）&lt;/h4&gt;&lt;p data-path-to-node=&quot;8&quot;&gt;我们需要导出一份旧库的当前数据，&lt;strong data-path-to-node=&quot;8&quot; data-index-in-node=&quot;16&quot;&gt;并且&lt;/strong&gt;记住导出这一瞬间，日志走到了哪个位置。&lt;/p&gt;&lt;p data-path-to-node=&quot;9&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.在旧库服务器上执行（替换密码和库名）：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;--single-transaction&amp;nbsp;保证导出时不锁表（不影响业务写入）
#&amp;nbsp;--master-data=2&amp;nbsp;会在导出的&amp;nbsp;SQL&amp;nbsp;文件里自动记录当时的&amp;nbsp;Binlog&amp;nbsp;文件名和位置
mysqldump&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--single-transaction&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--master-data=2&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--routines&amp;nbsp;--events&amp;nbsp;--triggers&amp;nbsp;\
&amp;nbsp;&amp;nbsp;--databases&amp;nbsp;sql1&amp;nbsp;sql2&amp;nbsp;&amp;gt;&amp;nbsp;/tmp/snapshot.sql&lt;/pre&gt;&lt;p&gt;导出完成后，打开 &lt;code data-path-to-node=&quot;11&quot; data-index-in-node=&quot;9&quot;&gt;head -n 30 /tmp/snapshot.sql | grep &amp;quot;CHANGE MASTER TO&amp;quot;&lt;/code&gt;，记下这两个值：&lt;/p&gt;&lt;p&gt;&lt;code data-path-to-node=&quot;11&quot; data-index-in-node=&quot;54&quot;&gt;-- CHANGE MASTER TO MASTER_LOG_FILE=&amp;#39;mysql-bin.000022&amp;#39;, MASTER_LOG_POS=175710;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code data-path-to-node=&quot;11&quot; data-index-in-node=&quot;54&quot;&gt;&amp;nbsp;&amp;nbsp;2.导出指定用户的权限文件&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#&amp;nbsp;请将&amp;nbsp;IN&amp;nbsp;(...)&amp;nbsp;括号里的用户名替换为你真正需要迁移的两个用户名
mysql&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;-B&amp;nbsp;-N&amp;nbsp;-e&amp;nbsp;\
&amp;quot;SELECT&amp;nbsp;CONCAT(&amp;#39;SHOW&amp;nbsp;CREATE&amp;nbsp;USER&amp;nbsp;\&amp;#39;&amp;#39;,&amp;nbsp;user,&amp;nbsp;&amp;#39;\&amp;#39;@\&amp;#39;&amp;#39;,&amp;nbsp;host,&amp;nbsp;&amp;#39;\&amp;#39;;&amp;nbsp;SHOW&amp;nbsp;GRANTS&amp;nbsp;FOR&amp;nbsp;\&amp;#39;&amp;#39;,&amp;nbsp;user,&amp;nbsp;&amp;#39;\&amp;#39;@\&amp;#39;&amp;#39;,&amp;nbsp;host,&amp;nbsp;&amp;#39;\&amp;#39;;&amp;#39;)&amp;nbsp;FROM&amp;nbsp;mysql.user&amp;nbsp;WHERE&amp;nbsp;user&amp;nbsp;IN&amp;nbsp;(&amp;#39;user1&amp;#39;,&amp;nbsp;&amp;#39;user2&amp;#39;);&amp;quot;&amp;nbsp;\
|&amp;nbsp;mysql&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;-B&amp;nbsp;-N&amp;nbsp;\
|&amp;nbsp;sed&amp;nbsp;&amp;#39;s/$/;/g&amp;#39;&amp;nbsp;&amp;gt;&amp;nbsp;/tmp/users.sql&lt;/pre&gt;&lt;p&gt;&lt;code data-path-to-node=&quot;11&quot; data-index-in-node=&quot;54&quot;&gt;&lt;/code&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;code data-path-to-node=&quot;11&quot; data-index-in-node=&quot;54&quot;&gt;&lt;/code&gt;&lt;/p&gt;&lt;h4 data-path-to-node=&quot;12&quot;&gt;第三步：配置新库并导入数据&lt;/h4&gt;&lt;p data-path-to-node=&quot;13,0,0&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.配置新库，&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;确保新库的&amp;nbsp;&lt;/span&gt;&lt;code data-path-to-node=&quot;13,0,0&quot; data-index-in-node=&quot;6&quot; style=&quot;text-wrap-mode: wrap;&quot;&gt;server-id&lt;/code&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&amp;nbsp;和旧库&lt;/span&gt;&lt;strong data-path-to-node=&quot;13,0,0&quot; data-index-in-node=&quot;19&quot; style=&quot;text-wrap-mode: wrap;&quot;&gt;不一样&lt;/strong&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;（比如设为 2）&lt;/span&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;code data-path-to-node=&quot;6,0,0&quot; data-index-in-node=&quot;8&quot; style=&quot;text-wrap-mode: wrap;&quot;&gt;/etc/mysql/my.cnf&lt;/code&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;&amp;nbsp;或&amp;nbsp;&lt;/span&gt;&lt;code data-path-to-node=&quot;6,0,0&quot; data-index-in-node=&quot;28&quot; style=&quot;text-wrap-mode: wrap;&quot;&gt;/etc/mysql/mysql.conf.d/mysqld.cnf&lt;/code&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;)&lt;/span&gt;：&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;code-block _nghost-ng-c1194707174=&quot;&quot; class=&quot;ng-tns-c1194707174-361 ng-star-inserted&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;code-block ng-tns-c1194707174-361 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_1ed9728e7ad6517a&amp;quot;,&amp;quot;c_985a0ec9d70303c1&amp;quot;,null,&amp;quot;rc_8e68a6850422dead&amp;quot;,null,null,&amp;quot;zh&amp;quot;,null,1,null,null,1,0]]&quot; data-hveid=&quot;0&quot; decode-data-ved=&quot;1&quot; data-ved=&quot;0CAAQhtANahgKEwjGvPeepPKSAxUAAAAAHQAAAAAQ0QI&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c1194707174-361&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;animated-opacity ng-tns-c1194707174-361&quot;&gt;&lt;pre _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;prism-highlight prism-language-bash&quot;&gt;[mysqld]
server-id&amp;nbsp;=&amp;nbsp;2
log_bin&amp;nbsp;=&amp;nbsp;/var/log/mysql/mysql-bin.log

#持久化
replicate-do-db&amp;nbsp;=&amp;nbsp;sql1
replicate-do-db&amp;nbsp;=&amp;nbsp;sql2&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code-block&gt;&lt;/response-element&gt;&lt;p data-path-to-node=&quot;13,1,0&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.重启新库生效。&lt;/p&gt;&lt;p data-path-to-node=&quot;13,2,0&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.把刚才旧库导出的用户权限文件和&lt;code data-path-to-node=&quot;13,2,0&quot; data-index-in-node=&quot;28&quot;&gt;数据&lt;/code&gt;导入到新库：&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;code-block _nghost-ng-c1194707174=&quot;&quot; class=&quot;ng-tns-c1194707174-362 ng-star-inserted&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;code-block ng-tns-c1194707174-362 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_1ed9728e7ad6517a&amp;quot;,&amp;quot;c_985a0ec9d70303c1&amp;quot;,null,&amp;quot;rc_8e68a6850422dead&amp;quot;,null,null,&amp;quot;zh&amp;quot;,null,1,null,null,1,0]]&quot; data-hveid=&quot;0&quot; decode-data-ved=&quot;1&quot; data-ved=&quot;0CAAQhtANahgKEwjGvPeepPKSAxUAAAAAHQAAAAAQ0gI&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c1194707174-362&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;animated-opacity ng-tns-c1194707174-362&quot;&gt;&lt;pre _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;prism-highlight prism-language-bash&quot;&gt;mysql&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;&amp;lt;&amp;nbsp;/tmp/users.sql

#&amp;nbsp;强制刷新权限，让账号立刻生效
#&amp;nbsp;mysql&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;-e&amp;nbsp;&amp;quot;FLUSH&amp;nbsp;PRIVILEGES;&amp;quot;

mysql&amp;nbsp;-u&amp;nbsp;root&amp;nbsp;-p&amp;nbsp;&amp;lt;&amp;nbsp;/tmp/snapshot.sql&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code-block&gt;&lt;/response-element&gt;&lt;h4 data-path-to-node=&quot;14&quot;&gt;第四步：开启同步，让新库同步旧库数据&lt;/h4&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.设置只同步指定的数据库&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;--&amp;nbsp;设置同步白名单（只同步这两个库，如果有其他库请继续用逗号隔开）
CHANGE&amp;nbsp;REPLICATION&amp;nbsp;FILTER&amp;nbsp;REPLICATE_DO_DB&amp;nbsp;=&amp;nbsp;(sql1,&amp;nbsp;sql2);&lt;/pre&gt;&lt;p data-path-to-node=&quot;15&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.登录到&lt;strong data-path-to-node=&quot;15&quot; data-index-in-node=&quot;3&quot;&gt;新库&lt;/strong&gt;的 MySQL 命令行，告诉它旧库在哪里，以及从哪个位置开始同步：&lt;/p&gt;&lt;p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;code-block _nghost-ng-c1194707174=&quot;&quot; class=&quot;ng-tns-c1194707174-363 ng-star-inserted&quot;&gt;&lt;/code-block&gt;&lt;/response-element&gt;&lt;/p&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;code-block ng-tns-c1194707174-363 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_1ed9728e7ad6517a&amp;quot;,&amp;quot;c_985a0ec9d70303c1&amp;quot;,null,&amp;quot;rc_8e68a6850422dead&amp;quot;,null,null,&amp;quot;zh&amp;quot;,null,1,null,null,1,0]]&quot; data-hveid=&quot;0&quot; decode-data-ved=&quot;1&quot; data-ved=&quot;0CAAQhtANahgKEwjGvPeepPKSAxUAAAAAHQAAAAAQ0wI&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c1194707174-363&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;animated-opacity ng-tns-c1194707174-363&quot;&gt;&lt;pre _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;prism-highlight prism-language-bash&quot;&gt;CHANGE&amp;nbsp;MASTER&amp;nbsp;TO
&amp;nbsp;&amp;nbsp;MASTER_HOST=&amp;#39;旧库的IP地址&amp;#39;,
&amp;nbsp;&amp;nbsp;MASTER_USER=&amp;#39;repl_user&amp;#39;,
&amp;nbsp;&amp;nbsp;MASTER_PASSWORD=&amp;#39;你的同步密码&amp;#39;,
&amp;nbsp;&amp;nbsp;MASTER_LOG_FILE=&amp;#39;刚才记下的文件名&amp;#39;,&amp;nbsp;&amp;nbsp;--&amp;nbsp;例如&amp;nbsp;&amp;#39;mysql-bin.000022&amp;#39;
&amp;nbsp;&amp;nbsp;MASTER_LOG_POS=刚才记下的数字;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--&amp;nbsp;例如&amp;nbsp;175710;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p data-path-to-node=&quot;17&quot;&gt;&amp;nbsp; &amp;nbsp; 3.开始同步&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;START&amp;nbsp;SLAVE;&lt;/pre&gt;&lt;p data-path-to-node=&quot;17&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4.检查同步状态：&lt;/p&gt;&lt;p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;code-block _nghost-ng-c1194707174=&quot;&quot; class=&quot;ng-tns-c1194707174-364 ng-star-inserted&quot;&gt;&lt;/code-block&gt;&lt;/response-element&gt;&lt;/p&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;code-block ng-tns-c1194707174-364 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_1ed9728e7ad6517a&amp;quot;,&amp;quot;c_985a0ec9d70303c1&amp;quot;,null,&amp;quot;rc_8e68a6850422dead&amp;quot;,null,null,&amp;quot;zh&amp;quot;,null,1,null,null,1,0]]&quot; data-hveid=&quot;0&quot; decode-data-ved=&quot;1&quot; data-ved=&quot;0CAAQhtANahgKEwjGvPeepPKSAxUAAAAAHQAAAAAQ1AI&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c1194707174-364&quot;&gt;&lt;div _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;animated-opacity ng-tns-c1194707174-364&quot;&gt;&lt;pre _ngcontent-ng-c1194707174=&quot;&quot; class=&quot;prism-highlight prism-language-bash&quot;&gt;SHOW&amp;nbsp;SLAVE&amp;nbsp;STATUS&amp;nbsp;\G&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;19&quot;&gt;如果 &lt;code data-path-to-node=&quot;19&quot; data-index-in-node=&quot;3&quot;&gt;Slave_IO_Running&lt;/code&gt; 和 &lt;code data-path-to-node=&quot;19&quot; data-index-in-node=&quot;22&quot;&gt;Slave_SQL_Running&lt;/code&gt; 都是 &lt;code data-path-to-node=&quot;19&quot; data-index-in-node=&quot;43&quot;&gt;Yes&lt;/code&gt;，说明同步成功了！
看 &lt;code data-path-to-node=&quot;19&quot; data-index-in-node=&quot;58&quot;&gt;Seconds_Behind_Master&lt;/code&gt; 这个值，等它变成 &lt;code data-path-to-node=&quot;19&quot; data-index-in-node=&quot;89&quot;&gt;0&lt;/code&gt;，就说明新库已经和旧库&lt;strong data-path-to-node=&quot;19&quot; data-index-in-node=&quot;101&quot;&gt;完全实时同步&lt;/strong&gt;了。&lt;/p&gt;&lt;h4 data-path-to-node=&quot;20&quot;&gt;第五步：业务切换（割接）&lt;/h4&gt;&lt;ol start=&quot;1&quot; data-path-to-node=&quot;22&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,0,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,0,0&quot; data-index-in-node=&quot;0&quot;&gt;停旧库写入&lt;/strong&gt;：把旧库设为只读 &lt;code data-path-to-node=&quot;22,0,0&quot; data-index-in-node=&quot;14&quot;&gt;SET GLOBAL read_only = 1;&lt;/code&gt;，或者直接把应用服务停掉。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,1,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,1,0&quot; data-index-in-node=&quot;0&quot;&gt;确认完全同步&lt;/strong&gt;：在新库上最后看一眼 &lt;code data-path-to-node=&quot;22,1,0&quot; data-index-in-node=&quot;17&quot;&gt;SHOW SLAVE STATUS \G;&lt;/code&gt;，确保 &lt;code data-path-to-node=&quot;22,1,0&quot; data-index-in-node=&quot;42&quot;&gt;Seconds_Behind_Master&lt;/code&gt; 为 0。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,2,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,2,0&quot; data-index-in-node=&quot;0&quot;&gt;新库解除主从关系&lt;/strong&gt;：在新库执行 &lt;code data-path-to-node=&quot;22,2,0&quot; data-index-in-node=&quot;15&quot;&gt;STOP SLAVE; RESET SLAVE ALL;&lt;/code&gt;，让新库变成独立的主库。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,3,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,3,0&quot; data-index-in-node=&quot;0&quot;&gt;修改代码配置&lt;/strong&gt;：把你的业务代码里的数据库 IP 改为&lt;strong data-path-to-node=&quot;22,3,0&quot; data-index-in-node=&quot;25&quot;&gt;新库 IP&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,4,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,4,0&quot; data-index-in-node=&quot;0&quot;&gt;启动业务&lt;/strong&gt;：大功告成，迁移过程对用户基本无感（只断开几秒钟）。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;code data-path-to-node=&quot;11&quot; data-index-in-node=&quot;54&quot;&gt;&lt;br/&gt;&lt;/code&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 24 Feb 2026 22:51:58 +0800</pubDate></item><item><title>Linux LVM 实战：系统盘扩容与 /var /home /opt 目录独立迁移指南</title><link>https://cheug.com/?id=324</link><description>&lt;h2 cid=&quot;n6&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;1. 背景描述&lt;/span&gt;&lt;/h2&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-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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;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;/&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;/var&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;/opt&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;/home&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;）从根目录剥离，挂载到独立的 LVM 逻辑卷上。&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-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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;ul cid=&quot;n11&quot; mdtype=&quot;list&quot; data-mark=&quot;-&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot; class=&quot; list-paddingleft-2&quot;&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;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;操作系统：EulerOS (基于 CentOS)&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n15&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;Swap&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;: 扩容至 64G&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n17&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;Root (/)&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;: 扩容至 100G&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n19&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;New /home&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;: 分配 200G&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n21&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;New /var&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;: 分配 50G&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p cid=&quot;n23&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;New /opt&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;: 分配 20G&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 cid=&quot;n24&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;⚠️ 风险警告&lt;/span&gt;&lt;/h2&gt;&lt;ol start=&quot;&quot; cid=&quot;n25&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot; class=&quot; list-paddingleft-2&quot;&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;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;n29&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;谨慎操作 /var&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;/var&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;h2 cid=&quot;n31&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;2. 准备阶段：识别磁盘与创建分区&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n33&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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 class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; cid=&quot;n34&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;lsblk&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;df &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-Th&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;假设新加的空间在 /dev/sda 上（例如云硬盘扩容后），我们需要先创建新分区纳管这部分空间。&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n36&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;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;/dev/sda&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;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n38&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;# 1. 创建新分区&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;fdisk /dev/sda&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&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;# n (新建) -&amp;gt; p (主分区) -&amp;gt; 回车 (默认号) -&amp;gt; 回车 (默认起始) -&amp;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;# t (修改类型) -&amp;gt; 8e (LVM)&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;# w (保存退出)&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; cm-zwsp=&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;# 2. 刷新分区表（如果提示重启，可先尝试此命令）&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;partprobe&lt;/span&gt;&lt;/pre&gt;&lt;h2 cid=&quot;n39&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;3. LVM 扩容基础：物理卷与卷组&lt;/span&gt;&lt;/h2&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.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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;将新分区加入现有的 LVM 卷组（VG）。&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n42&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;# 1. 创建物理卷 (PV)&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;# 假设新分区为 /dev/sda5&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;pvcreate /dev/sda5&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; cm-zwsp=&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;# 2. 查看当前卷组名称&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;vgs&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;# 假设卷组名为 bigcloud-vg&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; cm-zwsp=&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;# 3. 扩容卷组&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;vgextend bigcloud-vg /dev/sda5&lt;/span&gt;&lt;/pre&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;h2 cid=&quot;n44&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;4. 调整现有逻辑卷 (Root &amp;amp; Swap)&lt;/span&gt;&lt;/h2&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;white-space: pre-wrap;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;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;4.1 扩容 Swap (至 64G)&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n46&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;Swap 无法在线扩容，必须先关闭。&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n48&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;# 关闭 Swap&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;swapoff -a&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; cm-zwsp=&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;# 扩展逻辑卷 (L 表示指定具体大小)&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;lvextend -L 64G /dev/bigcloud-vg/swap&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; cm-zwsp=&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;# 重新格式化 (扩容后必须重做 mkswap)&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mkswap /dev/bigcloud-vg/swap&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; cm-zwsp=&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&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;swapon -a&lt;/span&gt;&lt;/pre&gt;&lt;h3 cid=&quot;n49&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;4.2 扩容 Root (至 100G)&lt;/span&gt;&lt;/h3&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-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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;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 class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n52&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;# 1. 扩展逻辑卷&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;lvextend -L 100G /dev/bigcloud-vg/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;&lt;span cm-text=&quot;&quot; cm-zwsp=&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;# 2. 刷新文件系统 (重点！)&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;br/&gt;df -T /&lt;br/&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;# 如果是 XFS (CentOS 7+, EulerOS):&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;xfs_growfs /&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; cm-zwsp=&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;# 如果是 EXT4:&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;resize2fs /dev/bigcloud-vg/root&lt;/span&gt;&lt;/pre&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;h2 cid=&quot;n54&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;5. 新建分区与数据迁移 (关键步骤)&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n55&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;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;/opt&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;/home&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;/var&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;/opt&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;h3 cid=&quot;n56&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;5.1 创建逻辑卷并格式化&lt;/span&gt;&lt;/h3&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n58&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;# 创建 LV&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;lvcreate -L 20G -n opt bigcloud-vg&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;lvcreate -L 200G -n home bigcloud-vg&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;lvcreate -L 50G -n var bigcloud-vg&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; cm-zwsp=&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;# 格式化 (推荐 XFS，如果是 ext4 请换成 mkfs.ext4)&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mkfs.xfs /dev/bigcloud-vg/opt&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mkfs.xfs /dev/bigcloud-vg/home&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mkfs.xfs /dev/bigcloud-vg/var&lt;/span&gt;&lt;/pre&gt;&lt;h3 cid=&quot;n59&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;#39;Open Sans&amp;#39;, &amp;#39;Clear Sans&amp;#39;, &amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;5.2 数据同步 (以 /opt 为例)&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n60&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;：挂载新盘到临时目录 -&amp;gt; 同步数据 -&amp;gt; 挂载新盘到正式目录。&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n62&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;# 1. 临时挂载&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mkdir /mnt/new_opt&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mount /dev/bigcloud-vg/opt /mnt/new_opt&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; cm-zwsp=&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;# 2. 同步数据 (使用 rsync 保持权限和属性)&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;rsync -av /opt/ /mnt/new_opt/&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; cm-zwsp=&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;# 3. 卸载临时挂载&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;umount /mnt/new_opt&lt;br/&gt;# 确认数据无误后，清空原目录&lt;br/&gt;# rm -rf /opt/* &lt;br/&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; cm-zwsp=&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;# 4. 正式挂载&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mount /dev/bigcloud-vg/opt /opt&lt;/span&gt;&lt;/pre&gt;&lt;blockquote cid=&quot;n63&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px;text-wrap-mode: wrap&quot;&gt;&lt;p cid=&quot;n64&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: 0px;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;/var&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt; 进行迁移时，建议进入单用户模式或停止 Docker、Database、Rsyslog 等服务，防止数据不一致。&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&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;h2 cid=&quot;n66&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;6. 进阶技巧：如何清理被挂载点“隐藏”的旧数据&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n67&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;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;/var&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;/var&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;rm&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;p cid=&quot;n68&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;strong&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;strong style=&quot;box-sizing: border-box&quot;&gt;解决方法：Bind Mount (绑定挂载)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n70&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;# 1. 将根目录绑定挂载到一个临时点&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;mkdir /mnt/old_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;mount --bind / /mnt/old_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;&lt;span cm-text=&quot;&quot; cm-zwsp=&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;# 2. 此时 /mnt/old_root/var 就是被隐藏的旧数据&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&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;rm -rf /mnt/old_root/var/*&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; cm-zwsp=&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;# 3. 如果遇到 &amp;quot;device or resource busy&amp;quot; (如 rpc_pipefs)&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&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; cm-zwsp=&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;# 4. 卸载&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;umount /mnt/old_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;rmdir /mnt/old_root&lt;/span&gt;&lt;/pre&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;h2 cid=&quot;n72&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;7. 最后一步：配置自动挂载&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n73&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;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;/etc/fstab&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;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n75&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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/fstab&lt;/pre&gt;&lt;p cid=&quot;n76&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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 class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n78&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;/dev/mapper/bigcloud--vg-opt &amp;nbsp; /opt &amp;nbsp; xfs &amp;nbsp;defaults &amp;nbsp;0 0&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;/dev/mapper/bigcloud--vg-home &amp;nbsp;/home &amp;nbsp;xfs &amp;nbsp;defaults &amp;nbsp;0 0&lt;/span&gt;&lt;br/&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;/dev/mapper/bigcloud--vg-var &amp;nbsp; /var &amp;nbsp; xfs &amp;nbsp;defaults &amp;nbsp;0 0&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n79&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;strong&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;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;&quot; cid=&quot;n81&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;mount -a&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&gt;&lt;/pre&gt;&lt;h2 cid=&quot;n82&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;break-after: avoid-page;break-inside: avoid;orphans: 4;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;position: relative;line-height: 1.225;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;8. 总结&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n83&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.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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;通过 LVM 我们可以灵活地管理 Linux 磁盘空间。本次操作难点在于&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;文件系统的刷新&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;xfs_growfs&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;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;使用 Bind Mount 技术安全清理被遮盖的旧数据&lt;/strong&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;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 28 Jan 2026 15:51:45 +0800</pubDate></item><item><title>Zabbix7.4实现钉钉告警-内置(JavaScript)脚本</title><link>https://cheug.com/?id=323</link><description>&lt;h3 data-path-to-node=&quot;3&quot;&gt;第一步：获取钉钉机器人 Webhook 地址&lt;/h3&gt;&lt;ol start=&quot;1&quot; data-path-to-node=&quot;4&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;4,0,0&quot;&gt;进入钉钉群 -&amp;gt; 智能群助手 -&amp;gt; 添加机器人 -&amp;gt; &lt;strong data-path-to-node=&quot;4,0,0&quot; data-index-in-node=&quot;27&quot;&gt;自定义&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;4,1,0&quot;&gt;安全设置建议勾选：&lt;strong data-path-to-node=&quot;4,1,0&quot; data-index-in-node=&quot;9&quot;&gt;加签&lt;/strong&gt;（本脚本支持）或 &lt;strong data-path-to-node=&quot;4,1,0&quot; data-index-in-node=&quot;20&quot;&gt;自定义关键词&lt;/strong&gt;（如：告警）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;4,2,0&quot;&gt;复制生成的 &lt;code data-path-to-node=&quot;4,2,0&quot; data-index-in-node=&quot;6&quot;&gt;Webhook URL&lt;/code&gt; 和 &lt;code data-path-to-node=&quot;4,2,0&quot; data-index-in-node=&quot;20&quot;&gt;Secret&lt;/code&gt;。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 data-path-to-node=&quot;6&quot;&gt;第二步：在 Zabbix 中创建 Webhook&lt;/h3&gt;&lt;ol start=&quot;1&quot; data-path-to-node=&quot;7&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;7,0,0&quot;&gt;登录 Zabbix，前往 &lt;strong data-path-to-node=&quot;7,0,0&quot; data-index-in-node=&quot;13&quot;&gt;告警 (Alerts) -&amp;gt; 媒介类型 (Media types)&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;7,1,0&quot;&gt;点击 &lt;strong data-path-to-node=&quot;7,1,0&quot; data-index-in-node=&quot;3&quot;&gt;创建媒介类型 (Create media type)&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;7,2,0&quot;&gt;&lt;strong data-path-to-node=&quot;7,2,0&quot; data-index-in-node=&quot;0&quot;&gt;名称 (Name)&lt;/strong&gt;: &lt;code data-path-to-node=&quot;7,2,0&quot; data-index-in-node=&quot;11&quot;&gt;DingDing Webhook&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;7,3,0&quot;&gt;&lt;strong data-path-to-node=&quot;7,3,0&quot; data-index-in-node=&quot;0&quot;&gt;类型 (Type)&lt;/strong&gt;: &lt;code data-path-to-node=&quot;7,3,0&quot; data-index-in-node=&quot;11&quot;&gt;Webhook&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;7,4,0&quot;&gt;&lt;strong data-path-to-node=&quot;7,4,0&quot; data-index-in-node=&quot;0&quot;&gt;参数 (Parameters)&lt;/strong&gt;：添加以下必需项：&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;table data-path-to-node=&quot;8&quot;&gt;&lt;thead style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;tr style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot; class=&quot;firstRow&quot;&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(239, 239, 239); border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;strong style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0); border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; margin-bottom: 0px !important; line-height: 1.15 !important;&quot;&gt;参数名&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(239, 239, 239); border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;strong style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0); border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; margin-bottom: 0px !important; line-height: 1.15 !important;&quot;&gt;值&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;tr style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,1,0,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;strong data-path-to-node=&quot;8,1,0,0&quot; data-index-in-node=&quot;0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;URL&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,1,1,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;(粘贴你的钉钉 Webhook 地址)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,2,0,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;strong data-path-to-node=&quot;8,2,0,0&quot; data-index-in-node=&quot;0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;Secret&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,2,1,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;(粘贴你的加签密钥)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,3,0,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;strong data-path-to-node=&quot;8,3,0,0&quot; data-index-in-node=&quot;0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;Subject&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,3,1,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;code data-path-to-node=&quot;8,3,1,0&quot; data-index-in-node=&quot;0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(233, 238, 246); border: 0px none rgb(68, 71, 70); inset: auto; clear: none; clip: auto; color: rgb(68, 71, 70); columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(68, 71, 70) none 0px; overlay: none; padding: 1px 6px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important;&quot;&gt;{ALERT.SUBJECT}&lt;/code&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,4,0,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;strong data-path-to-node=&quot;8,4,0,0&quot; data-index-in-node=&quot;0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none rgb(31, 31, 31); inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;Message&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border-color: initial; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(31, 31, 31) none 0px; overlay: none; padding: 8px 12px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;span data-path-to-node=&quot;8,4,1,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; border: 0px none #1F1F1F; inset: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: #000000; filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: #1F1F1F none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; line-height: 1.15 !important;&quot;&gt;&lt;code data-path-to-node=&quot;8,4,1,0&quot; data-index-in-node=&quot;0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(233, 238, 246); border: 0px none rgb(68, 71, 70); inset: auto; clear: none; clip: auto; color: rgb(68, 71, 70); columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; interactivity: auto; isolation: auto; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(68, 71, 70) none 0px; overlay: none; padding: 1px 6px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1; margin-top: 0px !important; font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important;&quot;&gt;{ALERT.MESSAGE}&lt;/code&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;strong data-path-to-node=&quot;9,0,0&quot; data-index-in-node=&quot;0&quot;&gt;脚本 (Script)&lt;/strong&gt;：粘贴以下代码：&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-javascript&quot;&gt;try&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;params&amp;nbsp;=&amp;nbsp;JSON.parse(value),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;req&amp;nbsp;=&amp;nbsp;new&amp;nbsp;HttpRequest(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;response,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sha256,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timestamp&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Date().getTime(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;url&amp;nbsp;=&amp;nbsp;params.URL;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;处理钉钉加签逻辑
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(params.Secret&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;params.Secret.length&amp;nbsp;&amp;gt;&amp;nbsp;0)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;stringToSign&amp;nbsp;=&amp;nbsp;timestamp&amp;nbsp;+&amp;nbsp;&amp;quot;\n&amp;quot;&amp;nbsp;+&amp;nbsp;params.Secret;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;sign&amp;nbsp;=&amp;nbsp;btoa(Zabbix.hmac(&amp;#39;sha256&amp;#39;,&amp;nbsp;params.Secret,&amp;nbsp;stringToSign));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;url&amp;nbsp;+=&amp;nbsp;&amp;#39;&amp;amp;timestamp=&amp;#39;&amp;nbsp;+&amp;nbsp;timestamp&amp;nbsp;+&amp;nbsp;&amp;#39;&amp;amp;sign=&amp;#39;&amp;nbsp;+&amp;nbsp;encodeURIComponent(sign);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;req.addHeader(&amp;#39;Content-Type:&amp;nbsp;application/json&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;组装钉钉&amp;nbsp;markdown&amp;nbsp;消息
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data&amp;nbsp;=&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;msgtype:&amp;nbsp;&amp;quot;markdown&amp;quot;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;markdown:&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;title:&amp;nbsp;params.Subject,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text:&amp;nbsp;&amp;quot;##&amp;nbsp;&amp;quot;&amp;nbsp;+&amp;nbsp;params.Subject&amp;nbsp;+&amp;nbsp;&amp;quot;\n&amp;quot;&amp;nbsp;+&amp;nbsp;params.Message
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;response&amp;nbsp;=&amp;nbsp;req.post(url,&amp;nbsp;JSON.stringify(data));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(req.getStatus()&amp;nbsp;!==&amp;nbsp;200)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&amp;nbsp;&amp;#39;Response&amp;nbsp;code:&amp;nbsp;&amp;#39;&amp;nbsp;+&amp;nbsp;req.getStatus();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;&amp;#39;OK&amp;#39;;
}&amp;nbsp;catch&amp;nbsp;(error)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zabbix.log(4,&amp;nbsp;&amp;#39;[DingDing&amp;nbsp;Webhook]&amp;nbsp;Error:&amp;nbsp;&amp;#39;&amp;nbsp;+&amp;nbsp;error);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&amp;nbsp;&amp;#39;Sending&amp;nbsp;failed:&amp;nbsp;&amp;#39;&amp;nbsp;+&amp;nbsp;error;
}&lt;/pre&gt;&lt;h3 data-path-to-node=&quot;12&quot;&gt;第三步：设置告警消息内容&lt;/h3&gt;&lt;p data-path-to-node=&quot;13&quot;&gt;在同一页面的 &lt;strong data-path-to-node=&quot;13&quot; data-index-in-node=&quot;7&quot;&gt;消息模板 (Message templates)&lt;/strong&gt; 标签页中，添加以下模板以确保钉钉显示美观。&lt;/p&gt;&lt;h4 data-path-to-node=&quot;14&quot;&gt;1. 问题 (Problem)&lt;/h4&gt;&lt;ul data-path-to-node=&quot;15&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;15,0,0&quot;&gt;&lt;strong data-path-to-node=&quot;15,0,0&quot; data-index-in-node=&quot;0&quot;&gt;主题&lt;/strong&gt;: &lt;code data-path-to-node=&quot;15,0,0&quot; data-index-in-node=&quot;4&quot;&gt;告警发现: {EVENT.NAME}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;15,1,0&quot;&gt;&lt;strong data-path-to-node=&quot;15,1,0&quot; data-index-in-node=&quot;0&quot;&gt;消息内容&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;**告警级别**:&amp;nbsp;{EVENT.SEVERITY}
**告警时间**:&amp;nbsp;{EVENT.DATE}&amp;nbsp;{EVENT.TIME}
**告警主机**:&amp;nbsp;{HOST.NAME}
**告警详情**:&amp;nbsp;{EVENT.NAME}
**当前状态**:&amp;nbsp;{EVENT.VALUE}
**事件&amp;nbsp;ID**:&amp;nbsp;{EVENT.ID}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 data-path-to-node=&quot;17&quot;&gt;2. 问题恢复 (Problem recovery)&lt;/h4&gt;&lt;ul data-path-to-node=&quot;18&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;18,0,0&quot;&gt;&lt;strong data-path-to-node=&quot;18,0,0&quot; data-index-in-node=&quot;0&quot;&gt;主题&lt;/strong&gt;: &lt;code data-path-to-node=&quot;18,0,0&quot; data-index-in-node=&quot;4&quot;&gt;告警恢复: {EVENT.NAME}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;18,1,0&quot;&gt;&lt;strong data-path-to-node=&quot;18,1,0&quot; data-index-in-node=&quot;0&quot;&gt;消息内容&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;**恢复时间**:&amp;nbsp;{EVENT.RECOVERY.DATE}&amp;nbsp;{EVENT.RECOVERY.TIME}
**告警主机**:&amp;nbsp;{HOST.NAME}
**持续时间**:&amp;nbsp;{EVENT.DURATION}
**当前状态**:&amp;nbsp;已恢复&lt;/pre&gt;&lt;h3 data-path-to-node=&quot;21&quot;&gt;第四步：关联用户与测试&lt;/h3&gt;&lt;ol start=&quot;1&quot; data-path-to-node=&quot;22&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,0,0&quot;&gt;前往 &lt;strong data-path-to-node=&quot;22,0,0&quot; data-index-in-node=&quot;3&quot;&gt;用户 (Users) -&amp;gt; 用户 (Users)&lt;/strong&gt;，选择一个管理员用户。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,1,0&quot;&gt;在 &lt;strong data-path-to-node=&quot;22,1,0&quot; data-index-in-node=&quot;2&quot;&gt;报警媒介 (Media)&lt;/strong&gt; 标签页中，点击添加：&lt;/p&gt;&lt;/li&gt;&lt;ul data-path-to-node=&quot;22,1,1&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,1,1,0,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,1,1,0,0&quot; data-index-in-node=&quot;0&quot;&gt;类型&lt;/strong&gt;: &lt;code data-path-to-node=&quot;22,1,1,0,0&quot; data-index-in-node=&quot;4&quot;&gt;DingDing Webhook&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,1,1,1,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,1,1,1,0&quot; data-index-in-node=&quot;0&quot;&gt;收件人&lt;/strong&gt;: &lt;code data-path-to-node=&quot;22,1,1,1,0&quot; data-index-in-node=&quot;5&quot;&gt;随便填（Webhook 模式下不生效，但必填）&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-path-to-node=&quot;22,1,1,1,0&quot;&gt;&lt;code data-path-to-node=&quot;22,1,1,1,0&quot; data-index-in-node=&quot;5&quot;&gt;&lt;/code&gt;&lt;/p&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;9&quot;&gt;前往 &lt;strong data-path-to-node=&quot;9&quot; data-index-in-node=&quot;3&quot;&gt;告警 (Alerts) -&amp;gt; 动作 (Actions) -&amp;gt; Trigger actions&lt;/strong&gt;：&lt;/p&gt;&lt;/li&gt;&lt;ol class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: lower-alpha;&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;10,0,0&quot;&gt;找到负责推送告警的动作（通常叫 &amp;quot;Report problems to admins&amp;quot;）启用。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;10,1,0&quot;&gt;在 &lt;strong data-path-to-node=&quot;10,1,0&quot; data-index-in-node=&quot;2&quot;&gt;操作 (Operations)&lt;/strong&gt; 标签页中，确认：&lt;/p&gt;&lt;/li&gt;&lt;ol class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: lower-roman;&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;10,1,1,0,0&quot;&gt;&lt;strong data-path-to-node=&quot;10,1,1,0,0&quot; data-index-in-node=&quot;0&quot;&gt;发送到用户 (Send to users)&lt;/strong&gt;：包含了你关联了钉钉媒介的那个用户。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;10,1,1,1,0&quot;&gt;&lt;strong data-path-to-node=&quot;10,1,1,1,0&quot; data-index-in-node=&quot;0&quot;&gt;仅送到 (Send only to)&lt;/strong&gt;：选择了 &lt;code data-path-to-node=&quot;10,1,1,1,0&quot; data-index-in-node=&quot;23&quot;&gt;DingDing Webhook&lt;/code&gt;（或者 &lt;code data-path-to-node=&quot;10,1,1,1,0&quot; data-index-in-node=&quot;43&quot;&gt;All&lt;/code&gt;）。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;22,2,0&quot;&gt;&lt;strong data-path-to-node=&quot;22,2,0&quot; data-index-in-node=&quot;0&quot;&gt;测试&lt;/strong&gt;：在媒介类型列表中，点击刚才创建的 DingDing Webhook 后方的 &lt;strong data-path-to-node=&quot;22,2,0&quot; data-index-in-node=&quot;41&quot;&gt;测试 (Test)&lt;/strong&gt;，输入你的 URL 和 Secret，查看钉钉群是否收到消息。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 25 Dec 2025 16:46:47 +0800</pubDate></item><item><title>CentOS7系统ansible离线rpm安装包与全部依赖</title><link>https://cheug.com/?id=322</link><description>&lt;p class=&quot;ue-upload&quot; style=&quot;line-height: 16px;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p class=&quot;ue-upload&quot; style=&quot;line-height: 16px;&quot;&gt;&lt;img style=&quot;vertical-align: middle; margin-right: 2px;&quot; src=&quot;https://cheug.com/zb_system/image/filetype/_blank.png&quot;/&gt;&lt;a style=&quot;font-size:12px; color:#0066cc;&quot; href=&quot;https://cheug.com/zb_users/upload/2025/12/202512091765248352751341.7z&quot; title=&quot;centos7-ansible.7z&quot;&gt;centos7-ansible.7z&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 09 Dec 2025 10:43:09 +0800</pubDate></item><item><title>debian安装mysql 5.7</title><link>https://cheug.com/?id=321</link><description>&lt;h4 cid=&quot;n15&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;第一步：准备工作 &amp;amp; 安装依赖&lt;/span&gt;&lt;/h4&gt;&lt;p cid=&quot;n17&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;MySQL 5.7 依赖 &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;libaio1&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;libmecab2&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;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; cid=&quot;n21&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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; 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 libaio1 libmecab2 psmisc&lt;/span&gt;&lt;/pre&gt;&lt;h4 cid=&quot;n28&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;第二步：下载 MySQL 5.7 安装包&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;&lt;a href=&quot;https://www.123865.com/s/oFDRjv-Yk27H&quot; target=&quot;_blank&quot; title=&quot;mysql-server_5.7.42-1debian10_amd64.deb-bundle.tar&quot;&gt;mysql-server_5.7.42-1debian10_amd64.deb-bundle.tar&lt;/a&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; cid=&quot;n34&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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: #AA5500&quot;&gt;# 下载 5.7.42 Bundle&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;wget&lt;/span&gt; https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.7.42-1debian10_amd64.deb-bundle.tar&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; cm-zwsp=&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;tar &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-xvf&lt;/span&gt; mysql-server_5.7.42-1debian10_amd64.deb-bundle.tar&lt;/span&gt;&lt;/pre&gt;&lt;h4 cid=&quot;n37&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;移除系统自带冲突包 (重要)&lt;/span&gt;&lt;/h4&gt;&lt;p cid=&quot;n39&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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size: 16px&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;Debian 12 可能自带了 &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;mariadb&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;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; cid=&quot;n41&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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; apt remove mariadb-server mariadb-client mysql-client mysql-server default-mysql-server default-mysql-client&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 autoremove&lt;/span&gt;&lt;/pre&gt;&lt;h4 cid=&quot;n44&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;按严格顺序安装&lt;/span&gt;&lt;/h4&gt;&lt;p cid=&quot;n46&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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;span md-inline=&quot;strong&quot; class=&quot;md-pair-s &quot; style=&quot;box-sizing: border-box&quot;&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 class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; cid=&quot;n48&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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 cm-text=&quot;&quot; cm-zwsp=&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;# 1. Common 组件&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;sudo&lt;/span&gt; dpkg &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-i&lt;/span&gt; mysql-common_5.7.42-1debian10_amd64.deb&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; cm-zwsp=&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;# 2. Client 相关 (可能涉及 libmysqlclient20)&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;sudo&lt;/span&gt; dpkg &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-i&lt;/span&gt; mysql-community-client_5.7.42-1debian10_amd64.deb mysql-client_5.7.42-1debian10_amd64.deb
sudo apt --fix-broken install -y&lt;br/&gt;&lt;br/&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; cm-zwsp=&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;# 3. 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: #AA5500&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 style=&quot;box-sizing: border-box;color: #3300AA&quot;&gt;sudo&lt;/span&gt; dpkg &lt;span style=&quot;box-sizing: border-box;color: #0000CC&quot;&gt;-i&lt;/span&gt; mysql-community-server_5.7.42-1debian10_amd64.deb mysql-server_5.7.42-1debian10_amd64.deb&lt;/span&gt;&lt;/pre&gt;&lt;h4 cid=&quot;n52&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;救火命令&lt;/span&gt;&lt;/h4&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: 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, &amp;#39;Segoe UI Emoji&amp;#39;, 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;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;dependency problems&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;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; cid=&quot;n56&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;apt&amp;nbsp;-f&amp;nbsp;install&lt;/pre&gt;&lt;h4 cid=&quot;n60&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box;white-space: pre-wrap;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;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, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box&quot;&gt;检查服务状态&lt;/span&gt;&lt;/h4&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; cid=&quot;n64&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box;overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;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;systemctl&amp;nbsp;status&amp;nbsp;mysql&lt;/pre&gt;&lt;p&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box;padding-right: 0.1px&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 20 Nov 2025 10:24:55 +0800</pubDate></item><item><title>ThinkPHP5.0自定义路由检测路径问题诊断脚本</title><link>https://cheug.com/?id=320</link><description>&lt;h3 data-start=&quot;72&quot; data-end=&quot;83&quot;&gt;功能说明&lt;/h3&gt;&lt;ol data-start=&quot;85&quot; data-end=&quot;293&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p data-start=&quot;88&quot; data-end=&quot;108&quot;&gt;自动检测当前 ThinkPHP 版本&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-start=&quot;112&quot; data-end=&quot;171&quot;&gt;检查 &lt;code data-start=&quot;115&quot; data-end=&quot;139&quot;&gt;application/config.php&lt;/code&gt; 中是否正确设置 &lt;code data-start=&quot;148&quot; data-end=&quot;169&quot;&gt;&amp;#39;route_config_file&amp;#39;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-start=&quot;175&quot; data-end=&quot;212&quot;&gt;检查 &lt;code data-start=&quot;178&quot; data-end=&quot;202&quot;&gt;/application/route.php&lt;/code&gt; 是否存在、可读&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-start=&quot;216&quot; data-end=&quot;229&quot;&gt;检查文件是否被加载执行&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-start=&quot;233&quot; data-end=&quot;253&quot;&gt;打印系统已注册路由（最多 30 条）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-start=&quot;257&quot; data-end=&quot;274&quot;&gt;判断 &lt;code data-start=&quot;260&quot; data-end=&quot;267&quot;&gt;test1&lt;/code&gt; 是否存在&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-start=&quot;278&quot; data-end=&quot;293&quot;&gt;输出详细诊断结果和修复建议&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr data-start=&quot;295&quot; data-end=&quot;298&quot;/&gt;&lt;h3 data-start=&quot;300&quot; data-end=&quot;310&quot;&gt;保存路径&lt;/h3&gt;&lt;p data-start=&quot;312&quot; data-end=&quot;316&quot;&gt;文件名：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot; data-start=&quot;317&quot; data-end=&quot;365&quot;&gt;/application/command/CheckRouteSmart.php&lt;/pre&gt;&lt;hr data-start=&quot;367&quot; data-end=&quot;370&quot;/&gt;&lt;h3 data-start=&quot;372&quot; data-end=&quot;382&quot;&gt;完整代码&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-php&quot; data-start=&quot;384&quot; data-end=&quot;4743&quot;&gt;&amp;lt;?php
namespace&amp;nbsp;app\command;

use&amp;nbsp;think\console\Command;
use&amp;nbsp;think\console\Input;
use&amp;nbsp;think\console\Output;

class&amp;nbsp;CheckRouteSmart&amp;nbsp;extends&amp;nbsp;Command
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected&amp;nbsp;function&amp;nbsp;configure()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;setName(&amp;#39;check:route-smart&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;gt;setDescription(&amp;#39;ThinkPHP&amp;nbsp;5.0&amp;nbsp;路由检测&amp;nbsp;+&amp;nbsp;路径问题诊断&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected&amp;nbsp;function&amp;nbsp;execute(Input&amp;nbsp;$input,&amp;nbsp;Output&amp;nbsp;$output)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;==========&amp;nbsp;ThinkPHP&amp;nbsp;路由诊断工具&amp;nbsp;==========\n&amp;quot;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检查框架版本
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$versionFile&amp;nbsp;=&amp;nbsp;THINK_PATH&amp;nbsp;.&amp;nbsp;&amp;#39;base.php&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$version&amp;nbsp;=&amp;nbsp;&amp;#39;未知&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(file_exists($versionFile))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$content&amp;nbsp;=&amp;nbsp;file_get_contents($versionFile);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(preg_match(&amp;#39;/define\([\&amp;#39;&amp;quot;]THINK_VERSION[\&amp;#39;&amp;quot;],\s*[\&amp;#39;&amp;quot;](.+?)[\&amp;#39;&amp;quot;]\)/&amp;#39;,&amp;nbsp;$content,&amp;nbsp;$m))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$version&amp;nbsp;=&amp;nbsp;$m[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;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;&amp;nbsp;检测到&amp;nbsp;ThinkPHP&amp;nbsp;版本:&amp;nbsp;{$version}\n&amp;quot;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检查路由配置文件路径
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$configFile&amp;nbsp;=&amp;nbsp;APP_PATH&amp;nbsp;.&amp;nbsp;&amp;#39;config.php&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(!file_exists($configFile))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;未找到配置文件:&amp;nbsp;{$configFile}&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$config&amp;nbsp;=&amp;nbsp;include&amp;nbsp;$configFile;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$routeFiles&amp;nbsp;=&amp;nbsp;isset($config[&amp;#39;route_config_file&amp;#39;])&amp;nbsp;?&amp;nbsp;$config[&amp;#39;route_config_file&amp;#39;]&amp;nbsp;:&amp;nbsp;[&amp;#39;route&amp;#39;];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;&amp;nbsp;当前配置的路由文件:&amp;nbsp;&amp;quot;&amp;nbsp;.&amp;nbsp;json_encode($routeFiles)&amp;nbsp;.&amp;nbsp;&amp;quot;\n&amp;quot;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检查路由文件是否存在
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$foundFiles&amp;nbsp;=&amp;nbsp;[];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;($routeFiles&amp;nbsp;as&amp;nbsp;$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;&amp;nbsp;$path&amp;nbsp;=&amp;nbsp;APP_PATH&amp;nbsp;.&amp;nbsp;$name&amp;nbsp;.&amp;nbsp;&amp;#39;.php&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;if&amp;nbsp;(file_exists($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;&amp;nbsp;&amp;nbsp;$foundFiles[]&amp;nbsp;=&amp;nbsp;$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;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;找到路由文件:&amp;nbsp;{$path}&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;&amp;nbsp;未找到路由文件:&amp;nbsp;{$path}&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($foundFiles))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;\n没有任何路由文件存在，请在&amp;nbsp;application&amp;nbsp;目录创建&amp;nbsp;route.php。&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检查路由文件是否被加载
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;\n&amp;nbsp;检查路由文件是否被加载...&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$markerFile&amp;nbsp;=&amp;nbsp;RUNTIME_PATH&amp;nbsp;.&amp;nbsp;&amp;#39;route_marker.txt&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@unlink($markerFile);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;($foundFiles&amp;nbsp;as&amp;nbsp;$f)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$append&amp;nbsp;=&amp;nbsp;&amp;quot;\nif&amp;nbsp;(!file_exists(&amp;#39;{$markerFile}&amp;#39;))&amp;nbsp;file_put_contents(&amp;#39;{$markerFile}&amp;#39;,&amp;nbsp;basename(__FILE__),&amp;nbsp;FILE_APPEND);&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$content&amp;nbsp;=&amp;nbsp;file_get_contents($f);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(strpos($content,&amp;nbsp;&amp;#39;route_marker.txt&amp;#39;)&amp;nbsp;===&amp;nbsp;false)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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_put_contents($f,&amp;nbsp;$append,&amp;nbsp;FILE_APPEND);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;直接&amp;nbsp;include&amp;nbsp;路由文件以触发加载，不加载&amp;nbsp;index.php
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;include_once&amp;nbsp;$f;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sleep(1);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(file_exists($markerFile))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;route.php&amp;nbsp;已被执行加载。&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;unlink($markerFile);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;route.php&amp;nbsp;未执行，可能路径或配置错误。&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;请检查&amp;nbsp;config.php&amp;nbsp;中的&amp;nbsp;&amp;#39;route_config_file&amp;#39;&amp;nbsp;设置是否为&amp;nbsp;[&amp;#39;route&amp;#39;]。\n&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;获取当前所有注册路由
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;\n当前已注册的路由（最多显示30条）：&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$ref&amp;nbsp;=&amp;nbsp;new&amp;nbsp;\ReflectionClass(&amp;#39;think\\Route&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$routes&amp;nbsp;=&amp;nbsp;[];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;([&amp;#39;rules&amp;#39;,&amp;nbsp;&amp;#39;name&amp;#39;]&amp;nbsp;as&amp;nbsp;$propName)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;($ref-&amp;gt;hasProperty($propName))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$p&amp;nbsp;=&amp;nbsp;$ref-&amp;gt;getProperty($propName);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$p-&amp;gt;setAccessible(true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$routes[$propName]&amp;nbsp;=&amp;nbsp;$p-&amp;gt;getValue();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$count&amp;nbsp;=&amp;nbsp;0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;($routes[&amp;#39;rules&amp;#39;]&amp;nbsp;as&amp;nbsp;$method&amp;nbsp;=&amp;gt;&amp;nbsp;$list)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;($list&amp;nbsp;as&amp;nbsp;$rule&amp;nbsp;=&amp;gt;&amp;nbsp;$value)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$target&amp;nbsp;=&amp;nbsp;is_array($value)&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;isset($value[&amp;#39;route&amp;#39;])&amp;nbsp;?&amp;nbsp;$value[&amp;#39;route&amp;#39;]&amp;nbsp;:&amp;nbsp;json_encode($value);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(sprintf(&amp;quot;&amp;nbsp;[%s]&amp;nbsp;%s&amp;nbsp;=&amp;gt;&amp;nbsp;%s&amp;quot;,&amp;nbsp;strtoupper($method),&amp;nbsp;$rule,&amp;nbsp;$target));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(++$count&amp;nbsp;&amp;gt;=&amp;nbsp;30)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;&amp;nbsp;...&amp;nbsp;(仅显示前30条)\n&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break&amp;nbsp;2;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检查&amp;nbsp;test1&amp;nbsp;是否存在
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$target&amp;nbsp;=&amp;nbsp;&amp;#39;test1&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$exists&amp;nbsp;=&amp;nbsp;false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;($routes[&amp;#39;rules&amp;#39;]&amp;nbsp;as&amp;nbsp;$method&amp;nbsp;=&amp;gt;&amp;nbsp;$rules)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(isset($rules[$target]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$exists&amp;nbsp;=&amp;nbsp;true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;\n==========&amp;nbsp;检测结果&amp;nbsp;==========&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;($exists)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;路由&amp;nbsp;&amp;#39;{$target}&amp;#39;&amp;nbsp;已定义，对应控制器：tool/test1&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;未检测到路由&amp;nbsp;&amp;#39;{$target}&amp;#39;。&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;请检查&amp;nbsp;route.php&amp;nbsp;是否存在以下定义：&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;Route::get([&amp;#39;test1&amp;#39;&amp;nbsp;=&amp;gt;&amp;nbsp;&amp;#39;tool/test1&amp;#39;]);&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$output-&amp;gt;writeln(&amp;quot;\n检测完成。\n&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}&lt;/pre&gt;&lt;hr data-start=&quot;4745&quot; data-end=&quot;4748&quot;/&gt;&lt;h3 data-start=&quot;4750&quot; data-end=&quot;4760&quot;&gt;注册命令&lt;/h3&gt;&lt;p data-start=&quot;4762&quot; data-end=&quot;4795&quot;&gt;在 &lt;code data-start=&quot;4764&quot; data-end=&quot;4790&quot;&gt;/application/command.php&lt;/code&gt; 中添加：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-php&quot; data-start=&quot;4796&quot; data-end=&quot;4859&quot;&gt;&amp;lt;?php
return&amp;nbsp;[&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;app\command\CheckRouteSmart&amp;#39;,
];&lt;/pre&gt;&lt;hr data-start=&quot;4861&quot; data-end=&quot;4864&quot;/&gt;&lt;h3 data-start=&quot;4866&quot; data-end=&quot;4876&quot;&gt;使用方法&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot; data-start=&quot;4886&quot; data-end=&quot;4955&quot;&gt;php&amp;nbsp;think&amp;nbsp;check:route-smart&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 03 Nov 2025 14:42:20 +0800</pubDate></item><item><title>Linux 删除指定网卡路由</title><link>https://cheug.com/?id=319</link><description>&lt;p&gt;删除指定路由&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;ip&amp;nbsp;route&amp;nbsp;del&amp;nbsp;10.142.5.128/26&amp;nbsp;via&amp;nbsp;10.142.86.1&amp;nbsp;dev&amp;nbsp;bond0

#ip&amp;nbsp;r&amp;nbsp;d&amp;nbsp;10.142.86.1/255.255.255.255&amp;nbsp;via&amp;nbsp;0.0.0.0&amp;nbsp;dev&amp;nbsp;bond0&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;https://cheug.com/zb_users/upload/2025/09/202509251758768598333302.png&quot; alt=&quot;4ddba2b7-f470-4822-8f70-edf105c76df1.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;删除默认路由&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;ip&amp;nbsp;route&amp;nbsp;del&amp;nbsp;default&amp;nbsp;via&amp;nbsp;10.142.86.1&amp;nbsp;dev&amp;nbsp;bond0&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 25 Sep 2025 10:48:25 +0800</pubDate></item><item><title>swap检查脚本</title><link>https://cheug.com/?id=318</link><description>&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;#!/bin/bash
#&amp;nbsp;检查&amp;nbsp;Swap&amp;nbsp;使用及回收原因
#&amp;nbsp;Author:&amp;nbsp;Cheug
#&amp;nbsp;用法:&amp;nbsp;bash&amp;nbsp;swap_check.sh

echo&amp;nbsp;&amp;quot;===&amp;nbsp;1.&amp;nbsp;当前内存和Swap使用情况&amp;nbsp;===&amp;quot;
free&amp;nbsp;-m
echo&amp;nbsp;&amp;quot;-------------------------------&amp;quot;
grep&amp;nbsp;-E&amp;nbsp;&amp;#39;Mem|Swap&amp;#39;&amp;nbsp;/proc/meminfo

echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n===&amp;nbsp;2.&amp;nbsp;查看&amp;nbsp;Swapiness&amp;nbsp;参数(0-100，越低越不易使用swap)&amp;nbsp;===&amp;quot;
sysctl&amp;nbsp;vm.swappiness

echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n===&amp;nbsp;3.&amp;nbsp;查看是否有swap分区或文件&amp;nbsp;===&amp;quot;
swapon&amp;nbsp;--show

echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n===&amp;nbsp;4.&amp;nbsp;检查内核版本(低版本内核在回收swap上有差异)&amp;nbsp;===&amp;quot;
uname&amp;nbsp;-r

echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n===&amp;nbsp;5.&amp;nbsp;检查是否有长时间占用swap的进程&amp;nbsp;===&amp;quot;
if&amp;nbsp;command&amp;nbsp;-v&amp;nbsp;smem&amp;nbsp;&amp;amp;&amp;gt;/dev/null;&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;smem&amp;nbsp;-rs&amp;nbsp;swap&amp;nbsp;|&amp;nbsp;head&amp;nbsp;-n&amp;nbsp;20
else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;(提示:&amp;nbsp;smem&amp;nbsp;未安装,&amp;nbsp;使用&amp;nbsp;ps&amp;nbsp;+&amp;nbsp;grep&amp;nbsp;VmSwap&amp;nbsp;方式)&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;pid&amp;nbsp;in&amp;nbsp;$(ls&amp;nbsp;/proc&amp;nbsp;|&amp;nbsp;grep&amp;nbsp;&amp;#39;^[0-9]&amp;#39;);&amp;nbsp;do
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;[&amp;nbsp;-r&amp;nbsp;/proc/$pid/status&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;swap_kb=$(grep&amp;nbsp;VmSwap&amp;nbsp;/proc/$pid/status&amp;nbsp;|&amp;nbsp;awk&amp;nbsp;&amp;#39;{print&amp;nbsp;$2}&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;if&amp;nbsp;[&amp;nbsp;&amp;quot;$swap_kb&amp;quot;&amp;nbsp;!=&amp;nbsp;&amp;quot;&amp;quot;&amp;nbsp;]&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;[&amp;nbsp;&amp;quot;$swap_kb&amp;quot;&amp;nbsp;-gt&amp;nbsp;0&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cmd=$(tr&amp;nbsp;-d&amp;nbsp;&amp;#39;\0&amp;#39;&amp;nbsp;&amp;lt;&amp;nbsp;/proc/$pid/cmdline&amp;nbsp;|&amp;nbsp;cut&amp;nbsp;-c1-50)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf&amp;nbsp;&amp;quot;%-10s&amp;nbsp;%-10s&amp;nbsp;%s\n&amp;quot;&amp;nbsp;&amp;quot;$pid&amp;quot;&amp;nbsp;&amp;quot;${swap_kb}&amp;nbsp;KB&amp;quot;&amp;nbsp;&amp;quot;$cmd&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;done&amp;nbsp;|&amp;nbsp;sort&amp;nbsp;-k2&amp;nbsp;-n&amp;nbsp;-r&amp;nbsp;|&amp;nbsp;head&amp;nbsp;-n&amp;nbsp;20
fi

echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n===&amp;nbsp;6.&amp;nbsp;检查内存碎片信息&amp;nbsp;===&amp;quot;
grep&amp;nbsp;-A5&amp;nbsp;&amp;quot;Node&amp;nbsp;0&amp;quot;&amp;nbsp;/proc/buddyinfo

echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n===&amp;nbsp;7.&amp;nbsp;检查内存是否足够回收swap&amp;nbsp;===&amp;quot;
avail=$(grep&amp;nbsp;MemAvailable&amp;nbsp;/proc/meminfo&amp;nbsp;|&amp;nbsp;awk&amp;nbsp;&amp;#39;{print&amp;nbsp;$2}&amp;#39;)
total_swap=$(grep&amp;nbsp;SwapTotal&amp;nbsp;/proc/meminfo&amp;nbsp;|&amp;nbsp;awk&amp;nbsp;&amp;#39;{print&amp;nbsp;$2}&amp;#39;)
used_swap=$(grep&amp;nbsp;SwapFree&amp;nbsp;/proc/meminfo&amp;nbsp;|&amp;nbsp;awk&amp;nbsp;&amp;#39;{print&amp;nbsp;$2}&amp;#39;)
echo&amp;nbsp;&amp;quot;可用内存:&amp;nbsp;$((avail/1024))&amp;nbsp;MB&amp;quot;
echo&amp;nbsp;&amp;quot;Swap总量:&amp;nbsp;$((total_swap/1024))&amp;nbsp;MB,&amp;nbsp;已使用:&amp;nbsp;$(((total_swap-used_swap)/1024))&amp;nbsp;MB&amp;quot;

echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n===&amp;nbsp;8.&amp;nbsp;如果想手动回收swap，可以执行&amp;nbsp;===&amp;quot;
echo&amp;nbsp;&amp;quot;sync&amp;nbsp;#同步数据到磁盘，防止数据丢失&amp;quot;
echo&amp;nbsp;&amp;quot;swapoff&amp;nbsp;-a&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;swapon&amp;nbsp;-a&amp;nbsp;&amp;nbsp;#闭swap再开启swap&amp;quot;

echo&amp;nbsp;&amp;quot;=====&amp;nbsp;分析提示&amp;nbsp;=====&amp;quot;

swap_used_kb=$(grep&amp;nbsp;SwapTotal&amp;nbsp;/proc/meminfo&amp;nbsp;|&amp;nbsp;awk&amp;nbsp;&amp;#39;{print&amp;nbsp;$2}&amp;#39;)
swap_free_kb=$(grep&amp;nbsp;SwapFree&amp;nbsp;/proc/meminfo&amp;nbsp;|&amp;nbsp;awk&amp;nbsp;&amp;#39;{print&amp;nbsp;$2}&amp;#39;)
swap_used_now=$((swap_used_kb&amp;nbsp;-&amp;nbsp;swap_free_kb))

if&amp;nbsp;[&amp;nbsp;&amp;quot;$swap_used_now&amp;quot;&amp;nbsp;-ne&amp;nbsp;0&amp;nbsp;];&amp;nbsp;then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;-e&amp;nbsp;&amp;quot;\n[警告]&amp;nbsp;Swap&amp;nbsp;仍然有&amp;nbsp;${swap_used_now}&amp;nbsp;KB&amp;nbsp;未释放.&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;[可能原因]&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;&amp;nbsp;1.&amp;nbsp;某些进程锁定了内存页（mlock），导致&amp;nbsp;swap&amp;nbsp;无法回收&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;&amp;nbsp;2.&amp;nbsp;系统中某些&amp;nbsp;swap&amp;nbsp;分区或文件未被正确关闭&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;&amp;nbsp;3.&amp;nbsp;有内核线程占用&amp;nbsp;swap&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;&amp;nbsp;4.&amp;nbsp;适当调低&amp;nbsp;vm.swappiness，可减少&amp;nbsp;swap&amp;nbsp;使用&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;&amp;nbsp;5.&amp;nbsp;如果&amp;nbsp;swapoff&amp;nbsp;无法执行，可能内存不足或进程锁定页面&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&amp;quot;&amp;nbsp;6.&amp;nbsp;如果&amp;nbsp;swap&amp;nbsp;使用量不变，可能是内存碎片或内核&amp;nbsp;bug&amp;quot;
fi&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 11 Aug 2025 10:40:41 +0800</pubDate></item><item><title>iptables防火墙已添加放行规则还是无法访问</title><link>https://cheug.com/?id=317</link><description>&lt;p&gt;问题：iptables防火墙已添加放行规则还是无法访问&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;Chain&amp;nbsp;INPUT&amp;nbsp;(policy&amp;nbsp;ACCEPT)
target&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;prot&amp;nbsp;opt&amp;nbsp;source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.131.168.0/24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/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;tcp&amp;nbsp;dpt:22
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.143.115&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/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;tcp&amp;nbsp;dpt:18100
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.143.116&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/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;tcp&amp;nbsp;dpt:18100
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.143.115&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/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;tcp&amp;nbsp;dpt:28889
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.143.116&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/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;tcp&amp;nbsp;dpt:28889
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.143.115&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/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;tcp&amp;nbsp;dpt:28890
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.143.116&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/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;tcp&amp;nbsp;dpt:28890
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.175.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/0
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.172.33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/0
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.175.13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/0
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.140.196&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/0
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.131.121.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/0
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;10.206.172.42&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0.0.0/0
ACCEPT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tcp&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;0.0.0.0/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;0.0.0.0/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;source&amp;nbsp;IP&amp;nbsp;range&amp;nbsp;10.206.138.48-10.206.138.51&amp;nbsp;tcp&amp;nbsp;dpt:22
DROP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;all&amp;nbsp;&amp;nbsp;--&amp;nbsp;&amp;nbsp;0.0.0.0/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;0.0.0.0/0

Chain&amp;nbsp;FORWARD&amp;nbsp;(policy&amp;nbsp;ACCEPT)
target&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;prot&amp;nbsp;opt&amp;nbsp;source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination

Chain&amp;nbsp;OUTPUT&amp;nbsp;(policy&amp;nbsp;ACCEPT)
target&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;prot&amp;nbsp;opt&amp;nbsp;source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination&lt;/pre&gt;&lt;p&gt;原因：iptables的OUTPUT没有限制，但INPUT链缺失了“允许回包”的规则，导致连接过程中的返回数据包被拦，添加以下规则后问题解决：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;iptables&amp;nbsp;-I&amp;nbsp;INPUT&amp;nbsp;-m&amp;nbsp;state&amp;nbsp;--state&amp;nbsp;ESTABLISHED,RELATED&amp;nbsp;-j&amp;nbsp;ACCEPT&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 06 Aug 2025 15:31:14 +0800</pubDate></item><item><title>Linux用户计划任务无法执行</title><link>https://cheug.com/?id=316</link><description>&lt;p&gt;1.报错：&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;Authentication token is no longer valid; new one required&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;You (yunqiao) are not allowed to access to (crontab) because of pam configuration.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;原因：这说明系统PAM检测到用户的密码认证信息过期，解决方式是清理密码过期状态。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;执行以下命令，查看用户状态：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;chage&amp;nbsp;-l&amp;nbsp;user&lt;/pre&gt;&lt;p&gt;如果你看到如下提示：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;Password&amp;nbsp;expires&amp;nbsp;:&amp;nbsp;&amp;lt;某个日期&amp;gt;
Password&amp;nbsp;inactive&amp;nbsp;:&amp;nbsp;&amp;lt;某个日期&amp;gt;
Account&amp;nbsp;expires&amp;nbsp;:&amp;nbsp;&amp;lt;某个日期&amp;gt;&lt;/pre&gt;&lt;p&gt;或者有 &lt;code data-start=&quot;492&quot; data-end=&quot;510&quot;&gt;Password expired&lt;/code&gt; 的提示，说明密码已经过期了。你可以使用命令重新设置密码，也可以解除密码过期限制。&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-bash&quot;&gt;passwd&amp;nbsp;user&amp;nbsp;

chage&amp;nbsp;-M&amp;nbsp;99999&amp;nbsp;user&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 06 Aug 2025 14:54:51 +0800</pubDate></item></channel></rss>