修改了所有端口 不冲突
This commit is contained in:
parent
53c349413c
commit
d8b43a7f83
29
change_port.sh
Normal file
29
change_port.sh
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# 定义一个函数来修改每个服务器的配置文件中的端口
|
||||
change_port() {
|
||||
server_name=$1
|
||||
port=$2
|
||||
config_file="server/${server_name}/etc/${server_name}.yaml"
|
||||
|
||||
echo "Changing port for $server_name to $port"
|
||||
|
||||
if [ -f "$config_file" ]; then
|
||||
# 使用 sed 将 Port 替换为新的端口
|
||||
sed -i "s/^Port: .*$/Port: $port/" "$config_file"
|
||||
else
|
||||
echo "Configuration file $config_file not found"
|
||||
fi
|
||||
}
|
||||
|
||||
# 列出所有服务器目录
|
||||
server_dirs=("backend" "canteen" "data-transfer" "home-user-auth" "inventory" "map-library" "orders" "product" "product-model" "product-template" "shopping-cart-confirmation" "upload" "webset")
|
||||
|
||||
# 初始化端口为 9901
|
||||
port=9901
|
||||
|
||||
# 遍历服务器目录,修改每个服务器的配置文件中的端口
|
||||
for server_dir in "${server_dirs[@]}"; do
|
||||
change_port $server_dir $port
|
||||
port=$((port + 1))
|
||||
done
|
|
@ -1,6 +1,6 @@
|
|||
Name: backend
|
||||
Host: 0.0.0.0
|
||||
Port: 8888
|
||||
Port: 9901
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen_backend_2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: canteen
|
||||
Host: 0.0.0.0
|
||||
Port: 8891
|
||||
Port: 9902
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: data-transfer
|
||||
Host: 0.0.0.0
|
||||
Port: 8890
|
||||
Port: 9903
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: home-user-auth
|
||||
Host: 0.0.0.0
|
||||
Port: 9901
|
||||
Port: 9904
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
|
||||
Auth:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: inventory
|
||||
Host: 0.0.0.0
|
||||
Port: 8898
|
||||
Port: 9905
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: map-library
|
||||
Host: 0.0.0.0
|
||||
Port: 8893
|
||||
Port: 9906
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: orders
|
||||
Host: 0.0.0.0
|
||||
Port: 8893
|
||||
Port: 9907
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: product-model
|
||||
Host: 0.0.0.0
|
||||
Port: 8897
|
||||
Port: 9909
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: product-template
|
||||
Host: 0.0.0.0
|
||||
Port: 8896
|
||||
Port: 9910
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: product
|
||||
Host: 0.0.0.0
|
||||
Port: 9902
|
||||
Port: 9908
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: shopping-cart-confirmation
|
||||
Host: 0.0.0.0
|
||||
Port: 9902
|
||||
Port: 9911
|
||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||
Auth:
|
||||
AccessSecret: fusen2023
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: upload
|
||||
Host: 0.0.0.0
|
||||
Port: 9903
|
||||
Port: 9912
|
||||
SourceMysql: "fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest"
|
||||
Env: "test"
|
||||
Auth:
|
||||
|
|
Loading…
Reference in New Issue
Block a user