|
@@ -89,12 +89,11 @@ def remove_container_image(ecs_client, instance_id, container_name_list):
|
|
|
except Exception as e:
|
|
|
j += 1
|
|
|
|
|
|
-def update_instance(ecs_client, alb_client, server_group_id_list, instance_id, version, port):
|
|
|
+def update_instance(ecs_client, alb_client, instance_id, version, port):
|
|
|
"""
|
|
|
线上机器更新
|
|
|
:param ecs_client:
|
|
|
:param alb_client: alb客户端连接
|
|
|
- :param server_group_id_list 后端服务器组
|
|
|
:param instance_id: instanceId
|
|
|
:param version: 版本标记
|
|
|
:param port: 后端服务器使用的端口
|
|
@@ -102,10 +101,9 @@ def update_instance(ecs_client, alb_client, server_group_id_list, instance_id, v
|
|
|
"""
|
|
|
logging.info(f"update instance: {instance_id}")
|
|
|
# 1. 摘流量,将权重降为0
|
|
|
- # weight_list = [(0, 20)] # 设置权重为0,等待20秒
|
|
|
-
|
|
|
+ print(instance_id)
|
|
|
utils.update_server_group_servers_attribute(alb_client=alb_client,
|
|
|
- server_group_id_list=[server_group_id_list],
|
|
|
+ server_group_id_list=longvideoapi_config.server_group_id_list,
|
|
|
instance_id_list=[instance_id],
|
|
|
weight_list=[(0, 20)],
|
|
|
port=port)
|
|
@@ -177,7 +175,7 @@ def main():
|
|
|
# 2. 对其中一台机器进行更新
|
|
|
instance_id = online_instance_ids[0]
|
|
|
logging.info(f"update instance start ...")
|
|
|
- update_instance(ecs_client=ecs_client, alb_client=alb_client, server_group_id_list=longvideoapi_config.server_group_id_list, instance_id=instance_id, version=version, port=longvideoapi_config.port)
|
|
|
+ update_instance(ecs_client=ecs_client, alb_client=alb_client, instance_id=instance_id, version=version, port=longvideoapi_config.port)
|
|
|
logging.info(f"update instances end!")
|
|
|
|
|
|
except Exception as e:
|