有没有一种方法可以仅使用一个命令在 systemd 中重新启动服务的所有实例?
假设我们有两个守护进程在运行,分别名为 thingd@01 和 thingd@02。我可以只重启那些而不必为每个实例调用一次 systemctl 吗?
小智 23
您应该能够使用一个 systemctl 重新启动它们,只需在服务之间留一个空格即可。例如systemctl restart thingd@01 thingd@02
在从负载平衡池中删除实例后,我通常会在克隆实例之前停止所有主要服务。我使用以下内容:
# 停止 php-fpm、MariaDB、nginx 和 postfix
systemctl stop php-fpm nginx postfix mariadb
Run Code Online (Sandbox Code Playgroud)
# 停止后检查状态
systemctl status php-fpm nginx postfix mariadb
Run Code Online (Sandbox Code Playgroud)
# 重新启动所有这些
systemctl start php-fpm nginx postfix mariadb
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12079 次 |
| 最近记录: |