Jelajahi Sumber

update README.md

reghao 1 tahun lalu
induk
melakukan
ef31ed5d72
2 mengubah file dengan 12 tambahan dan 0 penghapusan
  1. 3 0
      README.md
  2. 9 0
      zzz/reset_machine_id.sh

+ 3 - 0
README.md

@@ -26,6 +26,9 @@ devops-mgr 和 devops-agent 之间的关系如下图所示:
 > 
 > 每台被管理的机器上都需要且只能一个部署 agent 实例
 > > 在 agent 的配置文件中指定 mgr 的地址
+>
+> > agent 使用 Linux 的 /etc/machine-id 文件中字符串作为 machineId 在 mgr 中唯一地标识一台机器
+> > > 如果 VirtualBox 中使用的 vdisk 是通过 clonehd 得到, 那么多台 VM 中 /etc/machine-id 文件的内容是相同的, 此时需要在 VM 中执行 devops/zzz/reset_machine_id.sh 脚本来重置 machine-id
 > 
 > 只能部署一个 mgr 实例
 

+ 9 - 0
zzz/reset_machine_id.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+###############################################################################
+# 重置 /etc/machine-id
+###############################################################################
+
+rm /etc/machine-id /var/lib/dbus/machine-id
+dbus-uuidgen --ensure
+systemd-machine-id-setup