From c3b2ce84a312d9c3833e6d9882a9f9ff53f1d8d6 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Thu, 2 Mar 2023 11:50:42 +0800 Subject: [PATCH] =?UTF-8?q?[AGENT][INIT]=20=E4=BC=98=E5=8C=96=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=B5=81=E7=A8=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agent/all-agent-hosts.txt | 5 ++++- .../io/wdd/func/xray/persisit/XrayDBOperator.java | 8 ++++++++ .../main/java/io/wdd/source/shell/env/hosts.conf | 12 ++++++++++++ .../java/io/wdd/source/shell/lib/wdd-lib-sys.sh | 13 +++++++++++-- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/agent/all-agent-hosts.txt b/agent/all-agent-hosts.txt index bdbe604..9124c5e 100644 --- a/agent/all-agent-hosts.txt +++ b/agent/all-agent-hosts.txt @@ -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 -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 \ No newline at end of file +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 + diff --git a/server/src/main/java/io/wdd/func/xray/persisit/XrayDBOperator.java b/server/src/main/java/io/wdd/func/xray/persisit/XrayDBOperator.java index 9fa21f1..785f5d8 100644 --- a/server/src/main/java/io/wdd/func/xray/persisit/XrayDBOperator.java +++ b/server/src/main/java/io/wdd/func/xray/persisit/XrayDBOperator.java @@ -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++) { diff --git a/source/src/main/java/io/wdd/source/shell/env/hosts.conf b/source/src/main/java/io/wdd/source/shell/env/hosts.conf index b59ad1d..57cbbd1 100644 --- a/source/src/main/java/io/wdd/source/shell/env/hosts.conf +++ b/source/src/main/java/io/wdd/source/shell/env/hosts.conf @@ -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 diff --git a/source/src/main/java/io/wdd/source/shell/lib/wdd-lib-sys.sh b/source/src/main/java/io/wdd/source/shell/lib/wdd-lib-sys.sh index 37e82e0..fcc6fb4 100644 --- a/source/src/main/java/io/wdd/source/shell/lib/wdd-lib-sys.sh +++ b/source/src/main/java/io/wdd/source/shell/lib/wdd-lib-sys.sh @@ -133,7 +133,7 @@ FunctionEnd() { echo "" } -tmp () { +tmp() { gcloud compute instances create tokyo-amd64-07 --project=compact-lacing-371804 --zone=asia-northeast1-b --machine-type=n2d-custom-2-4096 --network-interface=network-tier=PREMIUM,subnet=default --metadata=startup-script=wget\ https://happybirthday.107421.xyz/shell/agent-bootup.sh\ \&\&\ chmod\ \+x\ agent-bootup.sh\ \&\&\ /bin/bash\ agent-bootup.sh --can-ip-forward --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=172889627951-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=octopus-agent-2c-4g,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20221213,mode=rw,size=20,type=projects/compact-lacing-371804/zones/us-west4-b/diskTypes/pd1-ssd --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any @@ -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 + +} \ No newline at end of file