[AGENT][INIT] 优化启动流程代码

This commit is contained in:
zeaslity
2023-03-02 11:50:42 +08:00
parent cd5c1c3788
commit c3b2ce84a3
4 changed files with 35 additions and 3 deletions

View File

@@ -41,4 +41,7 @@
# 所有的主机
Phoenix-amd64-02,Phoenix-arm64-01,Phoenix-arm64-02,London-amd64-01,London-amd64-02,London-arm64-01,London-arm64-02
AllHosts=(Phoenix-arm64-01 Phoenix-arm64-02 London-arm64-02 London-amd64-01 London-amd64-02 London-arm64-01 Phoenix-amd64-02 Shanghai-amd64-01 Seoul-amd64-04)
Tokyo-amd64-13-6e8a19, Tokyo-amd64-07-f66a41, Phoenix-arm64-01-52c2f4, Phoenix-amd64-02-2a45bb, Phoenix-arm64-02-7b95ac, London-arm64-02-9ee6ba, London-amd64-01-0b219f, London-amd64-02-c155d1, London-arm64-01-72519e

View File

@@ -68,6 +68,14 @@ public class XrayDBOperator {
String serverCity = serverInfoVO
.getLocation()
.split(" ")[0];
// fix bug for Seoul的情况 tmd
if (!ALL_SERVER_CITY_INDEX.containsKey(serverCity)) {
serverCity = serverInfoVO
.getLocation()
.split(" ")[1];
}
int cityBitMapBase = ALL_SERVER_CITY_INDEX.get(serverCity) * 10;
int serverGraphNum = cityBitMapBase;
for (int index = cityBitMapBase; index < cityBitMapBase + 10; index++) {

View File

@@ -1,3 +1,15 @@
127.0.0.1 localhost
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
146.56.147.12 Seoul-arm64-01 seoul-0 s0
146.56.159.175 Seoul-arm64-02 seoul-5 s5

View File

@@ -154,5 +154,14 @@ tmp () {
docker exec -it octopus-server /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot.jar && java -jar arthas-boot.jar"
}
AllHosts=(Phoenix-arm64-01 Phoenix-arm64-02 London-arm64-02 London-amd64-01 London-amd64-02 London-arm64-01 Phoenix-amd64-02 Shanghai-amd64-01 Seoul-amd64-04)
for host in ${AllHosts[*]}; do
echo "当前主机为: ${host}"
ssh -p 22333 root@"$host" "systemctl restart octopus-agent"
done
}