【 使用环境 】测试环境
【 OB or 其他组件 】OBD、observer单机部署
【 使用版本 】2.9.2
【问题描述】使用OBD进行OceanBase 集群的租户角色切换失败,出现[ERROR] Failed to connect standby deploy: testbak.[ERROR] Running Error: ‘NoneType’ object has no attribute ‘value’
【复现路径】目前存在集群test和集群testbak,使用obclient连接两个集群,在集群test创建了租户primary_tenant,在集群testbak创建了空备租户standby_tenant,standby_tenant能够正常同步primary_tenant。使用OBD进行OceanBase 集群的租户角色切换,obd cluster tenant switchover testbak standby_tenant --tenant-root-password=#^123456^#
【附件及日志】
[2024-09-19 11:26:19.465] [DEBUG] - cmd: [‘testbak’, ‘standby_tenant’]
[2024-09-19 11:26:19.465] [DEBUG] - opts: {‘tenant_root_password’: ‘#^123456^#’, ‘standbyro_password’: None}
[2024-09-19 11:26:19.465] [DEBUG] - mkdir /root/.obd/lock/
[2024-09-19 11:26:19.465] [DEBUG] - unknown lock mode
[2024-09-19 11:26:19.465] [DEBUG] - try to get share lock /root/.obd/lock/global
[2024-09-19 11:26:19.465] [DEBUG] - share lock /root/.obd/lock/global
, count 1
[2024-09-19 11:26:19.466] [DEBUG] - mkdir /root/.obd/cluster/
[2024-09-19 11:26:19.466] [DEBUG] - mkdir /root/.obd/config_parser/
[2024-09-19 11:26:19.466] [DEBUG] - try to get exclusive lock /root/.obd/lock/deploy_testbak
[2024-09-19 11:26:19.466] [DEBUG] - exclusive lock /root/.obd/lock/deploy_testbak
, count 1
[2024-09-19 11:26:19.471] [DEBUG] - mkdir /root/.obd/repository
[2024-09-19 11:26:19.471] [DEBUG] - Get local repository oceanbase-ce-4.2.1.8-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.471] [DEBUG] - try to get share lock /root/.obd/lock/mirror_and_repo
[2024-09-19 11:26:19.471] [DEBUG] - share lock /root/.obd/lock/mirror_and_repo
, count 1
[2024-09-19 11:26:19.473] [DEBUG] - Searching get_relation_tenants plugin for components …
[2024-09-19 11:26:19.473] [DEBUG] - Searching get_relation_tenants plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.474] [DEBUG] - mkdir /root/.obd/plugins
[2024-09-19 11:26:19.474] [DEBUG] - Found for oceanbase-ce-py_script_get_relation_tenants-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:26:19.474] [DEBUG] - Searching get_deployment_connections plugin for components …
[2024-09-19 11:26:19.474] [DEBUG] - Searching get_deployment_connections plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.475] [DEBUG] - Found for oceanbase-ce-py_script_get_deployment_connections-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:26:19.475] [DEBUG] - Searching switchover_tenant_pre plugin for components …
[2024-09-19 11:26:19.475] [DEBUG] - Searching switchover_tenant_pre plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.475] [DEBUG] - Found for oceanbase-ce-py_script_switchover_tenant_pre-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:26:19.476] [DEBUG] - Searching switchover_tenant plugin for components …
[2024-09-19 11:26:19.476] [DEBUG] - Searching switchover_tenant plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.476] [DEBUG] - Found for oceanbase-ce-py_script_switchover_tenant-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:26:19.476] [DEBUG] - Searching get_standbys plugin for components …
[2024-09-19 11:26:19.476] [DEBUG] - Searching get_standbys plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.477] [DEBUG] - Found for oceanbase-ce-py_script_get_standbys-4.2.0.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:26:19.477] [DEBUG] - Searching connect plugin for components …
[2024-09-19 11:26:19.477] [DEBUG] - Searching connect plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.477] [DEBUG] - Found for oceanbase-ce-py_script_connect-4.2.1.4 for oceanbase-ce-4.2.1.8
[2024-09-19 11:26:19.478] [INFO] Cluster status check
[2024-09-19 11:26:19.478] [DEBUG] - Searching status plugin for components …
[2024-09-19 11:26:19.478] [DEBUG] - Searching status plugin for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.478] [DEBUG] - Found for oceanbase-ce-py_script_status-3.1.0 for oceanbase-ce-4.2.1.8
[2024-09-19 11:26:19.491] [DEBUG] - host: 172.16.4.30, port: 22, user: root, password: 123456
[2024-09-19 11:26:19.789] [DEBUG] - Call oceanbase-ce-py_script_status-3.1.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.789] [DEBUG] - import status
[2024-09-19 11:26:19.791] [DEBUG] - add status ref count to 1
[2024-09-19 11:26:19.792] [DEBUG] – root@172.16.4.30 execute: cat /root/testbak/run/observer.pid
[2024-09-19 11:26:19.864] [DEBUG] – exited code 0
[2024-09-19 11:26:19.865] [DEBUG] – root@172.16.4.30 execute: ls /proc/24797
[2024-09-19 11:26:19.941] [DEBUG] – exited code 0
[2024-09-19 11:26:19.942] [DEBUG] - sub status ref count to 0
[2024-09-19 11:26:19.942] [DEBUG] - export status
[2024-09-19 11:26:19.943] [DEBUG] - plugin oceanbase-ce-py_script_status-3.1.0 result: True
[2024-09-19 11:26:19.943] [DEBUG] - Call oceanbase-ce-py_script_get_relation_tenants-4.2.0.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.943] [DEBUG] - import get_relation_tenants
[2024-09-19 11:26:19.947] [DEBUG] - add get_relation_tenants ref count to 1
[2024-09-19 11:26:19.947] [DEBUG] - exclusive lock /root/.obd/lock/deploy_testbak
, count 2
[2024-09-19 11:26:19.974] [DEBUG] - sub get_relation_tenants ref count to 0
[2024-09-19 11:26:19.974] [DEBUG] - export get_relation_tenants
[2024-09-19 11:26:19.974] [DEBUG] - plugin oceanbase-ce-py_script_get_relation_tenants-4.2.0.0 result: True
[2024-09-19 11:26:19.974] [DEBUG] - Call oceanbase-ce-py_script_get_deployment_connections-4.2.0.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:19.975] [DEBUG] - import get_deployment_connections
[2024-09-19 11:26:19.975] [DEBUG] - add get_deployment_connections ref count to 1
[2024-09-19 11:26:19.976] [INFO] Get deployment connections
[2024-09-19 11:26:23.108] [DEBUG] - sub get_deployment_connections ref count to 0
[2024-09-19 11:26:23.108] [DEBUG] - export get_deployment_connections
[2024-09-19 11:26:23.108] [DEBUG] - plugin oceanbase-ce-py_script_get_deployment_connections-4.2.0.0 result: True
[2024-09-19 11:26:23.109] [DEBUG] - Call oceanbase-ce-py_script_switchover_tenant_pre-4.2.0.0 for oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2024-09-19 11:26:23.109] [DEBUG] - import switchover_tenant_pre
[2024-09-19 11:26:23.112] [DEBUG] - add switchover_tenant_pre ref count to 1
[2024-09-19 11:26:23.113] [ERROR] Failed to connect standby deploy: testbak.
[2024-09-19 11:26:23.113] [DEBUG] - sub switchover_tenant_pre ref count to 0
[2024-09-19 11:26:23.113] [DEBUG] - export switchover_tenant_pre
[2024-09-19 11:26:23.115] [ERROR] Running Error: ‘NoneType’ object has no attribute ‘value’
[2024-09-19 11:26:23.116] [ERROR] Traceback (most recent call last):
[2024-09-19 11:26:23.116] [ERROR] File “obd.py”, line 246, in do_command
[2024-09-19 11:26:23.116] [ERROR] File “obd.py”, line 1190, in _do_command
[2024-09-19 11:26:23.116] [ERROR] File “core.py”, line 2346, in switchover_tenant
[2024-09-19 11:26:23.116] [ERROR] File “core.py”, line 197, in call_plugin
[2024-09-19 11:26:23.116] [ERROR] File “_plugin.py”, line 348, in call
[2024-09-19 11:26:23.117] [ERROR] File “_plugin.py”, line 322, in _new_func
[2024-09-19 11:26:23.117] [ERROR] AttributeError: ‘NoneType’ object has no attribute ‘value’
[2024-09-19 11:26:23.117] [ERROR]
[2024-09-19 11:26:23.118] [INFO] Trace ID: fde6939c-7679-11ef-ab7f-509a4c0e6ea6
[2024-09-19 11:26:23.118] [INFO] If you want to view detailed obd logs, please run: obd display-trace fde6939c-7679-11ef-ab7f-509a4c0e6ea6
[2024-09-19 11:26:23.119] [DEBUG] - unlock /root/.obd/lock/global
[2024-09-19 11:26:23.120] [DEBUG] - unlock /root/.obd/lock/deploy_testbak
[2024-09-19 11:26:23.120] [DEBUG] - unlock /root/.obd/lock/mirror_and_repo
1 个赞
-
SWITCHOVER/FAILOVER 执行之前可以通过VERIFY命令预检查看看命令返回是不是能通过
用户登录到集群的用户租户下,可对所登录租户执行 VERIFY 命令
/* SWITCHOVER TO PRIMARY VERIFY /
ALTER SYSTEM SWITCHOVER TO PRIMARY VERIFY;
/ ACTIVATE STANDBY VERIFY /
ALTER SYSTEM ACTIVATE STANDBY VERIFY;
/ SWITCHOVER TO STANDBY VERIFY */
ALTER SYSTEM SWITCHOVER TO STANDBY VERIFY;
1 个赞
能够通过sql语句进行切换,我试过;但是通过obd切换就会报错
1 个赞
看看根据这个fde6939c-7679-11ef-ab7f-509a4c0e6ea6搜一下observer.log的日志
如果不行就把两个集群这个时间的段的observer.log日志也发一下
1 个赞
你好问题目前解决了么,如果没有麻烦发一份涵盖了操作期间的ob日志