首批通过分布式安全可靠测评,为关键业务系统打造
集群扩容
更新时间:2026-04-10 11:58:35
本文介绍如何通过 obshell-sdk-python 对集群进行扩容。
说明
建议先查看 obshell-sdk-python 快速上手 内容,了解如何使用 obshell-sdk-python。
注意事项
对集群进行扩容前,需注意以下要求:
请求的 client 对应的节点需在待扩容的集群中。
obshell 需正常运行。
待添加到集群中的扩容节点从未加入过任何集群。
示例代码
from obshell import ClientSet
from obshell.auth import PasswordAuth
# 创建 client 实例,节点地址为 '10.10.10.1',端口为 2886。
# 所在集群的 root@sys 密码为 '****'。
client = ClientSet("10.10.10.1", 2886, PasswordAuth("****"))
configs = {
"datafile_size": "24G", "log_disk_size": "24G",
"cpu_count": "16", "memory_limit": "16G", "system_memory": "8G",
"enable_syslog_recycle": "true", "enable_syslog_wf": "true"}
# 向集群添加节点 '10.10.10.4:2886',OBServer 节点位于 zone3,配置为 configs。
client.v1.scale_out_sync("10.10.10.4", 2886, "zone3", configs)
from obshell import ClientSet
from obshell.auth import PasswordAuth
# 创建 client 实例,节点地址为 '10.10.10.1',端口为 2886。
# 所在集群的 root@sys 密码为 '****'。
client = ClientSet("10.10.10.1", 2886, PasswordAuth("****"))
configs = {
"datafile_size": "24G", "log_disk_size": "24G",
"cpu_count": "16", "memory_limit": "16G", "system_memory": "8G",
"enable_syslog_recycle": "true", "enable_syslog_wf": "true"}
# 向集群添加节点 '10.10.10.4:2886',OBServer 节点位于 zone3,配置为 configs。
dag = client.v1.scale_out("10.10.10.4", 2886, "zone3", configs)
# 等待任务完成。
client.v1.wait_dag_succeed(dag.generic_id)