#集群实例扩缩容

YashanDB支持通过yasboot工具对共享集群部署中的实例节点(包括YCS实例和数据库实例)进行在线扩容,且扩容期间不影响整个集群的使用。

Note:

  • 目前无法对集群内的实例进行删减。

  • 如果扩容失败,请参考扩缩容异常处理进行处理。

  1. 以安装用户登录当前数据库集群中yasboot工具所在服务器。

  2. 生成向数据库环境新增服务器并增加实例的配置文件。

    $ yasboot config node gen -c yashandb \
    -u yashan -p password --ip ip1,ip2 --port 22\
    --install-path /data/yashan/yasdb_home \
    --data-path /data/yashan/yasdb_data \
    --log-path /data/yashan/log \
    --node 2 \
    --vips vip1,vip2        # 原集群未配置VIP时,不需要指定--vips选项
    

    执行成功后,会生成yashandb_add.tomlhosts_add.toml两个配置文件,命令详情请查阅yasboot config node gen

  3. 部署新服务器。

    1. ) 请先参照安装前准备检查并确保新服务器的各项环境已满足要求。

    2. ) 执行如下命令,部署新服务器。

      $ yasboot host add -c yashandb -t hosts_add.toml
      
      type | uuid             | name    | hostid | index    | status  | return_code | progress | cost 
      -------------------------------------------------------------------------------------------------
      task | b5328fe3dbf4a2be | HostAdd | -      | yashandb | SUCCESS | 0           | 100      | 9    
      ------+------------------+---------+--------+----------+---------+-------------+----------+------
      task completed, status: SUCCESS
      
    3. ) 若扩容前其他服务器均已配置开机自启动,新服务器也必须配置开机自启动

  4. 执行如下命令,增加实例节点。

    $ yasboot node add -c yashandb -t yashandb_add.toml -p password
    type | uuid             | name    | hostid | index    | status  | return_code | progress | cost 
    -------------------------------------------------------------------------------------------------
    task | 834a8c23c37ca1f4 | NodeAdd | -      | yashandb | SUCCESS | 0           | 100      | 3    
    ------+------------------+---------+--------+----------+---------+-------------+----------+------
    task completed, status: SUCCESS
    
  5. 将hosts_add.toml中的[[host]]内容复制粘贴到hosts.toml的末尾,以免升级时仍用旧的hosts信息。

pdf-btn 下载文档 copy-btn 复制链接
edit-icon
反馈
coperate-icon
coperate
合作
communication-icon
communicate
交流