• 体验OceanBase OBD V2.5.0 组件内扩容和组件变更


    背景

    OBDOceanBase命令行部署工具,在 obd V2.5.0 版本之前,其主要功能主要是部署各类组件,例如 oceanbase-ce,obproxy-ce,obagent 等。然而,它并不支持组件的变更操作以及组件内部的扩缩容调整。具体来说:

    1、若用户希望使用 obd 来扩容 oceanbase-ce,必须手动将新增节点的信息复制到对应组件的精确位置,这一过程繁琐且易出错,因此备受用户诟病。

    2、obd 不具备删除通过其部署的组件的功能。

    3、可以通过创建新的 deploy_name 来添加新组件,但新部署的组件配置无法与其他组件的配置合并统一进行管理。

    因此,很开心在 OBD V2.5.0 开始支持:

    •组件内扩容:⽀持除了 ocp-server 以外的全部组件扩容

    •组件变更:⽀持添加和删除组件

    组件内扩容体验

    将 observer 从单节点扩容为 1-1-1的集群

    扩容前配置

    obd cluster edit-config ob421

    1. user:
    2. username: admin
    3. key_file: /home/admin/.ssh/id_rsa
    4. oceanbase-ce:
    5. package_hash: b2ccb524f200a9ef0fad2cddf59d309ddaa2e3e4
    6. servers:
    7. - name: server1
    8. ip: 172.24.255.93
    9. global:
    10. cluster_id: 1
    11. mysql_port: 12881
    12. rpc_port: 12882
    13. home_path: /home/admin/ob421
    14. data_dir: /home/admin/ob421_data
    15. redo_dir: /home/admin/ob421_clog
    16. memory_limit: 7G
    17. system_memory: 0M
    18. datafile_size: 6G
    19. datafile_next: 2G
    20. log_disk_size: 20G
    21. cpu_count: 16
    22. production_mode: false
    23. enable_syslog_wf: false
    24. enable_syslog_recycle: true
    25. max_syslog_file_count: 40
    26. appname: obcluster
    27. root_password: aaAA11__
    28. proxyro_password: aaAA11__
    29. server1:
    30. zone: zone1
    31. local_ip: 172.24.255.93

    obd cluster display ob421

    1. Get local repositories and plugins ok
    2. Open ssh connection ok
    3. Cluster status check ok
    4. Connect to observer 172.24.255.93:12881 ok
    5. Wait for observer init ok
    6. +--------------------------------------------------+
    7. | observer |
    8. +---------------+---------+-------+-------+--------+
    9. | ip | version | port | zone | status |
    10. +---------------+---------+-------+-------+--------+
    11. | 172.24.255.93 | 4.2.1.2 | 12881 | zone1 | ACTIVE |
    12. +---------------+---------+-------+-------+--------+
    13. obclient -h172.24.255.93 -P12881 -uroot -p'aaAA11__' -Doceanbase -A
    14. Trace ID: 74eb3f54-a91d-11ee-b841-00163e04608d
    15. If you want to view detailed obd logs, please run: obd display-trace 74eb3f54-a91d-11ee-b841-00163e04608d
    准备扩容文件

    cat scale_out_zone2_zone3.yaml

    1. oceanbase-ce:
    2. servers:
    3. - name: server2
    4. ip: 172.24.255.94
    5. - name: server3
    6. ip: 172.24.255.95
    7. server2:
    8. zone: zone2
    9. local_ip: 172.24.255.94
    10. server3:
    11. zone: zone3
    12. local_ip: 172.24.255.95

    执行扩容操作
    obd cluster scale_out ob421 -c scale_out_zone2_zone3.yaml -v

    1704176494

    扩容后确认

    obd cluster display ob421

    1. obd cluster display ob421
    2. Get local repositories and plugins ok
    3. Open ssh connection ok
    4. Cluster status check ok
    5. Connect to observer 172.24.255.93:12881 ok
    6. Wait for observer init ok
    7. +--------------------------------------------------+
    8. | observer |
    9. +---------------+---------+-------+-------+--------+
    10. | ip | version | port | zone | status |
    11. +---------------+---------+-------+-------+--------+
    12. | 172.24.255.93 | 4.2.1.2 | 12881 | zone1 | ACTIVE |
    13. | 172.24.255.94 | 4.2.1.2 | 12881 | zone2 | ACTIVE |
    14. | 172.24.255.95 | 4.2.1.2 | 12881 | zone3 | ACTIVE |
    15. +---------------+---------+-------+-------+--------+
    16. obclient -h172.24.255.93 -P12881 -uroot -p'aaAA11__' -Doceanbase -A
    17. Trace ID: 392afd82-a91e-11ee-8391-00163e04608d
    18. If you want to view detailed obd logs, please run: obd display-trace 392afd82-a91e-11ee-8391-00163e04608d

    组件变更体验

    新增 obproxy-ce 组件

    1、准备新增组件的配置文件

    cat obproxy1.yaml

    1. obproxy-ce:
    2. package_hash: 0aed4b782120e4248b749f67be3d2cc82cdcb70d
    3. depends:
    4. - oceanbase-ce
    5. servers:
    6. - 172.24.255.94
    7. global:
    8. listen_port: 22883
    9. prometheus_listen_port: 22884
    10. home_path: /home/admin/obproxy421
    11. enable_cluster_checkout: false
    12. skip_proxy_sys_private_check: true
    13. enable_strict_kernel_release: false
    14. obproxy_sys_password: aaAA11__
    15. observer_sys_password: aaAA11__
    2、执行添加组件操作

    obd cluster component add ob421 -c obproxy1.yaml

    1. Get local repositories and plugins ok
    2. Cluster status check ok
    3. Get added repositories and plugins ok
    4. Open ssh connection ok
    5. Connect to observer 172.24.255.93:12881 ok
    6. +---------------------------------------------------------------------------+
    7. | Packages |
    8. +------------+---------+---------+------------------------------------------+
    9. | Repository | Version | Release | Md5 |
    10. +------------+---------+---------+------------------------------------------+
    11. | obproxy-ce | 4.2.1.0 | 11.el7 | 0aed4b782120e4248b749f67be3d2cc82cdcb70d |
    12. +------------+---------+---------+------------------------------------------+
    13. Repository integrity check ok
    14. Parameter check ok
    15. Initializes obproxy work home ok
    16. Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository install ok
    17. Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository lib check ok
    18. Search plugins ok
    19. Load cluster param plugin ok
    20. Check before start obproxy ok
    21. [WARN] OBD-4521: The config observer_sys_password in obproxy-ce did not take effect, please config it in oceanbase-ce
    22. Start obproxy ok
    23. obproxy program health check ok
    24. Connect to obproxy ok
    25. Initialize obproxy-ce ok
    26. +--------------------------------------------------+
    27. | obproxy |
    28. +---------------+-------+-----------------+--------+
    29. | ip | port | prometheus_port | status |
    30. +---------------+-------+-----------------+--------+
    31. | 172.24.255.94 | 22883 | 22884 | active |
    32. +---------------+-------+-----------------+--------+
    33. obclient -h172.24.255.94 -P22883 -uroot -p'aaAA11__' -Doceanbase -A
    34. ob421 running
    35. Trace ID: 1d33bdde-a938-11ee-bc57-00163e04608d
    36. If you want to view detailed obd logs, please run: obd display-trace 1d33bdde-a938-11ee-bc57-00163e04608d
    3、添加组件后确认

    确认新组件 (obproxy-ce) 已添加成功且可以和已有的组件(oceanbase-ce) 一起管理

    obd cluster display ob421

    1. Get local repositories and plugins ok
    2. Open ssh connection ok
    3. Cluster status check ok
    4. Connect to observer 172.24.255.93:12881 ok
    5. Wait for observer init ok
    6. +--------------------------------------------------+
    7. | observer |
    8. +---------------+---------+-------+-------+--------+
    9. | ip | version | port | zone | status |
    10. +---------------+---------+-------+-------+--------+
    11. | 172.24.255.93 | 4.2.1.2 | 12881 | zone1 | ACTIVE |
    12. | 172.24.255.94 | 4.2.1.2 | 12881 | zone2 | ACTIVE |
    13. | 172.24.255.95 | 4.2.1.2 | 12881 | zone3 | ACTIVE |
    14. +---------------+---------+-------+-------+--------+
    15. obclient -h172.24.255.93 -P12881 -uroot -p'aaAA11__' -Doceanbase -A
    16. Connect to obproxy ok
    17. +--------------------------------------------------+
    18. | obproxy |
    19. +---------------+-------+-----------------+--------+
    20. | ip | port | prometheus_port | status |
    21. +---------------+-------+-----------------+--------+
    22. | 172.24.255.94 | 22883 | 22884 | active |
    23. +---------------+-------+-----------------+--------+
    24. obclient -h172.24.255.94 -P22883 -uroot -p'aaAA11__' -Doceanbase -A
    25. Trace ID: 54f29ef2-a938-11ee-86dc-00163e04608d
    26. If you want to view detailed obd logs, please run: obd display-trace 54f29ef2-a938-11ee-86dc-00163e04608d
    4、obproxy 组件内扩容

    上面的操作执行后,只有一个 obproxy 节点,这里再次体验一下通过 obd 来扩容组件(obprxoy-ce) 的节点:

    cat obproxy2.yaml

    1. obproxy-ce:
    2. servers:
    3. - 172.24.255.95

    obd cluster scale_out ob421 -c obproxy2.yaml 

    非常赞,扩容就是这么简单。

    1. ...
    2. Connect to obproxy ok
    3. +--------------------------------------------------+
    4. | obproxy |
    5. +---------------+-------+-----------------+--------+
    6. | ip | port | prometheus_port | status |
    7. +---------------+-------+-----------------+--------+
    8. | 172.24.255.94 | 22883 | 22884 | active |
    9. | 172.24.255.95 | 22883 | 22884 | active |
    10. +---------------+-------+-----------------+--------+
    11. ...
    删除 obproxy-ce 组件

    obd cluster component del ob421 obproxy-ce

    1704177752

    注意事项

    1、组件内扩容的配置文件里不允许出现 depends,global 对应的配置,否则会出现类似的报错

       [ERROR] OBD-1023: Failed to merge config: depends is not allowed to be set

    2、新增组件时 deploy_name 需要填写已有的 deploy_name ,比如(ob421),填写不存在的名字会有如下类似的报错

       [ERROR] No such deploy: ob421_obproxy.

       PS: 在 obd250 之前的版本新增组件是需要填写一个不存在 deploy_name 名字。

    3、obd 组件内扩容 oceanbase-ce 后,不会自动扩容租户的 unit_num,需要手动执行 sql 命令行进行扩容。

    4、不支持组件内的缩容操作。

  • 相关阅读:
    工程项目管理的主要内容都是什么?
    Javascript知识【JS-全局函数对象&JS-事件】
    什么是深拷贝;深拷贝和浅拷贝有什么区别;深拷贝和浅拷贝有哪些方法(详解)
    2022版:Gitee在Android studio上的使用
    【cocos2dx】学习记录,Node的自动释放(autorelease)
    力扣 2454. 下一个更大元素 IV
    Java中的队列Queue
    ThreadLocal 是什么?它的实现原理呢?
    【游戏建模全流程】使用ZBrush制作龙模型
    ubuntu使用docker拉取环境,并对环境进行优化
  • 原文地址:https://blog.csdn.net/OceanBaseGFBK/article/details/136650706