当前位置: 首页 > news >正文

如何替换OCP节点(二):使用 antman脚本 | OceanBase应用实践

前言:

OceanBase Cloud Platform(简称OCP),是 OceanBase数据库的专属企业级数据库管理平台。

在实际生产环境中,OCP的安装通常是第一步,先搭建OCP平台,进而依赖OCP来创建、管理和监控我们的生产集群。但此后,可能由于机房调整或其他需求,可能会出现需要迁移或替换OCP服务器的情况。

上一篇文章,介绍了使用oat平台来替换OCP的方法,本文将介绍使用antman脚本替换OCP服务器的方法。(注:本文的环境的OCP负载均衡使用的f5,所以新的机器需要先配置f5,其他负载均衡场景同理)

环境背景:

大家如果有接触ob生产环境的经验的话,可以能会了解,前期版本,安装ocp的时候,需要安装ocp软件/metadba/obproxy三个docker包,后期ocp版本将db+proxy集成在了一个docker包里,oat的话只能纳管db+proxy

集成的metadb,分开的情况还需要使用antman脚本来替换。

>本篇文章主要介绍使用antman替换,下面说下我的软件信息

1.ocp软件:ocp-all-in-one:3.3.3-20220906114643

2.metadb:OB2276_x86_20210409 

3.proxy:OBP186_20210315

4.antman:t-oceanbase-antman-1.4.3-20220807073355.alios7.x86_64

操作过程:

(一)环境检查/准备

  • 检查替换机器环境,包括分盘,创建admin用户,安装docker软件等,安装好后检查下。
cd /root/t-oceanbase-antman/clonescripts/
sh precheck.sh -m ocp
  • 登录meta库检查有没有tenant的主zone在要被替换的节点,提前切主
MySQL [oceanbase]> select * from __all_Server;
+----------------------------+----------------------------+--------------+----------+----+----------------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+-------------------+
| gmt_create                 | gmt_modified               | svr_ip       | svr_port | id | zone           | inner_port | with_rootserver | status | block_migrate_in_time | build_version                                                                        | stop_time | start_service_time | first_sessid | with_partition | last_offline_time |
+----------------------------+----------------------------+--------------+----------+----+----------------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+-------------------+
| 2022-03-17 22:59:19.979627 | 2023-03-20 10:27:01.147283 | 10.10.100.87 |     2882 |  6 | META_OB_ZONE_2 |       2881 |               0 | active |                     0 | 2.2.76_20210406232249-a1e144bdc179fbf473cea37f199e8a76c736b8d4(Apr  6 2021 23:55:12) |         0 |   1679279220991796 |            0 |              1 |  1679278517144838 |
| 2022-03-17 23:54:49.277939 | 2023-03-20 09:29:22.079578 | 10.10.100.9  |     2882 |  7 | META_OB_ZONE_1 |       2881 |               1 | active |                     0 | 2.2.76_20210406232249-a1e144bdc179fbf473cea37f199e8a76c736b8d4(Apr  6 2021 23:55:12) |         0 |   1679275725595691 |            0 |              1 |                 0 |
| 2021-12-21 22:44:16.476503 | 2023-03-20 09:29:22.080425 | 122.44.11.2  |     2882 |  5 | META_OB_ZONE_3 |       2881 |               0 | active |                     0 | 2.2.76_20210406232249-a1e144bdc179fbf473cea37f199e8a76c736b8d4(Apr  6 2021 23:55:12) |         0 |   1640097866698859 |            0 |              1 |                 0 |
+----------------------------+----------------------------+--------------+----------+----+----------------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+-------------------+
MySQL [oceanbase]> select tenant_name,primary_zone  from __all_tenant;
+----------------+----------------------------------------------+
| tenant_name    | primary_zone                                 |
+----------------+----------------------------------------------+
| sys            | META_OB_ZONE_1;META_OB_ZONE_3;META_OB_ZONE_2 |
| ocp_meta       | META_OB_ZONE_1;META_OB_ZONE_3;META_OB_ZONE_2 |
| ocp_monitor    | META_OB_ZONE_1;META_OB_ZONE_3;META_OB_ZONE_2 |
| oms_tt_tenant  | META_OB_ZONE_1;META_OB_ZONE_3;META_OB_ZONE_2 |
| oms_cc7_tenant | META_OB_ZONE_3;META_OB_ZONE_2;META_OB_ZONE_1 |
| oms_ff9_tenant | META_OB_ZONE_1;META_OB_ZONE_2,META_OB_ZONE_3 |
| oms_cc9_tenant | META_OB_ZONE_3;META_OB_ZONE_1,META_OB_ZONE_2 |
| oms_dd_tenant  | META_OB_ZONE_3;META_OB_ZONE_1,META_OB_ZONE_2 |
| obdw_meta      | META_OB_ZONE_3;META_OB_ZONE_1,META_OB_ZONE_2 |
+----------------+----------------------------------------------+
MySQL [oceanbase]> alter tenant sys primary_zone='META_OB_ZONE_2;META_OB_ZONE_3,META_OB_ZONE_1';
Query OK, 0 rows affected (0.04 sec)MySQL [oceanbase]> alter tenant ocp_meta primary_zone='META_OB_ZONE_2;META_OB_ZONE_3,META_OB_ZONE_1';
Query OK, 0 rows affected (1.27 sec)MySQL [oceanbase]> alter tenant ocp_monitor primary_zone='META_OB_ZONE_2;META_OB_ZONE_3,META_OB_ZONE_1';
Query OK, 0 rows affected (0.02 sec)MySQL [oceanbase]> alter tenant oms_tt_tenant primary_zone='META_OB_ZONE_2;META_OB_ZONE_3,META_OB_ZONE_1';
Query OK, 0 rows affected (0.03 sec)MySQL [oceanbase]> alter tenant oms_ff9_tenant primary_zone='META_OB_ZONE_2;META_OB_ZONE_3,META_OB_ZONE_1';
Query OK, 0 rows affected (0.03 sec)
  • 因为使用antman脚本迁移,需要在执行机器上修改obcluster.conf文件,或者直接从原ocp上copy后检查下,镜像包也需要传到该机器/root/t-oceanbase-antman目录下
55obffocp:~/t-oceanbase-antman # cat obcluster.conf
ZONE1_RS_IP=10.10.100.9
ZONE2_RS_IP=10.10.100.87
ZONE3_RS_IP=122.44.11.2######  自动配置,无需修改 / AUTO-CONFIGURATION ######OBSERVER01_HOSTNAME=OCP_META_SERVER_1
OBSERVER02_HOSTNAME=OCP_META_SERVER_2
OBSERVER03_HOSTNAME=OCP_META_SERVER_3
ZONE1_NAME=META_OB_ZONE_1                       --后续命令参数,主要和参数文件中对上
ZONE2_NAME=META_OB_ZONE_2
ZONE3_NAME=META_OB_ZONE_3
##there must be more than half zone within same region
ZONE1_REGION=OCP_META_REGION
ZONE2_REGION=OCP_META_REGION
ZONE3_REGION=OCP_META_REGION
MYSQL_PORT=2881
RPC_PORT=2882OCP_VERSION=3.3.3
  • 检查执行antman脚本机器上默认集群密码是否正确,cd ~/t-oceanbase-antman/tools ,执行getpass.sh的脚本,如果不对需要使用setpass.sh修改,因为后续proxy的docker迁移后会有验证,ocp的docker迁移前也会验证。
55obffocp:~/t-oceanbase-antman/tools # bash setpass.sh -s 0Aa255yK^F  
password file sys in /root/.key already exist!
**********************
Password of root@sys is  CqVgg9}Aut
Password of root@ocp_meta is  r6kS^EINTU
Password of root@ocp_monitor is  pkJv1a{7J7
Password of root@odc is  j{fjdd3X9f
Password of root@oms is  {oOIsE9fdQ55obffocp:~ # mv .key  .key_bak
55obffocp:~ # cd /root/t-oceanbase-antman/tools/
55obffocp:~/t-oceanbase-antman/tools # bash setpass.sh -s 0Aa255yK^F
**********************
Password of root@sys is  0Aa255yK^F
Password of root@ocp_meta is 
Password of root@ocp_monitor is 
Password of root@odc is 
Password of root@oms is 
55obffocp:~/t-oceanbase-antman/tools # bash setpass.sh -c rSf@jO%6EO
**********************
Password of root@sys is  0Aa255yK^F
Password of root@ocp_meta is  rSf@jO%6EO
Password of root@ocp_monitor is 
Password of root@odc is 
Password of root@oms is 

(二)执行antman的manage脚本进行新机器的添加

  • 执行antman的manage脚本进行新机器的添加,ps:(这个版本manage会有报错,文末会有分享)
55obffocp:~/t-oceanbase-antman # ./manage.sh -i ob,ocp,obproxy -l 133.55.22.19 -z 1 -R Jnydzycscc@123 -A OceanBase#123
[2023-06-16 16:31:45.375633] INFO [check conf file /root/t-oceanbase-antman/obcluster.conf format ...]
[2023-06-16 16:31:45.381844] INFO [conf file is upper case format.]
[2023-06-16 16:31:45.391446] INFO [SSH_AUTH=password SSH_USER=root SSH_PORT=22 SSH_PASSWORD= SSH_KEY_FILE=/root/.ssh/id_rsa]
LB_MODE=f5
INSTALL_COMPONENTS componets: ob obproxy ocp
CLEAR_COMPONENTS: 
IP_LIST: 133.55.22.19
ZONE_LIST: 1
ROOT_PASSWORD_LIST: Jnydzycscc@123
ADMIN_PASSWORD_LIST: OceanBase#123
[2023-06-16 16:31:45.746503] INFO [INSTALL_COMPONENT: ob START  ######################################]
[2023-06-16 16:31:45.751057] INFO [deploy_ob: check whether OBSERVER port 2881,2882 are in use or not on 133.55.22.19]
[2023-06-16 16:31:45.806500] INFO [deploy_ob: OBSERVER port 2881,2882 are idle on 133.55.22.19]
[2023-06-16 16:31:45.810773] INFO [deploy_ob: installing ob cluster, logfile: /root/t-oceanbase-antman/logs/deploy_ob.log]
cp: '/root/t-oceanbase-antman/OB2276_x86_20210409.tar.gz' and '/root/t-oceanbase-antman/OB2276_x86_20210409.tar.gz' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/install_OB_docker.sh' and '/root/t-oceanbase-antman/install_OB_docker.sh' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/obcluster.conf' and '/root/t-oceanbase-antman/obcluster.conf' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/common/utils.sh' and '/root/t-oceanbase-antman/common/utils.sh' are the same file
skip copy same file
cp: '/root/.key' and '/root/.key' are the same file
skip copy same file
nohup: ignoring input
[2023-06-16 16:31:45.841348] INFO [installing OB docker and starting OB server on 133.55.22.19, pid: 144513, log: /root/t-oceanbase-antman/logs/install_OB_docker.log and /home/admin/logs/ob-server/ inside docker]
[2023-06-16 16:31:45.925592] INFO [load docker image: docker load -i /root/t-oceanbase-antman/OB2276_x86_20210409.tar.gz]
[2023-06-16 16:31:45.930723] INFO [install_OB_docker.sh is still running on 133.55.22.19]
[2023-06-16 16:31:56.021465] INFO [install_OB_docker.sh is still running on 133.55.22.19]
Loaded image: reg.docker.alibaba-inc.com/antman/ob-docker:OB2276_x86_20210409
[2023-06-16 16:32:06.111458] INFO [install_OB_docker.sh is still running on 133.55.22.19]
[2023-06-16 16:32:06.359285] INFO [start container: docker run -d -it --cap-add SYS_RESOURCE --name META_OB_ZONE_1 --net=host     -e OBCLUSTER_NAME=obcluster      -e DEV_NAME=bond0     -e ROOTSERVICE_LIST="10.10.100.9:2882:2881;10.10.100.87:2882:2881;122.44.11.2:2882:2881"     -e DATAFILE_DISK_PERCENTAGE=90     -e CLUSTER_ID=1632654636     -e ZONE_NAME=META_OB_ZONE_1     -e OBPROXY_PORT=2883     -e MYSQL_PORT=2881     -e RPC_PORT=2882     -e OCP_VIP=134.80.173.57     -e OCP_VPORT=80     -e app.password_root='Jnydzycscc@123'     -e app.password_admin='OceanBase#123'     -e OBPROXY_OPTSTR=""     -e OPTSTR="cpu_count=64,system_memory=50G,memory_limit=254G,__min_full_resource_pool_memory=1073741824,_ob_enable_prepared_statement=false,memory_limit_percentage=90"     --cpu-period 100000     --cpu-quota 6400000     --cpuset-cpus 0-63     --memory 256G     -v /home/admin/oceanbase:/home/admin/oceanbase     -v /data/log1:/data/log1     -v /data/1:/data/1     --restart on-failure:5     reg.docker.alibaba-inc.com/antman/ob-docker:OB2276_x86_20210409]
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
4f1c15e8194cc1ae2fffcc124ea9c982b3fda87ce1a6d0038db88435c737af89
[2023-06-16 16:32:16.209761] INFO [install_OB_docker.sh finished and reg.docker.alibaba-inc.com/antman/ob-docker:OB2276_x86_20210409 started on 133.55.22.19]
[2023-06-16 16:32:16.214771] INFO [waiting on observer ready on 133.55.22.19]
[2023-06-16 16:35:16.244133] INFO [waiting on observer ready on 133.55.22.19 for 3 Minitues]
[2023-06-16 16:36:16.264776] INFO [waiting on observer ready on 133.55.22.19 for 4 Minitues]
[2023-06-16 16:37:16.285808] INFO [waiting on observer ready on 133.55.22.19 for 5 Minitues]
[2023-06-16 16:37:16.579057] INFO [observer on 133.55.22.19 is ready]
[2023-06-16 16:37:16.584583] INFO [deploy_ob: installation of ob cluster done]
[2023-06-16 16:37:16.588617] INFO [INSTALL_COMPONENT: ob DONE  ######################################]
[2023-06-16 16:37:16.593604] INFO [INSTALL_COMPONENT: obproxy START  ######################################]

####日志太多,就不都粘贴出来了,可以上面看到metadb的docker服务添加完后开始了obproxy的docker服务添加###

说明:

1)"133.55.22.19"是要去替换ocp的服务器的实际物理IP。

2)"-z 1"选项,指定的133.55.22.19会被添加到OCP环境中的第1个zone,即和上文查到的10.10.100.9机器在同一个zone里。

这里关于zone的定义,主要是针对OCP服务器上的meta_ob docker而言,obproxy docker和ocp docker并没有zone的概念。

关于每台OCP服务器上的meta_ob docker属于哪一个zone,请参考"obcluster.conf"配置文件中的三个变量:ZONE1_RS_IP,ZONE2_RS_IP,ZONE3_RS_IP。

3)"-R"和"-A",后面需要分别填写成133.55.22.19服务器的root用户密码和admin用户密码。

4)-i是安装,如果替换成-c就是清除 

####这时候正常的话可以通过新添加节点的ip:8080前台登录ocp了,也可以通过这个机器的2883端口去连meta库了

(三)登录ocp的metadb的sys租户新增meta_ob docker的上线

MySQL [oceanbase]> alter system add server '133.55.22.19:2882' zone 'META_OB_ZONE_1';
Query OK, 0 rows affected (0.02 sec)MySQL [oceanbase]> select svr_ip, zone, with_rootserver, status, start_service_time from __all_server;
+--------------+----------------+-----------------+--------+--------------------+
| svr_ip       | zone           | with_rootserver | status | start_service_time |
+--------------+----------------+-----------------+--------+--------------------+
| 10.10.100.87 | META_OB_ZONE_2 |               1 | active |   1679279220991796 |
| 10.10.100.9  | META_OB_ZONE_1 |               0 | active |   1679275725595691 |
| 122.44.11.2  | META_OB_ZONE_3 |               0 | active |   1640097866698859 |
| 133.55.22.19 | META_OB_ZONE_1 |               0 | active |                  0 |
+--------------+----------------+-----------------+--------+--------------------+
4 rows in set (0.00 sec)MySQL [oceanbase]> select svr_ip, zone, with_rootserver, status, start_service_time from __all_server;
+--------------+----------------+-----------------+--------+--------------------+
| svr_ip       | zone           | with_rootserver | status | start_service_time |
+--------------+----------------+-----------------+--------+--------------------+
| 10.10.100.87 | META_OB_ZONE_2 |               1 | active |   1679279220991796 |
| 10.10.100.9  | META_OB_ZONE_1 |               0 | active |   1679275725595691 |
| 122.44.11.2  | META_OB_ZONE_3 |               0 | active |   1640097866698859 |
| 133.55.22.19 | META_OB_ZONE_1 |               0 | active |   1686908200404755 |
+--------------+----------------+-----------------+--------+--------------------+
4 rows in set (0.01 sec)

(四)登录ocp的metadb的sys租户将被替换meta_ob docker的下线

MySQL [oceanbase]>  alter system delete server '10.10.100.9:2882' zone 'META_OB_ZONE_1';
Query OK, 0 rows affected (0.19 sec)MySQL [oceanbase]> select svr_ip, zone, with_rootserver, status, start_service_time from __all_server;
+--------------+----------------+-----------------+----------+--------------------+
| svr_ip       | zone           | with_rootserver | status   | start_service_time |
+--------------+----------------+-----------------+----------+--------------------+
| 10.10.100.87 | META_OB_ZONE_2 |               1 | active   |   1679279220991796 |
| 10.10.100.9  | META_OB_ZONE_1 |               0 | deleting |   1679275725595691 |
| 122.44.11.2  | META_OB_ZONE_3 |               0 | active   |   1640097866698859 |
| 133.55.22.19 | META_OB_ZONE_1 |               0 | active   |   1686908200404755 |
+--------------+----------------+-----------------+----------+--------------------+
4 rows in set (0.01 sec)
MySQL [oceanbase]> select svr_ip, zone, with_rootserver, status, start_service_time from __all_server;
+--------------+----------------+-----------------+--------+--------------------+
| svr_ip       | zone           | with_rootserver | status | start_service_time |
+--------------+----------------+-----------------+--------+--------------------+
| 10.10.100.87 | META_OB_ZONE_2 |               1 | active |   1679279220991796 |
| 122.44.11.2  | META_OB_ZONE_3 |               0 | active |   1640097866698859 |
| 133.55.22.19 | META_OB_ZONE_1 |               0 | active |   1686908200404755 |
+--------------+----------------+-----------------+--------+--------------------+

(五)登录ocp_meta租户手工更新OCP服务器信息

1686989871

####前面步骤处理完,ocp前台还可以看到残留的信息,需要替换下信息#####

55obffocp:~/t-oceanbase-antman # mysql -h10.10.100.87 -P2883 -uroot@ocp_meta#obcluster -p'rSf@jO%6EO' -Docp -cMySQL [ocp]>  select * from compute_host where inner_ip_address='10.10.100.9'\G
*************************** 1. row ***************************id: 1name: ocp1adescription: NULL
operating_system: 4.12.14-120-defaultarchitecture: x86_64
inner_ip_address: 10.10.100.9ssh_port: 2022kind: DEDICATED_PHYSICAL_MACHINEpublish_ports: NULLstatus: ONLINEvpc_id: 1idc_id: 1host_type_id: 1serial_number: NULLalias: NULLcreate_time: 2021-09-26 21:04:11update_time: 2023-03-20 11:01:58
1 row in set (0.00 sec)MySQL [ocp]> update compute_host set inner_ip_address='133.55.22.19', name='55obffocp' where inner_ip_address='10.10.100.9';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0MySQL [ocp]> select * from compute_host where id =1;
+----+-----------+-------------+---------------------+--------------+------------------+----------+----------------------------+---------------+--------+--------+--------+--------------+---------------+-------+---------------------+---------------------+
| id | name      | description | operating_system    | architecture | inner_ip_address | ssh_port | kind                       | publish_ports | status | vpc_id | idc_id | host_type_id | serial_number | alias | create_time         | update_time         |
+----+-----------+-------------+---------------------+--------------+------------------+----------+----------------------------+---------------+--------+--------+--------+--------------+---------------+-------+---------------------+---------------------+
|  1 | 55obffocp | NULL        | 4.12.14-120-default | x86_64       | 133.55.22.19     |     2022 | DEDICATED_PHYSICAL_MACHINE | NULL          | ONLINE |      1 |      1 |            1 | NULL          | NULL  | 2021-09-26 21:04:11 | 2023-06-16 17:47:19 |
+----+-----------+-------------+---------------------+--------------+------------------+----------+----------------------------+---------------+--------+--------+--------+--------------+---------------+-------+---------------------+---------------------+
1 row in set (0.00 sec)

(六)清理被替换机器上残留的服务

ocp1a:~/t-oceanbase-antman #  ./manage.sh -c ob,ocp,obproxy -l 10.10.100.9 -z 1 -R 'Dt!n(Rg4Av!t' -A OceanBase#123
grep: /etc/system-release: No such file or directory
[2023-06-16 22:45:44.101400] INFO [check conf file /root/t-oceanbase-antman/obcluster.conf format ...]
[2023-06-16 22:45:44.106779] INFO [conf file is upper case format.]
[2023-06-16 22:45:44.114437] INFO [SSH_AUTH=password SSH_USER=root SSH_PORT=22 SSH_PASSWORD= SSH_KEY_FILE=/root/.ssh/id_rsa]
LB_MODE=f5
INSTALL_COMPONENTS componets: 
CLEAR_COMPONENTS: ob obproxy ocp
IP_LIST: 10.10.100.9
ZONE_LIST: 1
ROOT_PASSWORD_LIST: Dt!n(Rg4Av!t
ADMIN_PASSWORD_LIST: OceanBase#123
[2023-06-16 22:45:44.474268] INFO [CLEAR_COMPONENT: ob START  ######################################]
cp: '/root/t-oceanbase-antman/uninstall.sh' and '/root/t-oceanbase-antman/uninstall.sh' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/obcluster.conf' and '/root/t-oceanbase-antman/obcluster.conf' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/common/utils.sh' and '/root/t-oceanbase-antman/common/utils.sh' are the same file
skip copy same file
grep: /etc/system-release: No such file or directory
[2023-06-16 22:45:44.504069] INFO [remove OB server and docker on host: 10.10.100.9]
[2023-06-16 22:45:44.548697] INFO [docker rm -f 62ab623cb4ed]
62ab623cb4ed
[2023-06-16 22:46:01.260706] INFO [remove OB server and docker on host: 10.10.100.9 done!]
[2023-06-16 22:46:01.370808] INFO [uninstall.sh ob  finished and reg.docker.alibaba-inc.com/antman/ob-docker:OB2276_x86_20210409 removed on 10.10.100.9]
[2023-06-16 22:46:01.375914] INFO [OB docker on 10.10.100.9 is removed]
[2023-06-16 22:46:01.380667] INFO [CLEAR_COMPONENT: ob DONE  ######################################]
[2023-06-16 22:46:01.385398] INFO [CLEAR_COMPONENT: obproxy START  ######################################]
cp: '/root/t-oceanbase-antman/uninstall.sh' and '/root/t-oceanbase-antman/uninstall.sh' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/obcluster.conf' and '/root/t-oceanbase-antman/obcluster.conf' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/common/utils.sh' and '/root/t-oceanbase-antman/common/utils.sh' are the same file
skip copy same file
grep: /etc/system-release: No such file or directory
[2023-06-16 22:46:01.416495] INFO [remove obproxy docker on host:10.10.100.9]
[2023-06-16 22:46:01.514215] INFO [docker rm -f 01bdcadf2e11]
01bdcadf2e11
[2023-06-16 22:46:01.765459] INFO [remove obproxy docker on host:10.10.100.9 done!]
[2023-06-16 22:46:01.858848] INFO [uninstall.sh obproxy  finished and reg.docker.alibaba-inc.com/antman/obproxy:OBP186_20210315 removed on 10.10.100.9]
[2023-06-16 22:46:01.863806] INFO [obproxy docker on 10.10.100.9 is removed]
[2023-06-16 22:46:01.868778] INFO [CLEAR_COMPONENT: obproxy DONE  ######################################]
[2023-06-16 22:46:01.873368] INFO [CLEAR_COMPONENT: ocp START  ######################################]
cp: '/root/t-oceanbase-antman/uninstall.sh' and '/root/t-oceanbase-antman/uninstall.sh' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/obcluster.conf' and '/root/t-oceanbase-antman/obcluster.conf' are the same file
skip copy same file
cp: '/root/t-oceanbase-antman/common/utils.sh' and '/root/t-oceanbase-antman/common/utils.sh' are the same file
skip copy same file
grep: /etc/system-release: No such file or directory
[2023-06-16 22:46:01.906934] INFO [remove ocp docker on host:10.10.100.9]
[2023-06-16 22:46:01.944811] INFO [docker rm -f 8b044744a92e]
8b044744a92e
[2023-06-16 22:46:26.162467] INFO [remove ocp docker on host:10.10.100.9 done]
[2023-06-16 22:46:26.253927] INFO [uninstall.sh ocp  finished and reg.docker.alibaba-inc.com/oceanbase/ocp-all-in-one:3.3.3-20220906114643 removed on 10.10.100.9]
[2023-06-16 22:46:26.258281] INFO [ocp docker on 10.10.100.9 is removed]
[2023-06-16 22:46:26.263047] INFO [CLEAR_COMPONENT: ocp DONE  ######################################]
ocp1a:~/t-oceanbase-antman # docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

报错记录及处理:

  • manage脚本执行报错
55obffocp:~/t-oceanbase-antman # ./manage.sh -i ob,ocp,obproxy -l 133.55.22.19 -z 1 -R Jnydzycscc@123 -A OceanBase#123
[2023-06-16 16:31:03.305062] INFO [check conf file /root/t-oceanbase-antman/obcluster.conf format ...]
[2023-06-16 16:31:03.309079] INFO [conf file is upper case format.]
[2023-06-16 16:31:03.315290] INFO [SSH_AUTH=password SSH_USER=root SSH_PORT=22 SSH_PASSWORD= SSH_KEY_FILE=/root/.ssh/id_rsa]
LB_MODE=f5
INSTALL_COMPONENTS componets: ob obproxy ocp
CLEAR_COMPONENTS: 
IP_LIST: 133.55.22.19
ZONE_LIST: 1
ROOT_PASSWORD_LIST: Jnydzycscc@123
ADMIN_PASSWORD_LIST: OceanBase#123
/root/t-oceanbase-antman/common/utils.sh: line 484: -e: command not found
[2023-06-16 16:31:03.636862] ERROR [: ssh authorization to 133.55.22.19 failed, Please check SSH affinity environment varialbes.]

######这个问题也需要修改脚本代码解决#########

1686990138

  • 执行alter system delete server 命令之后很久被替换的server没有delete掉,一直是deleting状态,检查发现ocp的meta库内存参数调整过,新加的server参数小,导致unit迁移卡住。
MySQL [oceanbase]> select svr_ip, zone, with_rootserver, status, start_service_time from __all_server;
+--------------+----------------+-----------------+----------+--------------------+
| svr_ip       | zone           | with_rootserver | status   | start_service_time |
+--------------+----------------+-----------------+----------+--------------------+
| 10.10.100.87 | META_OB_ZONE_2 |               1 | active   |   1679279220991796 |
| 10.10.100.9  | META_OB_ZONE_1 |               0 | deleting |   1679275725595691 |
| 122.44.11.2  | META_OB_ZONE_3 |               0 | active   |   1640097866698859 |
| 133.55.22.19 | META_OB_ZONE_1 |               0 | active   |   1686908200404755 |
+--------------+----------------+-----------------+----------+--------------------+
4 rows in set (0.01 sec)MySQL [oceanbase]> select count(*),svr_ip from  gv$unit  group by svr_ip;
+----------+--------------+
| count(*) | svr_ip       |
+----------+--------------+
|       27 | 133.55.22.19 |
|       33 | 10.10.100.87 |
|       33 | 122.44.11.2  |
|        6 | 10.10.100.9  |
+----------+--------------+
4 rows in set (0.01 sec)
MySQL [oceanbase]> select *   from  gv$unit   where  svr_ip='10.10.100.9';
+---------+----------------+---------------------------------------------+------------------+----------------------------------------+----------------+-----------+-------------+-------------+----------+---------------------+-----------------------+---------+---------+-------------+-------------+----------+----------+---------------+-----------------+
| unit_id | unit_config_id | unit_config_name                            | resource_pool_id | resource_pool_name                     | zone           | tenant_id | tenant_name | svr_ip      | svr_port | migrate_from_svr_ip | migrate_from_svr_port | max_cpu | min_cpu | max_memory  | min_memory  | max_iops | min_iops | max_disk_size | max_session_num |
+---------+----------------+---------------------------------------------+------------------+----------------------------------------+----------------+-----------+-------------+-------------+----------+---------------------+-----------------------+---------+---------+-------------+-------------+----------+----------+---------------+-----------------+
|    1106 |           1090 | config_oms_tt_tenant_META_OB_ZONE_1_S2_gpa  |             1080 | pool_oms_tt_tenant_META_OB_ZONE_1_gpa  | META_OB_ZONE_1 |      NULL | NULL        | 10.10.100.9 |     2882 |                     |                     0 |       3 |       3 | 12884901888 | 12884901888 |     2500 |     2500 |  536870912000 |             750 |
|    1139 |           1094 | oms_unit                                    |             1129 | oms_ff9_tenant_resource_pool           | META_OB_ZONE_1 |      NULL | NULL        | 10.10.100.9 |     2882 |                     |                     0 |       2 |       2 |  5368709120 |  4294967296 |      128 |      128 |    5368709120 |           10000 |
|    1122 |           1097 | config_oms_c55_tenant_META_OB_ZONE_1_S1_ifu |             1088 | pool_oms_c55_tenant_META_OB_ZONE_1_ifu | META_OB_ZONE_1 |      NULL | NULL        | 10.10.100.9 |     2882 |                     |                     0 |     1.5 |     1.5 |  6442450944 |  6442450944 |     1250 |     1250 |  536870912000 |             375 |
|    1126 |           1100 | config_oms_ff6_tenant_META_OB_ZONE_1_S1_uzz |             1092 | pool_oms_ff6_tenant_META_OB_ZONE_1_uzz | META_OB_ZONE_1 |      NULL | NULL        | 10.10.100.9 |     2882 |                     |                     0 |     1.5 |     1.5 |  6442450944 |  6442450944 |     1250 |     1250 |  536870912000 |             375 |
|    1127 |           1101 | config_oms_ff7_tenant_META_OB_ZONE_1_S1_gkj |             1093 | pool_oms_ff7_tenant_META_OB_ZONE_1_gkj | META_OB_ZONE_1 |      NULL | NULL        | 10.10.100.9 |     2882 |                     |                     0 |     1.5 |     1.5 |  6442450944 |  6442450944 |     1250 |     1250 |  536870912000 |             375 |
|    1135 |           1108 | config_oms_cc8_tenant_META_OB_ZONE_1_S1_wwo |             1101 | pool_oms_cc8_tenant_META_OB_ZONE_1_wwo | META_OB_ZONE_1 |      NULL | NULL        | 10.10.100.9 |     2882 |                     |                     0 |     1.5 |     1.5 |  6442450944 |  6442450944 |     1250 |     1250 |  536870912000 |             375 |
+---------+----------------+---------------------------------------------+------------------+----------------------------------------+----------------+-----------+-------------+-------------+----------+---------------------+-----------------------+---------+---------+-------------+-------------+----------+----------+---------------+-----------------+
6 rows in set (0.02 sec)MySQL [oceanbase]> alter  system migrate unit=1106 destination='133.55.22.19:2882';
ERROR 4624 (HY000): machine resource is not enough to hold a new unit              ----------------手动去迁移报资源不足MySQL [oceanbase]> select zone,svr_ip, cpu_total, cpu_assigned,cpu_assigned_percent cpu_ass_pct, round(mem_total/1024/1024/1024) mem_total_gb,->        round(mem_assigned/1024/1024/1024) mem_ass_gb, mem_assigned_percent mem_ass_pct, unit_num, migrating_unit_num, leader_count, round(`load`,2) `load`-> from __all_virtual_server_stat-> order by zone, svr_ip;                                ---------------------检查资源发现内存不足
+----------------+--------------+-----------+--------------+-------------+--------------+------------+-------------+----------+--------------------+--------------+------+
| zone           | svr_ip       | cpu_total | cpu_assigned | cpu_ass_pct | mem_total_gb | mem_ass_gb | mem_ass_pct | unit_num | migrating_unit_num | leader_count | load |
+----------------+--------------+-----------+--------------+-------------+--------------+------------+-------------+----------+--------------------+--------------+------+
| META_OB_ZONE_1 | 10.10.100.9  |        62 |           11 |          17 |          250 |         40 |          16 |        6 |                  0 |            0 | 0.17 |
| META_OB_ZONE_1 | 133.55.22.19 |        62 |           48 |          77 |          204 |        196 |          96 |       27 |                  0 |            0 | 0.87 |
| META_OB_ZONE_2 | 10.10.100.87 |        62 |           59 |          95 |          250 |        236 |          94 |       33 |                  0 |         2935 | 0.95 |
| META_OB_ZONE_3 | 122.44.11.2  |        62 |           59 |          95 |          250 |        236 |          94 |       33 |                  0 |         1051 | 0.95 |MySQL [oceanbase]> show parameters  like  '%memory_limit%';
| META_OB_ZONE_3 | observer | 122.44.11.2  |     2882 | memory_limit                        | NULL      | 300G  | the size of the memory reserved for internal use(for testing purpose). Range: [0M,)                                                                                                                                                    | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| META_OB_ZONE_1 | observer | 133.55.22.19 |     2882 | memory_limit                        | NULL      | 254G  | the size of the memory reserved for internal use(for testing purpose). Range: [0M,)                                                                                                                                                    | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| META_OB_ZONE_2 | observer | 10.10.100.87 |     2882 | memory_limit                        | NULL      | 300G  | the size of the memory reserved for internal use(for testing purpose). Range: [0M,)                                                                                                                                                    | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| META_OB_ZONE_1 | observer | 10.10.100.9  |     2882 | memory_limit                        | NULL      | 300G  | the size of the memory reserved for internal use(for testing purpose). Range: [0M,)                                                                                                                                                    | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |MySQL [oceanbase]> alter   system  set   memory_limit ='300G'  ;
Query OK, 0 rows affected (0.05 sec)MySQL [oceanbase]> select count(*),svr_ip from  gv$unit  group by svr_ip;
+----------+--------------+
| count(*) | svr_ip       |
+----------+--------------+
|       33 | 133.55.22.19 |
|       33 | 10.10.100.87 |
|       33 | 122.44.11.2  |
+----------+--------------+
3 rows in set (0.00 sec)MySQL [oceanbase]> select svr_ip, zone, with_rootserver, status, start_service_time from __all_server;
+--------------+----------------+-----------------+--------+--------------------+
| svr_ip       | zone           | with_rootserver | status | start_service_time |
+--------------+----------------+-----------------+--------+--------------------+
| 10.10.100.87 | META_OB_ZONE_2 |               1 | active |   1679279220991796 |
| 122.44.11.2  | META_OB_ZONE_3 |               0 | active |   1640097866698859 |
| 133.55.22.19 | META_OB_ZONE_1 |               0 | active |   1686908200404755 |
+--------------+----------------+-----------------+--------+--------------------+
3 rows in set (0.00 sec)

总结:

到这里使用antman脚本的方式去替换ocp机器的操作就结束了,包括前面一篇使用oat替换ocp节点的文章可能看起来没什么难度,但是整个过程来回做了好几遍,为了别人以后少踩坑,所以写了这两篇文章分享。如果看了上篇文章的话应该知道oat替换ocp的时候,新加机器是在metadb中新创建了一个zone,然后再把被替换机器下掉,其中还涉及新建资源池修改Locality,增加副本数等操作。其实使用antman脚本的话这个步骤就不太一样,他是将新机器加入到需要替换机器的同一个zone内,然后做同zone内unit的迁移,然后把被替换的机器下线,现阶段的话,相对来说antman替换之后对于ocp的元数据的影响小一些,但是oat黑屏的操作少些,对于obproxy单独docker的前期场景必须使用antman,后期版本就看大家自己酌情选择了。

行之所向,莫问远方。

相关文章:

如何替换OCP节点(二):使用 antman脚本 | OceanBase应用实践

前言: OceanBase Cloud Platform(简称OCP),是 OceanBase数据库的专属企业级数据库管理平台。 在实际生产环境中,OCP的安装通常是第一步,先搭建OCP平台,进而依赖OCP来创建、管理和监控我们的生…...

15.JVM垃圾收集算法

一、垃圾收集算法 1.分代收集理论 分代收集理论是JAVA虚拟机进行垃圾回收的一种思想,根据对象存活周期的不同将内存分成不同的几个区域;一般将JAVA堆内存分为新生代和老年代;根据每个分代特点选择不同的垃圾收集器; 在新生代中&am…...

软件工程:图书管理系统甘特图

1 实验目的 熟悉GanttProject 软件环境,能够使用GanttProject绘制甘特图,进行项目管理与规划。 2 实验内容 为小型图书管理系统项目的实施计划绘制甘特图。 小型图书管理系统项目包含登录、浏览、管理读者、管理图书资料、管理书目、登记借书、登记还书、预定图书、…...

视频的编解码格式

文章目录 视频的编解码格式概念术语视频处理流程视频封装格式视频编码格式视频编解码器,视频容器和视频文件格式之间的区别补充视频码率 参考资料 视频的编解码格式 概念术语 两大组织主导视频压缩的组织及其联合(joint)组织 ITU-T(VCEG) ITU-T的中文名称是国际电信…...

网络资源模板--Android Studio 实现简易新闻App

目录 一、项目演示 二、项目测试环境 三、项目详情 四、完整的项目源码 一、项目演示 网络资源模板--基于Android studio 实现的简易新闻App 二、项目测试环境 三、项目详情 登录页 用户输入: 提供账号和密码输入框,用户可以输入登录信息。支持“记…...

LabVIEW提高开发效率技巧----离线调试

离线调试是LabVIEW开发中一项重要的技巧,通过使用Simulate Signal Express VI生成虚拟数据,开发者能够有效减少对实际硬件的依赖,加速开发过程。这种方法不仅可以提高开发效率,还能降低成本,增强系统的灵活性。 ​ 离…...

6N137S1取反电路图

文章目录 一、前言二、6N137S1性能介绍三、应用电路图 一、前言 在硬件电路设计中需要用到隔离电路,但此引脚输出为WS2812的信号,频率有840khz,所以需要使用逻辑光耦,选用6N137S1光耦,速率能达到10Mhz,能满…...

Nullinux:一款针对Linux操作系统的安全检测工具

关于Nullinux Nullinux是一款针对Linux操作系统的安全检测工具,广大研究人员可以利用该工具针对Linux目标设备执行网络侦查和安全检测。 该工具可以通过SMB枚举目标设备的安全状况信息,其中包括操作系统信息、域信息、共享信息、目录信息和用户信息。如…...

学会这 5 个 AI 神器做字体设计,保证让你私单接到爆!

最近我在浏览 AI 绘画的相关内容时,发现不少图像都是与字体相关的,而且其中一些呈现出的艺术特效很是让人眼前一亮。 放在之前,我们需要掌握一些专业技能、并花费大量时间才能设计出精致酷炫的艺术字,但是现在却可以轻松用文本直…...

《Vue3 踩坑》expose 和 defineExpose 暴露属性或方法注意事项

选项式写法 使用 选项式API - 状态选项 - expose 一定要注意: 接下来,进一步看示例说明: 设置 expose 仅显示列出的属性/方法才能被父组件调用;代码第 2 行,父组件可访问属性 a 和 方法 myFunc01,不可访…...

10.13论文阅读

通过联合学习检测和描述关键点增强可变形局部特征 摘要 局部特征提取是计算机视觉中处理图像匹配和检索等关键任务的常用方法。大多数方法的核心理念是图像经历仿射变换,忽略了诸如非刚性形变等更复杂的效果。此外,针对非刚性对应的新兴工作仍然依赖于…...

六西格玛黑带项目:TBX-02无人机飞行稳定性提升——张驰咨询

一、项目背景与问题定义 TBX-02是该公司最新发布的消费级无人机,面向摄影爱好者和户外探险者。产品上市后,通过客户反馈和实际测试数据发现,该无人机在复杂飞行环境中,如强风或快速移动时,存在明显的飞行抖动和稳定性…...

git clone 国内镜像

比如 git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM.git 改成 git clone https://gitclone.com/github.com/HKUST-Aerial-Robotics/A-LOAM.git...

【服务器虚拟化】

服务器虚拟化是一种将一台物理服务器划分为多个虚拟服务器的技术,每个虚拟服务器都可以独立运行操作系统和应用程序。下面是一个详细的教程,以KVM虚拟化为例,介绍了具体的操作步骤和执行命令。 准备工作 a. 确保你的服务器支持虚拟化技术&…...

【RAG】aiops第一名方案-EasyRAG:自动网络运营的高效检索增强生成框架

来看一个RAG比赛方案,提出了一个名为EasyRAG的框架,用于自动化网络操作的检索增强生成。该框架旨在解决网络操作中信息检索和生成效率低、准确性差的问题。研究难点包括:如何在保证准确性的前提下提高检索和生成的效率;如何实现简…...

3款备受好评的电脑数据恢复软件,赶紧收藏以备不时之需

在日常工作和生活中,电脑数据丢失是许多人都会遇到的问题。无论是误删文件、硬盘格式化,还是系统崩溃,都可能导致重要数据的丢失。所以,好用的数据恢复软件必不可少。 但在如今的市场上数据恢复软件琳琅满目,它们在恢复…...

.net core 实现多线程方式有哪些

在 .NET Core 中,有多种方式可以实现多线程编程。这些方式包括使用 Thread 类、Task 和 Parallel 类库。每种方法都有其适用场景和优缺点。下面我将通过代码示例来展示这些不同的多线程实现方式。 1. 使用 Thread 类 Thread 类是 .NET 中最基本的多线程实现方式。…...

《Linux从小白到高手》综合应用篇:深入理解Linux磁盘及IO优化

1. 前言 其实磁盘优化和IO优化,我在前面的其他Linux调优博文中已经讲述过或者涉及过了,但是太过零碎,所以本篇就来集中深入讨论下Linux磁盘和IO调优。 2.磁盘调优 结合我多年的经验,本人认为磁盘调优最重要的是读写性能的提升和…...

【Linux】内存文件系统的I/O、重定向

文章目录 1. 系统中的文件2. 回顾C中的文件接口3. 文件类的系统调用3.1 open3.2 文件描述符 4. IO的基本过程5.重定向5.1 引入重定向5.2 系统中的重定向接口 6. 缓冲区问题7. 简单版shell的实现 1. 系统中的文件 在学习完Linux权限后,我们清楚的知道:文…...

力扣10.18

1463. 摘樱桃 II 给你一个 rows x cols 的矩阵 grid 来表示一块樱桃地。 grid 中每个格子的数字表示你能获得的樱桃数目。 你有两个机器人帮你收集樱桃,机器人 1 从左上角格子 (0,0) 出发,机器人 2 从右上角格子 (0, cols-1) 出发。 请你按照如下规则…...

cs木马图形化界面出现问题处理

一个月多月没用cs木马了,发现打开客户端之后显示不出图形化界面,且出现下面这样的报错。 、 最后发现是java版本的问题,kali的java自动更新了。把原来的openjdk11改到了openjdk23。 解决方法: 输入: sudo update-…...

数据结构与算法 - 树 #数的概念 #二叉树 #堆 - 堆的实现/堆排序/TOP-K问题

文章目录 前言 一、树 (一)、概念 1、树的定义 (二)、树的定义 1、树为什么是递归定义的? 2、如何定义树(如何表达一棵树) 解决方案一:假设我们得知该树的度 解决方案二:顺序表 解决方案三:左孩子右兄弟表示法 二、二叉…...

Git推送被拒

今天开发完成一个新的需求,将自己的分支合并到test分支后,推送到远程仓库,结果显示推送被拒: 原因是因为有人更新了test分支的代码,我在合并之前没有拉取最新的test分支代码,所以他提示我“推送前需要合并…...

Jmeter进行http接口测试

🍅 点击文末小卡片 ,免费获取软件测试全套资料,资料在手,涨薪更快 本文主要针对http接口进行测试,使用jmeter工具实现。 Jmeter工具设计之初是用于做性能测试的,它在实现对各种接口的调用方面已经做的比较…...

工业相机详解及选型

工业相机相对于传统的民用相机而言,具有搞图像稳定性,传输能力和高抗干扰能力等,目前市面上的工业相机大多数是基于CCD(Charge Coupled Device)或CMOS(Complementary Metal Oxide Semiconductor)芯片的相机。 一,工业相机的分类 …...

RAID 矩阵

在架构设计中,RAID矩阵(RAID Log)是一个用于项目管理和风险管理的工具,帮助团队有效管理和跟踪项目中可能影响成功交付的关键因素。与存储技术中的 RAID 不同,这里的 RAID 是一个缩写,代表: R:…...

详细分析Redisson分布式锁中的renewExpiration()方法

目录 一、Redisson分布式锁的续期 整体分析 具体步骤和逻辑分析 为什么需要递归调用? 定时任务的生命周期? 一、Redisson分布式锁的续期 Redisson是一个基于Redis的Java分布式锁实现。它允许多个进程或线程之间安全地共享资源。为了实现这一点&…...

实验3,网络地址转换

实验3:网络地址转换 实验目的及要求: 通过实验,掌握NAT技术的工作原理,了解三种不同类型NAT技术的主要作用以及各自的主要应用环境。能够完成静态NAT和复用NAT技术的应用,并熟练掌握NAT技术相关的配置命令。 实验设…...

Java 中的 String 字符串是不可变的

文章目录 什么是不可变字符串?举个例子直观理解 不可变的原理1. 内部实现2. 字符串常量池3. 线程安全 为什么要设计成不可变?什么时候用可变字符串?示例 总结推荐阅读文章 在 Java 编程中,字符串(String)是…...

计算机网络架构实例

小型企业网络 1. 终端设备: - 员工的台式电脑和笔记本电脑,用于日常办公,如文档处理、邮件收发、业务软件使用等。 - 智能手机和平板电脑,方便员工在外出或移动办公时也能接入公司网络,查看邮件和处理紧急事务。 2.…...