ARM平台obd启动observer失败

【产品名称】

操作系统:Kylin Linux Advanced Server release V10 (Tercel)

ob版本:oceanbase 社区版3.1.1(克隆的仓库)

【问题描述】

observer通过源码编译安装,构建的debug版本

obdeploy也是源码编译,用的python3.7

pip3 install -r requirements3.txt sh build.sh source /etc/profile.d/obd.sh

obd启动本地实例时,报错 [ERROR] Running Error.

root@ecs-ac3e-0001 ob]# obd cluster deploy c1 -c local.yaml -v - open /root/.obd/version for a+ - cmd: [‘c1’] - opts: {‘config’: ‘local.yaml’, ‘force’: False, ‘unuselibrepo’: None, ‘auto_create_tenant’: None} - Get Deploy by name - mkdir /root/.obd/cluster/ - Get deploy info - judge deploy status - config path is None or not - Create deploy by configuration path - mkdir /root/.obd/cluster/c1 - copy local.yaml /root/.obd/cluster/c1/config.yaml - Get deploy configuration - Search best suitable repository - Search package for components… - Get oceanbase-ce repository - mkdir /root/.obd/repository - mkdir /root/.obd/repository/oceanbase-ce - Search oceanbase-ce package from mirror - mkdir /root/.obd/mirror - mkdir /root/.obd/mirror/remote - mkdir /root/.obd/mirror/local [ERROR] Running Error. Traceback (most recent call last): File “/usr/obd/obd.py”, line 136, in do_command ret = self._do_command(obd) File “/usr/obd/obd.py”, line 364, in _do_command return obd.deploy_cluster(self.cmds[0], self.opts) File “/usr/obd/core.py”, line 787, in deploy_cluster repositories, install_plugins = self.search_components_from_mirrors_and_install(deploy_config) File “/usr/obd/core.py”, line 660, in search_components_from_mirrors_and_install pkgs, repositories, errors = self.search_components_from_mirrors(deploy_config, only_info=False) File “/usr/obd/core.py”, line 215, in search_components_from_mirrors pkg = self.mirror_manager.get_best_pkg(name=component, version=config.version, md5=config.package_hash, fuzzy_match=fuzzy_match, only_info=only_info) File “/usr/obd/_mirror.py”, line 789, in get_best_pkg return self.get_exact_pkg(**pattern) File “/usr/obd/_mirror.py”, line 778, in get_exact_pkg mirrors = self.get_mirrors() File “/usr/obd/_mirror.py”, line 772, in get_mirrors mirros = self.get_remote_mirrors() File “/usr/obd/_mirror.py”, line 764, in get_remote_mirrors meta_data[‘name’] = RemoteMirrorRepository.var_replace(meta_data[‘name’], server_vars) File “/usr/obd/_mirror.py”, line 319, in var_replace return ‘’.join(done) TypeError: sequence item 1: expected str instance, NoneType found

尝试使用observer直接启动成功

[admin@ecs-ac3e-0001 ~]$ cd /data/ob/observer01 && /data/ob/oceanbase/build_debug/src/observer/observer -r 192.168.0.153:2882:2881 -o __min_full_resource_pool_memory=268435456,memory_limit=8G,system_memory=4G,stack_size=512K,cpu_count=16,cache_wash_threshold=1G,workers_per_cpu_quota=10,schema_history_expire_time=1d,net_thread_count=4,sys_bkgd_migration_retry_num=3,minor_freeze_times=10,enable_separate_sys_clog=0,enable_merge_by_turn=False,datafile_size=50G,enable_syslog_recycle=True,max_syslog_file_count=10 -z zone1 -p 2881 -P 2882 -c 1 -d /data/ob/observer01/store -i eth0 -l INFO
/data/ob/oceanbase/build_debug/src/observer/observer -r 192.168.0.153:2882:2881 -o __min_full_resource_pool_memory=268435456,memory_limit=8G,system_memory=4G,stack_size=512K,cpu_count=16,cache_wash_threshold=1G,workers_per_cpu_quota=10,schema_history_expire_time=1d,net_thread_count=4,sys_bkgd_migration_retry_num=3,minor_freeze_times=10,enable_separate_sys_clog=0,enable_merge_by_turn=False,datafile_size=50G,enable_syslog_recycle=True,max_syslog_file_count=10 -z zone1 -p 2881 -P 2882 -c 1 -d /data/ob/observer01/store -i eth0 -l INFO
rs list: 192.168.0.153:2882:2881
optstr: __min_full_resource_pool_memory=268435456,memory_limit=8G,system_memory=4G,stack_size=512K,cpu_count=16,cache_wash_threshold=1G,workers_per_cpu_quota=10,schema_history_expire_time=1d,net_thread_count=4,sys_bkgd_migration_retry_num=3,minor_freeze_times=10,enable_separate_sys_clog=0,enable_merge_by_turn=False,datafile_size=50G,enable_syslog_recycle=True,max_syslog_file_count=10
zone: zone1
mysql port: 2881
rpc port: 2882
cluster id: 1
data_dir: /data/ob/observer01/store
devname: eth0
[admin@ecs-ac3e-0001 observer01]$ mysql -h127.0.0.1 -uroot -P2881
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 3221225472
Server version: 5.7.25 OceanBase 3.1.1 (r1-d01e355c6aa9fa6e60688634c3c93947ca94fddd) (Built Oct 26 2021 17:40:32)


Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MySQL [(none)]> show databases;
ERROR 1146 (42S02): Table 'oceanbase.__all_database' doesn't exist
MySQL [(none)]> show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'database' at line 1
MySQL [(none)]> set session ob_query_timeout=1000000000; alter system bootstrap ZONE 'zone1' SERVER '192.168.0.153:2882' ;
Query OK, 0 rows affected (0.001 sec)


Query OK, 0 rows affected (51.815 sec)
MySQL [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| oceanbase          |
| information_schema |
| mysql              |
| SYS                |
| LBACSYS            |
| ORAAUDITOR         |
| test               |
+--------------------+
7 rows in set (0.007 sec)


MySQL [(none)]> 


推测可能是obd的问题

请将python换成3.8试试

python用到3.10,重新编译obdeploy,一样的报错

[root@ecs-ac3e-0001 ob]# obd cluster deploy c1 -c local.yaml
[ERROR] Running Error.
[root@ecs-ac3e-0001 ob]# obd cluster deploy c1 -c local.yaml -v
- open /root/.obd/version for a+
- cmd: ['c1']
- opts: {'config': 'local.yaml', 'force': False, 'unuselibrepo': None, 'auto_create_tenant': None}
- Get Deploy by name
- mkdir /root/.obd/cluster/
- Get deploy info
- judge deploy status
- config path is None or not
- Create deploy by configuration path
- mkdir /root/.obd/cluster/c1
- copy local.yaml /root/.obd/cluster/c1/config.yaml
- Get deploy configuration
- Search best suitable repository
- Search package for components...
- Get oceanbase-ce repository
- mkdir /root/.obd/repository
- mkdir /root/.obd/repository/oceanbase-ce
- Search oceanbase-ce package from mirror
- mkdir /root/.obd/mirror
- mkdir /root/.obd/mirror/remote
- mkdir /root/.obd/mirror/local
[ERROR] Running Error.
Traceback (most recent call last):
  File "/usr/obd/obd.py", line 136, in do_command
    ret = self._do_command(obd)
  File "/usr/obd/obd.py", line 364, in _do_command
    return obd.deploy_cluster(self.cmds[0], self.opts)
  File "/usr/obd/core.py", line 787, in deploy_cluster
    repositories, install_plugins = self.search_components_from_mirrors_and_install(deploy_config)
  File "/usr/obd/core.py", line 660, in search_components_from_mirrors_and_install
    pkgs, repositories, errors = self.search_components_from_mirrors(deploy_config, only_info=False)
  File "/usr/obd/core.py", line 215, in search_components_from_mirrors
    pkg = self.mirror_manager.get_best_pkg(name=component, version=config.version, md5=config.package_hash, fuzzy_match=fuzzy_match, only_info=only_info)
  File "/usr/obd/_mirror.py", line 789, in get_best_pkg
    return self.get_exact_pkg(**pattern)
  File "/usr/obd/_mirror.py", line 778, in get_exact_pkg
    mirrors = self.get_mirrors()
  File "/usr/obd/_mirror.py", line 772, in get_mirrors
    mirros = self.get_remote_mirrors()
  File "/usr/obd/_mirror.py", line 764, in get_remote_mirrors
    meta_data['name'] = RemoteMirrorRepository.var_replace(meta_data['name'], server_vars)
  File "/usr/obd/_mirror.py", line 319, in var_replace
    return ''.join(done)
TypeError: sequence item 1: expected str instance, NoneType found


[root@ecs-ac3e-0001 ob]# python3 -V
Python 3.10.0

rm -fr ~/.obd/mirror/remote/OceanBase.repo

看上去是个兼容性的问题,删掉远程镜像仓库配置可以绕过这个问题。目前我们提供的远程镜像仓库中也没有arm,可以先删掉这份配置。