init metadb structure failed

【 使用环境 】 测试环境
【 OB or 其他组件 】OCP
【 使用版本 】OCP334
【问题描述】安装产品OCP时,在init_ocp_meta这一步报错init metadb structure failed
【复现路径】产品服务-产品-创建OCP-提交
【附件及日志】
[2025-01-06T17:56:36.983+0800] INFO - Dependencies all met for <TaskInstance: init_ocp.init_ocp_meta manual__2025-01-06T09:55:06.125776+00:00 [queued]>

2

[2025-01-06T17:56:37.015+0800] INFO - Dependencies all met for <TaskInstance: init_ocp.init_ocp_meta manual__2025-01-06T09:55:06.125776+00:00 [queued]>

3

[2025-01-06T17:56:37.016+0800] INFO -

4


5

[2025-01-06T17:56:37.016+0800] INFO - Starting attempt 1 of 1

6

[2025-01-06T17:56:37.017+0800] INFO -

7


8

[2025-01-06T17:56:37.051+0800] INFO - Executing <Task(_PythonDecoratedOperator): init_ocp_meta> on 2025-01-06 09:55:06.125776+00:00

9

[2025-01-06T17:56:37.059+0800] INFO - Started process 28068 to run task

10

[2025-01-06T17:56:37.071+0800] INFO - Running: [‘airflow’, ‘tasks’, ‘run’, ‘init_ocp’, ‘init_ocp_meta’, ‘manual__2025-01-06T09:55:06.125776+00:00’, ‘–job-id’, ‘130’, ‘–raw’, ‘–subdir’, ‘DAGS_FOLDER/init_ocp.py’, ‘–cfg-path’, ‘/tmp/tmp8zypong8’]

11

[2025-01-06T17:56:37.077+0800] INFO - Job 130: Subtask init_ocp_meta

12

[2025-01-06T17:56:37.404+0800] INFO - Running <TaskInstance: init_ocp.init_ocp_meta manual__2025-01-06T09:55:06.125776+00:00 [running]> on host localhost.localdomain

13

[2025-01-06T17:56:37.598+0800] INFO - Exporting the following env vars:

14

AIRFLOW_CTX_DAG_OWNER=airflow

15

AIRFLOW_CTX_DAG_ID=init_ocp

16

AIRFLOW_CTX_TASK_ID=init_ocp_meta

17

AIRFLOW_CTX_EXECUTION_DATE=2025-01-06T09:55:06.125776+00:00

18

AIRFLOW_CTX_TRY_NUMBER=1

19

AIRFLOW_CTX_DAG_RUN_ID=manual__2025-01-06T09:55:06.125776+00:00

20

[2025-01-06T17:56:37.643+0800] INFO - meta tenant is {‘host’: ‘’, ‘port’: 2883, ‘user’: 'root@#MetaDB1’, ‘password’: ‘*@123’}

21

monitor tenant is {‘host’: ‘’, ‘port’: 2883, ‘user’: 'root@#MetaDB1’, ‘password’: ‘*@123’}

22

[2025-01-06T17:56:37.644+0800] INFO - start run create_metadb.py on server 1

23

[2025-01-06T17:56:37.646+0800] INFO - Running statement: select oat_server.id, oat_credential.id as credential_id, ip, ssh_port, username, password, auth_type, key_data, passphrase from oat_server, oat_credential where oat_server.credential_id=oat_credential.id and oat_server.id=%s, parameters: [1]

24

[2025-01-06T17:56:37.649+0800] INFO - Rows affected: 1

25

[2025-01-06T17:56:37.678+0800] INFO - Connected (version 2.0, client OpenSSH_7.4)

26

[2025-01-06T17:56:37.836+0800] INFO - Authentication (password) successful!

27

[2025-01-06T17:56:37.837+0800] INFO - execute command on *:

28

docker run --rm --net=host --workdir=/home/admin/ocp-init/src/ocp-init \

29

–entrypoint=python reg.docker.alibaba-inc.com/oceanbase/ocp-all-in-one:3.3.4-20221202162515 \

30

create_metadb.py \

31

2883 root@#MetaDB1 @123 ocp root@#MetaDB1@123 ocp_monitor

32

33

[2025-01-06T17:56:39.220+0800] INFO - create_metadb.py:20: YAMLLoadWarning: calling yaml.load() without Loader=… is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

34

[2025-01-06T17:56:39.220+0800] INFO - data = yaml.load(file)

35

[2025-01-06T17:56:39.335+0800] INFO - Generated yml file:

36

[2025-01-06T17:56:39.336+0800] INFO -

37

[2025-01-06T17:56:39.337+0800] INFO - OcpInitParameter:

38

[2025-01-06T17:56:39.337+0800] INFO - METADB:

39

[2025-01-06T17:56:39.338+0800] INFO - ip: &metadb_ip *

40

[2025-01-06T17:56:39.338+0800] INFO - username: &metadb_username root@*#MetaDB1

41

[2025-01-06T17:56:39.338+0800] INFO - password: &metadb_password ‘*@123

42

[2025-01-06T17:56:39.339+0800] INFO - port: &metadb_port 2883

43

[2025-01-06T17:56:39.339+0800] INFO - dbname: &metadb_dbname ocp

44

[2025-01-06T17:56:39.340+0800] INFO - MONITORDB:

45

[2025-01-06T17:56:39.340+0800] INFO - ip: &monitordb_ip *

46

[2025-01-06T17:56:39.341+0800] INFO - username: &monitordb_username root@*#MetaDB1

47

[2025-01-06T17:56:39.341+0800] INFO - password: &monitordb_password ‘*@123

48

[2025-01-06T17:56:39.341+0800] INFO - port: &monitordb_port 2883

49

[2025-01-06T17:56:39.342+0800] INFO - dbname: &monitordb_dbname ocp_monitor

50

[2025-01-06T17:56:39.342+0800] INFO - CONFIGURATION:

51

[2025-01-06T17:56:39.343+0800] INFO - ocp.monitordb.host: *monitordb_ip

52

[2025-01-06T17:56:39.343+0800] INFO - ocp.monitordb.port: *monitordb_port

53

[2025-01-06T17:56:39.344+0800] INFO - ocp.monitordb.username: *monitordb_username

54

[2025-01-06T17:56:39.344+0800] INFO - ocp.monitordb.password: *monitordb_password

55

[2025-01-06T17:56:39.344+0800] INFO - ocp.monitordb.database: *monitordb_dbname

56

[2025-01-06T17:56:39.345+0800] INFO - ocp.iam.auth: local

57

[2025-01-06T17:56:39.345+0800] INFO - backup.dbname.prefix: &backup_dbname_prefix backup

58

[2025-01-06T17:56:39.346+0800] INFO -

59

[2025-01-06T17:56:39.346+0800] INFO - start create database ocp

60

[2025-01-06T17:56:39.349+0800] INFO - No handlers could be found for logger “root”

61

[2025-01-06T17:56:39.349+0800] INFO - Traceback (most recent call last):

62

[2025-01-06T17:56:39.349+0800] INFO - File “create_metadb.py”, line 189, in

63

[2025-01-06T17:56:39.350+0800] INFO - init_ocp(filename)

64

[2025-01-06T17:56:39.350+0800] INFO - File “create_metadb.py”, line 50, in init_ocp

65

[2025-01-06T17:56:39.351+0800] INFO - common.create_db_if_not_exists(meta_db_connect_info)

66

[2025-01-06T17:56:39.351+0800] INFO - File “/home/admin/ocp-init/src/ocp-init/common.py”, line 86, in create_db_if_not_exists

67

[2025-01-06T17:56:39.352+0800] INFO - run_sql_no_result(sql, default_config)

68

[2025-01-06T17:56:39.352+0800] INFO - File “/home/admin/ocp-init/src/ocp-init/common.py”, line 77, in run_sql_no_result

69

[2025-01-06T17:56:39.352+0800] INFO - run_sql(sql, db_config, True)

70

[2025-01-06T17:56:39.353+0800] INFO - File “/home/admin/ocp-init/src/ocp-init/common.py”, line 59, in run_sql

71

[2025-01-06T17:56:39.353+0800] INFO - database=db_config[‘database’], autocommit=True, pool_name=pool_name, pool_size=pool_size, pool_reset_session=False)

72

[2025-01-06T17:56:39.354+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/init.py”, line 162, in connect

73

[2025-01-06T17:56:39.355+0800] INFO - return _get_pooled_connection(**kwargs)

74

[2025-01-06T17:56:39.356+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/init.py”, line 73, in _get_pooled_connection

75

[2025-01-06T17:56:39.356+0800] INFO - _CONNECTION_POOLS[pool_name] = MySQLConnectionPool(**kwargs)

76

[2025-01-06T17:56:39.357+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/pooling.py”, line 165, in init

77

[2025-01-06T17:56:39.357+0800] INFO - self.add_connection()

78

[2025-01-06T17:56:39.357+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/pooling.py”, line 278, in add_connection

79

[2025-01-06T17:56:39.359+0800] INFO - cnx = MySQLConnection(**self._cnx_config)

80

[2025-01-06T17:56:39.360+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/connection.py”, line 104, in init

81

[2025-01-06T17:56:39.360+0800] INFO - self.connect(**kwargs)

82

[2025-01-06T17:56:39.361+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/abstracts.py”, line 781, in connect

83

[2025-01-06T17:56:39.363+0800] INFO - self._open_connection()

84

[2025-01-06T17:56:39.364+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/connection.py”, line 288, in _open_connection

85

[2025-01-06T17:56:39.364+0800] INFO - self._ssl, self._conn_attrs)

86

[2025-01-06T17:56:39.365+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/connection.py”, line 208, in _do_auth

87

[2025-01-06T17:56:39.366+0800] INFO - self._auth_switch_request(username, password)

88

[2025-01-06T17:56:39.367+0800] INFO - File “/usr/lib64/python2.7/site-packages/mysql/connector/connection.py”, line 252, in _auth_switch_request

89

[2025-01-06T17:56:39.368+0800] INFO - raise errors.get_exception(packet)

90

[2025-01-06T17:56:39.368+0800] INFO - mysql.connector.errors.ProgrammingError: 1045 (42000): Access denied for user ‘root’@‘xxx.xxx.xxx.xxx’ (using password: YES)

91

[2025-01-06T17:56:39.668+0800] ERROR - Task failed with exception

92

Traceback (most recent call last):

93

File “/usr/local/lib/python3.9/site-packages/airflow/decorators/base.py”, line 217, in execute

94

return_value = super().execute(context)

95

File “/usr/local/lib/python3.9/site-packages/airflow/operators/python.py”, line 175, in execute

96

return_value = self.execute_callable()

97

File “/usr/local/lib/python3.9/site-packages/airflow/operators/python.py”, line 192, in execute_callable

98

return self.python_callable(*self.op_args, **self.op_kwargs)

99

File “/oat/task_engine/dags/init_ocp.py”, line 147, in init_ocp_meta

100

raise RuntimeError(‘init metadb structure failed’)

101

RuntimeError: init metadb structure failed

102

[2025-01-06T17:56:39.688+0800] INFO - Marking task as FAILED. dag_id=init_ocp, task_id=init_ocp_meta, execution_date=20250106T095506, start_date=20250106T095636, end_date=20250106T095639

103

[2025-01-06T17:56:39.692+0800] INFO - Running statement: update oat_audit set status=‘failed’, update_time=utc_timestamp(), failed_reason=%s where id=%s, parameters: [‘failed task instance is init_ocp__init_ocp_meta__20250106 and exception information is init metadb structure failed’, 32]

104

[2025-01-06T17:56:39.694+0800] INFO - Rows affected: 1

105

[2025-01-06T17:56:39.737+0800] ERROR - Failed to execute job 130 for task init_ocp_meta (init metadb structure failed; 28068)

106

[2025-01-06T17:56:39.780+0800] INFO - Task exited with return code 1

107

[2025-01-06T17:56:39.868+0800] INFO - 0 downstream tasks scheduled from follow-on schedule check

麻烦确认下使用什么部署的OCP?版本是334吗?

根据文档中说的,使用图形化界面部署通过 OAT 部署OCP

版本是334

OAT是企业版工具,社区版部署建议使用OBD,另外334版本太老了,建议使用新版本OCP,可以使用ocp-all-in-one包部署

用的是企业版

从OceanBase 软件下载中心,企业版- 工具产品-OceanBase 云平台提供的下载版本就是334

企业版如何下载高版本的OCP

企业版 建议你通过以下方式寻求帮助:

1.如你所在的企业客户已签署OceanBase企业版销售合同,请你联系客户经理;

2.如你所在的企业客户尚未签署OceanBase企业版销售合同,你可通过OceanBase官网商务咨询页面留下你的联系方式,OceanBase企业版的业务顾问会在一个工作日内与你联系。

OceanBase官网商务咨询

https://www.oceanbase.com/contactus?fromPage=https%3A%2F%2Fwww.oceanbase.com%2Fsoftwarecenter-enterprise&dataSources=softwarecenter-enterprise_footercontact_d2022

另外也欢迎使用社区版