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

[ERROR] ocp-server-ce-py_script_start_check-4.2.1 RuntimeError: ‘tenant_name‘

Oceanbase 安装成功后关闭OCP,在重新启动时报错

使用OBD 启动OCP报如下错误

[admin@obd ~]$ obd cluster start ocp
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start ocp-server x
[ERROR] ocp-server-ce-py_script_start_check-4.2.1 RuntimeError: 'tenant_name'
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 02d391f8-9a97-11ee-8034-000c291a63cd
If you want to view detailed obd logs, please run: obd display-trace 02d391f8-9a97-11ee-8034-000c291a63cd

查看报错日志:

使用  more /home/admin/.obd/log/obd 或报错日志中的 obd display-trace 02d391f8-9a97-11ee-8034-000c291a63cd 查看报错日志

[2023-12-12 19:23:23.870] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR] ocp-server-ce-py_script_start_check-4.2.1 RuntimeError: 'tenant_name'
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR] Traceback (most recent call last):
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]   File "core.py", line 1673, in start_cluster
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]   File "core.py", line 1743, in _start_cluster
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]   File "core.py", line 184, in call_plugin
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]   File "_plugin.py", line 324, in __call__
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]   File "_plugin.py", line 286, in _new_func
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]   File "/home/admin/.obd/plugins/ocp-server-ce/4.2.1/start_check.py", line 318, in start_check
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]     error('tenant', err.EC_OCP_SERVER_TENANT_ALREADY_EXISTS.format({"tenant_name":monitor_tenant}))
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR]   File "_errno.py", line 50, in format
[2023-12-12 19:23:23.871] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR] KeyError: 'tenant_name'
[2023-12-12 19:23:23.872] [dbde7188-98e0-11ee-9459-000c291a63cd] [ERROR] 

处理方法:

编辑 /home/admin/.obd/plugins/ocp-server-ce/4.2.1/start_check.py  Python文件 318 上方的skip_create_tenant强制赋值为True,并注释掉如下两行,保存文件。

304                 #skip_create_tenant = 'False'
305                 #skip_create_tenant = getattr(options, "skip_create_tenant", "False")

vi /home/admin/.obd/plugins/ocp-server-ce/4.2.1/start_check.py

303                 # tenant check
304                 #skip_create_tenant = 'False'
305                 #skip_create_tenant = getattr(options, "skip_create_tenant", "False")
306                 skip_create_tenant = 'True'
307                 if skip_create_tenant == 'False':
308                     sql = "select * from oceanbase.DBA_OB_TENANTS where TENANT_NAME = %s"
309                     meta_tenant = server_config.get('ocp_meta_tenant')['tenant_name']
310                     meta_max_cpu = server_config['ocp_meta_tenant'].get('max_cpu', 2)
311                     meta_memory_size = server_config['ocp_meta_tenant'].get('memory_size', '2G')
312                     if server_config.get('ocp_monitor_tenant'):
313                         monitor_user = server_config.get('ocp_monitor_username', 'monitor_user')
314                         monitor_tenant = server_config['ocp_monitor_tenant']['tenant_name']
315                         monitor_max_cpu = server_config['ocp_monitor_tenant'].get('max_cpu', 2)
316                         monitor_memory_size = server_config['ocp_monitor_tenant'].get('memory_size',     '4G')
317                         res = cursor.fetchone(sql, [monitor_tenant])
318                         if res:
319                             error('tenant', err.EC_OCP_SERVER_TENANT_ALREADY_EXISTS.format({"tenant_    name":monitor_tenant}))
320                     res = cursor.fetchone(sql, [meta_tenant])
321                     if res:
322                         error('tenant', err.EC_OCP_SERVER_TENANT_ALREADY_EXISTS.format({"tenant_name    ":meta_tenant}))
323                     break

然后 输入如下命令可以正常启动了

 obd cluster start ocp

http://www.lryc.cn/news/261565.html

相关文章:

  • 模拟实验中经常遇到的问题和常用技巧
  • 微信小程序(二) ——模版语法1
  • 牛客小白月赛83 解题报告
  • 蓝桥杯专题-真题版含答案-【三角螺旋阵】【干支记年法】【异或加密法】【金字塔】
  • 鸿蒙篇——初次使用鸿蒙原生编译器DevEcoStudio创建一个鸿蒙原生应用遇到的坑--汇总(持续更新)
  • 细胞培养之一二三:哺乳动物细胞培养污染问题和解决方案
  • 《Linux C编程实战》笔记:文件属性操作函数
  • linux中的网络知识
  • tp中的调试模式
  • 【docker 】基于Dockerfile创建镜像
  • C# 提取PDF中指定文本、图片的坐标
  • CTF网络安全大赛是干什么的?发展史、赛制、赛程介绍,参赛需要学什么?
  • 阿里云SMC迁移RedHat/CentOS 5 内核升级
  • 无代码开发让合利宝支付与CRM无缝API集成,提升电商用户运营效率
  • 数据标注公司如何确保数据安全?景联文科技多维度提供保障
  • (C语言)精确计算程序运行时间的方法
  • 【Vulnhub 靶场】【VulnCMS: 1】【简单】【20210613】
  • 普冉(PUYA)单片机开发笔记(10): I2C通信-配置从机
  • Idea maven打包时 报错 illegalArgumentException: Malformed \uxxxx encoding 解决方法
  • Qt中槽函数在那个线程执行的探索和思考
  • C++ 类模板
  • 边缘计算系统设计与实践
  • 【Spark精讲】Spark存储原理
  • 贪心算法:买卖股票的最佳时机II 跳跃游戏 跳跃游戏II
  • 音频DAC,ADC,CODEC的选型分析,高性能立体声
  • python 连接SQL server 请用pymssql连接,千万别用pyodbc
  • IntelliJ IDEA 自带HTTP Client接口插件上传文件示例
  • C++中的接口有什么用
  • el-table合并相同数据的单元格
  • Verilog Systemverilog define宏定义