observer 启动后,正常情况下,会有下面特征:
- 监听 2881 和 2882 成功。
- __all_server.status 为 active。
- __all_server.start_service_time 为启动后的时间。
2 和 3 都是集群初始化成功后的。
如果 observer启动后退出了,请到 程序运行目录 里查看日志
grep ERROR log/observer.log
observer 启动后,正常情况下,会有下面特征:
2 和 3 都是集群初始化成功后的。
如果 observer启动后退出了,请到 程序运行目录 里查看日志
grep ERROR log/observer.log
[ober@progs log]$ grep ERROR observer.log
[2021-08-28 21:39:19.683866] ERROR [SERVER] init_config (ob_server.cpp:835) [17949][0][Y0-0000000000000000] [lt=40] invalid config from cmdline options(opts_.optstr_="__min_full_resource_pool_memory=268435456,memory_limit=6G,system_memory=3G,stack_size=512K,cpu_count=2,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_disk_percentage=5,enable_syslog_recycle=True,max_syslog_file_count=4", ret=-4147) BACKTRACE:0x91613ee 0x91270c7 0x2155ca3 0x2199914 0x897773b 0x89732df 0x2117d91 0x7fc655a603d5 0x2116ae9
[2021-08-28 21:39:19.689958] ERROR [SERVER] init (ob_server.cpp:166) [17949][0][Y0-0000000000000000] [lt=4] init config fail(ret=-4147) BACKTRACE:0x91613ee 0x91270c7 0x211abbd 0x2119ba8 0x8973ca6 0x2117d91 0x7fc655a603d5 0x2116ae9
[2021-08-28 21:39:19.701906] ERROR [SERVER] main (main.cpp:488) [17949][0][Y0-0000000000000000] [lt=4] observer init fail(ret=-4147) BACKTRACE:0x91613ee 0x91270c7 0x211abbd 0x2119ba8 0x2118084 0x7fc655a603d5 0x2116ae9
[2021-08-28 21:50:35.870443] INFO [SHARE.SCHEMA] ob_schema_struct.cpp:168 [10646][0][Y0-0000000000000000] [lt=3] [dc=0] set tenant space table name(key=15656453541099564691, table={database_id:6, name_case_mode:2, table_name:"ALL_VIRTUAL_ERROR_AGENT"})
[2021-08-28 21:50:35.874293] INFO [SHARE.SCHEMA] ob_schema_struct.cpp:168 [10646][0][Y0-0000000000000000] [lt=38] [dc=0] set tenant space table name(key=2868000062764514379, table={database_id:6, name_case_mode:2, table_name:"ALL_VIRTUAL_TENANT_ERROR_REAL_AGENT"})
[2021-08-28 21:50:35.882216] INFO [SHARE.SCHEMA] ob_schema_struct.cpp:168 [10646][0][Y0-0000000000000000] [lt=26] [dc=0] set tenant space table name(key=5043483467960944309, table={database_id:6, name_case_mode:2, table_name:"ALL_ERRORS"})
[2021-08-28 21:50:35.882246] INFO [SHARE.SCHEMA] ob_schema_struct.cpp:168 [10646][0][Y0-0000000000000000] [lt=3] [dc=0] set tenant space table name(key=8129345318515628085, table={database_id:6, name_case_mode:2, table_name:"DBA_ERRORS"})
[2021-08-28 21:50:35.882253] INFO [SHARE.SCHEMA] ob_schema_struct.cpp:168 [10646][0][Y0-0000000000000000] [lt=3] [dc=0] set tenant space table name(key=4571968748190436015, table={database_id:6, name_case_mode:2, table_name:"USER_ERRORS"})
[2021-08-28 21:50:41.106331] ERROR easy_client_dispatch (easy_client.c:30) [10651][8][YB42C0A80AB5-0005CA9EE244110E] [lt=5] [dc=0] easy_io_dispatch is failure: easy not started
[2021-08-28 21:50:46.120475] ERROR easy_client_dispatch (easy_client.c:30) [10651][8][YB42C0A80AB5-0005CA9EE244110F] [lt=12] [dc=0] easy_io_dispatch is failure: easy not started
[2021-08-28 21:50:46.708890] ERROR [SERVER.OMT] init (ob_multi_tenant.cpp:184) [10646][0][Y0-0000000000000000] [lt=6] [dc=0] node quota should greater than 1(node_quota_=0.000000000000000000e+00, ret=-4002) BACKTRACE:0x91613ee 0x912f6c1 0x21562ef 0x2155f3b 0x2155d02 0x4706f66 0x8ad6864 0x897e185 0x897382a 0x2117d91 0x7fc8137d03d5 0x2116ae9
[2021-08-28 21:50:46.709167] ERROR [SERVER] init_multi_tenant (ob_server.cpp:1163) [10646][0][Y0-0000000000000000] [lt=254] [dc=0] init multi tenant fail(ret=-4002) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x897f0a2 0x897382a 0x2117d91 0x7fc8137d03d5 0x2116ae9
[2021-08-28 21:50:46.709346] ERROR [SERVER] init (ob_server.cpp:299) [10646][0][Y0-0000000000000000] [lt=120] [dc=0] init multi tenant fail(ret=-4002) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x89755c0 0x2117d91 0x7fc8137d03d5 0x2116ae9
[2021-08-28 21:51:47.785700] ERROR [SERVER] main (main.cpp:488) [10646][0][Y0-0000000000000000] [lt=3] [dc=0] observer init fail(ret=-4002) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x2118084 0x7fc8137d03d5 0x2116ae9
memory_limit=6G 这个应该是起不来的关键原因。目前测试过的 memory_limit最小内存是8G. 其他参数请参考下面。
memory_limit: 8G # The maximum running memory for an observer system_memory: 4G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G. stack_size: 512K cpu_count: 16 cache_wash_threshold: 1G __min_full_resource_pool_memory: 268435456 workers_per_cpu_quota: 10 schema_history_expire_time: 1d # The value of net_thread_count had better be same as cpu's core number. net_thread_count: 4 major_freeze_duty_time: Disable minor_freeze_times: 10 enable_separate_sys_clog: 0 enable_merge_by_turn: FALSE #datafile_disk_percentage: 20 # The percentage of the data_dir space to the total disk space. This value takes effect only when datafile_size is 0. The default value is 90. datafile_size: 10G syslog_level: ERROR # System log level. The default value is INFO. enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true. enable_syslog_recycle: true # Enable auto system log recycling or not. The default value is false. max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.
下面是一个实际成功过的 obd 配置文件
## Only need to configure when remote login is required # user: # username: your username # password: your password if need # key_file: your ssh-key file path if need # port: your ssh port, default 22 # timeout: ssh connection timeout (second), default 30 oceanbase-ce: servers: # Please don't use hostname, only IP can be supported - 127.0.0.1 global: # The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field. home_path: /home/admin/oceanbase-ce # The directory for data storage. The default value is $home_path/store. # data_dir: /data/1 # The directory for clog, ilog, and slog. The default value is the same as the data_dir value. redo_dir: /data/log1 # Please set devname as the network adaptor's name whose ip is in the setting of severs. # if set severs as "127.0.0.1", please set devname as "lo" # if current ip is 192.168.1.10, and the ip's network adaptor's name is "eth0", please use "eth0" devname: lo mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. zone: zone1 cluster_id: 1 # please set memory limit to a suitable value which is matching resource. memory_limit: 8G # The maximum running memory for an observer system_memory: 4G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G. stack_size: 512K cpu_count: 16 cache_wash_threshold: 1G __min_full_resource_pool_memory: 268435456 workers_per_cpu_quota: 10 schema_history_expire_time: 1d # The value of net_thread_count had better be same as cpu's core number. net_thread_count: 4 major_freeze_duty_time: Disable minor_freeze_times: 10 enable_separate_sys_clog: 0 enable_merge_by_turn: FALSE #datafile_disk_percentage: 20 # The percentage of the data_dir space to the total disk space. This value takes effect only when datafile_size is 0. The default value is 90. datafile_size: 5G syslog_level: ERROR # System log level. The default value is INFO. enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true. enable_syslog_recycle: true # Enable auto system log recycling or not. The default value is false. max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0. # observer cluster name, consistent with obproxy's cluster_name appname: obdemo root_password: rootPWD123 # root user password, can be empty proxyro_password: proxyROPWD123 # proxyro user pasword, consistent with obproxy's observer_sys_password, can be empty obproxy: servers: - 127.0.0.1 global: listen_port: 2883 # External port. The default value is 2883. prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884. home_path: /home/admin/obproxy # oceanbase root server list # format: ip:mysql_port,ip:mysql_port rs_list: 127.0.0.1:2881 enable_cluster_checkout: false # observer cluster name, consistent with oceanbase-ce's appname cluster_name: obdemo obproxy_sys_password: proxySYSPWD123 # obproxy sys user password, can be empty observer_sys_password: proxyROPWD123 # proxyro user pasword, consistent with oceanbase-ce's proxyro_password, can be empty automatic_match_work_thread: false work_thread_num: 12 xflush_log_level: ERROR monitor_log_level: ERROR syslog_level: ERROR log_dir_size_threshold: 1G enable_compression_protocol: false
ob最小启动规格是2C8G。即memory_limit大于等于8G,对应的memory_limit为4G。可以参考OBD提供的最小规格样例https://github.com/oceanbase/obdeploy/blob/master/example/mini-local-example.yaml。
[ober@progs log]$ ps -ef|grep obser
root 11340 1 99 09:23 ? 03:29:28 /ups/app/oceanbase/bin/observer -r 192.168.10.181: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=8G,enable_syslog_wf=False,enable_syslog_recycle=True,max_syslog_file_count=4 -z zone1 -p 2881 -P 2882 -c 1 -d /ups/app/oceanbase/store -i ens32 -l ERROR
[2021-08-30 11:23:15.251373] ERROR [LIB] ob_malloc (ob_malloc.h:38) [11589][426][Y0-0000000000000000] [lt=27] [dc=0] allocate memory fail(attr=tenant_id=500, label=ClogInfoBlkHndl, ctx_id=0, prio=0, nbyte=4198400) BACKTRACE:0x91613ee 0x912f6c1 0x21562ef 0x2155f3b 0x2155d02 0x215593a 0x215565f 0x8fe236c 0x6ed6d6a 0x6ee5676 0x6ee4620 0x6ee32df 0x6ef16be 0x6cfe686 0x6d0225a 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-08-30 11:23:15.251382] ERROR [CLOG] init (ob_log_direct_reader.cpp:51) [11589][426][Y0-0000000000000000] [lt=8] [dc=0] ob_malloc fail(ret=-4013, align_size=4096, size=4194304) BACKTRACE:0x91613ee 0x912f6c1 0x2158336 0x2157f7b 0x2157cf3 0x214be79 0x6ed6ebb 0x6ee5676 0x6ee4620 0x6ee32df 0x6ef16be 0x6cfe686 0x6d0225a 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-08-30 11:23:15.908814] ERROR [LIB] direct_alloc (achunk_mgr.cpp:120) [11573][394][Y0-0000000000000000] [lt=5] [dc=0] low alloc fail(size=37748736, orig_errno=12, errno=12) BACKTRACE:0x91613ee 0x912f6c1 0x2158336 0x2157f7b 0x2157cf3 0x3fe37f9 0x90138e8 0x9014143 0x901562c 0x8feb701 0x8feb20e 0x8ffc0b0 0x8fd739b 0x8ffc9d4 0x8ffb6ad 0x8fee092 0x21555cd 0x219a087 0x6d51e28 0x6d519ee 0x6d516f7 0x6d72aff 0x6d6f87e 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-08-30 11:23:15.908847] ERROR [LIB] ob_malloc (ob_malloc.h:38) [11573][394][Y0-0000000000000000] [lt=29] [dc=0] allocate memory fail(attr=tenant_id=500, label=IlogFileBuilder, ctx_id=0, prio=0, nbyte=36892760) BACKTRACE:0x91613ee 0x912f6c1 0x21562ef 0x2155f3b 0x2155d02 0x215593a 0x215565f 0x219a087 0x6d51e28 0x6d519ee 0x6d516f7 0x6d72aff 0x6d6f87e 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-08-30 11:23:15.908857] ERROR [CLOG.CSR] prepare_raw_array_ (ob_ilog_file_builder.cpp:251) [11573][394][Y0-0000000000000000] [lt=8] [dc=0] raw_array alloc failed(ret=-4013, raw_array.count_=512399) BACKTRACE:0x91613ee 0x912f6c1 0x21562ef 0x2155f3b 0x2155d02 0x2142634 0x6d520fd 0x6d519ee 0x6d516f7 0x6d72aff 0x6d6f87e 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-08-30 11:23:15.908863] ERROR [CLOG.CSR] get_file_buffer (ob_ilog_file_builder.cpp:208) [11573][394][Y0-0000000000000000] [lt=6] [dc=0] build_file_ failed(ret=-4013) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x6d518b6 0x6d72aff 0x6d6f87e 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-08-30 11:23:15.908870] ERROR [CLOG.CSR] build_and_write_file_ (ob_ilog_store.cpp:1282) [11573][394][Y0-0000000000000000] [lt=6] [dc=0] builder get_file_buffer failed(ret=-4013) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x6d72cbc 0x6d6f87e 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-08-30 11:23:15.908875] ERROR [CLOG] runTimerTask (ob_ilog_store.cpp:970) [11573][394][Y0-0000000000000000] [lt=5] [dc=0] build_and_write_file_ failed(ret=-4013) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x6d6fddb 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
按照这个配置,也是一堆的ERROR:
[2021-09-11 12:49:51.927684] ERROR [CLOG.CSR] getfilebuffer (obilogfilebuilder.cpp:208) [16547][394][Y0-0000000000000000] [lt=88] [dc=0] buildfile_ failed(ret=-4013) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x6d518b6 0x6d72aff 0x6d6f87e 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-09-11 12:49:51.927761] ERROR [CLOG.CSR] buildandwritefile (obilogstore.cpp:1282) [16547][394][Y0-0000000000000000] [lt=76] [dc=0] builder getfilebuffer failed(ret=-4013) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x6d72cbc 0x6d6f87e 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-09-11 12:49:51.927833] ERROR [CLOG] runTimerTask (obilogstore.cpp:970) [16547][394][Y0-0000000000000000] [lt=71] [dc=0] buildandwritefile failed(ret=-4013) BACKTRACE:0x91613ee 0x912f6c1 0x211b3c4 0x211aeab 0x211ac11 0x2119ba8 0x6d6fddb 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-09-11 12:49:52.026736] ERROR [LIB] directalloc (achunkmgr.cpp:120) [16564][426][Y0-0000000000000000] [lt=6] [dc=0] low alloc fail(size=6291456, orig_errno=12, errno=12) BACKTRACE:0x91613ee 0x912f6c1 0x2158336 0x2157f7b 0x2157cf3 0x3fe37f9 0x90138e8 0x9014143 0x901562c 0x8feb701 0x8feb20e 0x8ffc0b0 0x8fd739b 0x8ffc9d4 0x8ffb6ad 0x8fee092 0x21555cd 0x8fe236c 0x6ed6d6a 0x6ee5676 0x6ee4620 0x6ee32df 0x6ef16be 0x6cfe686 0x6d0225a 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-09-11 12:49:52.026782] ERROR [LIB] obmalloc (obmalloc.h:38) [16564][426][Y0-0000000000000000] [lt=37] [dc=0] allocate memory fail(attr=tenantid=500, label=ClogInfoBlkHndl, ctxid=0, prio=0, nbyte=4198400) BACKTRACE:0x91613ee 0x912f6c1 0x21562ef 0x2155f3b 0x2155d02 0x215593a 0x215565f 0x8fe236c 0x6ed6d6a 0x6ee5676 0x6ee4620 0x6ee32df 0x6ef16be 0x6cfe686 0x6d0225a 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[2021-09-11 12:49:52.026796] ERROR [CLOG] init (oblogdirectreader.cpp:51) [16564][426][Y0-0000000000000000] [lt=11] [dc=0] obmalloc fail(ret=-4013, align_size=4096, size=4194304) BACKTRACE:0x91613ee 0x912f6c1 0x2158336 0x2157f7b 0x2157cf3 0x214be79 0x6ed6ebb 0x6ee5676 0x6ee4620 0x6ee32df 0x6ef16be 0x6cfe686 0x6d0225a 0x9162d87 0x331e22f 0x2caaec4 0x8fc84c5 0x8fc7152 0x8fc3c7f
[ober@progs oceanbase]$ obd cluster start biu
Get local repositories and plugins ok
Open ssh connection ok
Cluster param config check ok
Check before start observer ok
Check before start obproxy ok
Start observer ok
observer program health check ok
Connect to observer ok
Initialize cluster
Cluster bootstrap ok
Wait for observer init ok
+---------------------------------------------+
| observer |
+-----------+---------+------+-------+--------+
| ip | version | port | zone | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 3.1.0 | 2881 | zone1 | active |
+-----------+---------+------+-------+--------+
Start obproxy x
[ERROR] failed to start 127.0.0.1 obproxy: /bin/sh: line 1: 16963 Segmentation fault /ups/app/oceanbase/obproxy/bin/obproxy -o enablestrictkernelrelease=False,enableclustercheckout=False,automaticmatchworkthread=False,workthreadnum=12,xflushloglevel='ERROR',monitorloglevel='ERROR',sysloglevel='ERROR',logdirsizethreshold='1G',enablecompressionprotocol=False --listenport 2883 --prometheuslistenport 2884 --rslist '127.0.0.1:2881' --cluster_name 'obdemo'
[ERROR] obproxy start failed
虚拟机内存资源有点小,memory-limit(下划线)配置项目前最小要求是8G,另外截图显式不全,如果没有配置system-memory(下划线) 的话,默认是30G。
https://github.com/oceanbase/obdeploy/blob/master/example/mini-single-example.yaml
https://github.com/oceanbase/obdeploy/blob/master/example/local-example.yaml
启动的时候报连接错误
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# obd cluster deploy ob_cluster -c mini-local-example.yaml
oceanbase-ce-3.1.0 already installed.
+-----------------------------------------------------------------------------+
| Packages |
+--------------+---------+---------+------------------------------------------+
| Repository | Version | Release | Md5 |
+--------------+---------+---------+------------------------------------------+
| oceanbase-ce | 3.1.0 | 3.el7 | b73bcd531bdf3f087391991b290ff2cbcdaa0dc9 |
+--------------+---------+---------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Remote oceanbase-ce-3.1.0-b73bcd531bdf3f087391991b290ff2cbcdaa0dc9 repository install ok
Remote oceanbase-ce-3.1.0-b73bcd531bdf3f087391991b290ff2cbcdaa0dc9 repository lib check ok
Cluster status check ok
Initializes cluster work home ok
ob_cluster deployed
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# obd cluster start ob_cluster
Get local repositories and plugins ok
Open ssh connection ok
Cluster param config check ok
Check before start observer ok
[WARN] (47.98.12.201) clog and data use the same disk (/)
Start observer ok
observer program health check ok
[ERROR] import connect failed
[ERROR] Failed to connect oceanbase-ce
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# vi mini-local-example.yaml
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# free -g
total used free shared buff/cache available
Mem: 15 5 8 0 1 9
Swap: 0 0 0
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# vi mini-local-example.yaml
user:
username: root
password:
oceanbase-ce:
servers:
# Please don't use hostname, only IP can be supported
global:
devname: eth0
home_path: /root/observer
mysql_port: 2881
rpc_port: 2882
zone: zone1
# if current hardware's memory capacity is smaller than 50G, please use the setting of "mini-single-example.yaml" and do a small adjustment.
memory_limit: 8G
system_memory: 4G
# datafilediskpercentage: 20
datafile_size: 10G
syslog_level: INFO
enablesyslogrecycle: true
maxsyslogfile_count: 4
cluster_id: 1
stack_size: 512K
cpu_count: 4
cachewashthreshold: 1G
__min_full_resource_pool_memory: 268435456
workerspercpu_quota: 10
schemahistoryexpire_time: 1d
# The value of netthreadcount had better be same as cpu's core number.
netthreadcount: 4
majorfreezeduty_time: Disable
minorfreezetimes: 10
enableseparatesys_clog: 0
enablemergeby_turn: FALSE
麻烦再提供一下启动时刻的日志对应的附件,日志路径 /root/.obd/log
[2021-09-17 15:00:08] [e228ad90-1784-11ec-92ea-00163e107b80] [DEBUG] - import connect
[2021-09-17 15:00:08] [e228ad90-1784-11ec-92ea-00163e107b80] [ERROR] [ERROR] import connect failed
[2021-09-17 15:00:08] [e228ad90-1784-11ec-92ea-00163e107b80] [ERROR] Traceback (most recent call last):
File "core.py", line 978, in start_cluster
File "_plugin.py", line 234, in call
File "plugin.py", line 202, in new_func
File "plugin.py", line 188, in beforedo
File "plugin.py", line 241, in import
File "tool.py", line 91, in import_module
File "/root/.obd/plugins/oceanbase-ce/3.1.0/connect.py", line 28, in <module>
import pymysql as mysql
ModuleNotFoundError: No module named 'pymysql'
[2021-09-17 15:00:08] [e228ad90-1784-11ec-92ea-00163e107b80] [DEBUG] - sys.path: ['/root/.obd/plugins/oceanbase-ce/3.1.0', '/tmp/MEIUq66zD/baselibrary.zip', '/tmp/MEIUq66zD/lib-dynload', '/tmp/MEIUq66zD', '/usr/obd/lib/site-packages']
[2021-09-17 15:00:08] [e228ad90-1784-11ec-92ea-00163e107b80] [ERROR] [ERROR] Failed to connect oceanbase-ce
[root@test60 conf]# obd cluster list +--------------------------------------------------------------------+ | Cluster List | +---------------+----------------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +---------------+----------------------------------+-----------------+ | myob_cluster1 | /root/.obd/cluster/myob_cluster1 | destroyed | | myob_cluster2 | /root/.obd/cluster/myob_cluster2 | destroyed | | myob_proxy | /root/.obd/cluster/myob_proxy | deployed | | myob_test | /root/.obd/cluster/myob_test | running | +---------------+----------------------------------+-----------------+ [root@test60 conf]# python -m "import pymysql as mysql" /usr/bin/python: No module named import pymysql as mysql [root@test60 conf]# [root@test60 conf]# python -m "import pymysql" /usr/bin/python: No module named import pymysql [root@test60 conf]# 发的日志里只有一个明显的错误提示,"No module named import pymysql",但是我看自己的测试环境 也是没有这个python 模块的,应该还是其他原因造成的,发的日志里看出来。
可以在/usr/obd/lib/site-packages目录下看看是否有 pymysql对应的目录
pymysql/ ├── _auth.py ├── charset.py ├── connections.py ├── constants ├── converters.py ├── cursors.py ├── err.py ├── __init__.py ├── optionfile.py ├── protocol.py ├── __pycache__ └── times.py
卸载obd后重新安装报错
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# yum remove ob-deploy
。。。。。。。。。。省略
完毕!
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# sudo yum install -y ob-deploy
已加载插件:fastestmirror
Bad id for repo: mirrors.aliyun.comdocker-celinuxcentosdocker-ce.xn--repo()-mu8ig98h4l0hokj, byte = ( 60
Loading mirror speeds from cached hostfile
正在解决依赖关系
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> 正在检查事务
---> 软件包 ob-deploy.x86_64.0.1.1.0-1.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
==========================================================================================================================================================================================
Package 架构 版本 源 大小
==========================================================================================================================================================================================
正在安装:
ob-deploy x86_64 1.1.0-1.el7 oceanbase.community.stable 12 M
事务概要
==========================================================================================================================================================================================
安装 1 软件包
总下载量:12 M
安装大小:13 M
Downloading packages:
ob-deploy-1.1.0-1.el7.x86_64.rpm | 12 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : ob-deploy-1.1.0-1.el7.x86_64 1/1
Installation of obd finished successfully
Please source /etc/profile.d/obd.sh to enable it
验证中 : ob-deploy-1.1.0-1.el7.x86_64 1/1
已安装:
ob-deploy.x86_64 0:1.1.0-1.el7
完毕!
[root@iZbp147yf0hxjhluwll6lrZ oceanbase]# obd cluster deploy ob_cluster -c mini-local-example.yaml
[ERROR] No such package oceanbase-ce.
少了repo文件。请确认/usr/obd/mirror/remote/OceanBase.repo是否存在。如存在,执行
cp /usr/obd/mirror/remote/OceanBase.repo ~/.obd/mirror/remote/OceanBase.repo
如不存在则执行
cat > /usr/obd/mirror/remote/OceanBase.repo << EOF # OceanBase.repo [oceanbase.community.stable] name=OceanBase-community-stable-el$releasever baseurl=http://mirrors.aliyun.com/oceanbase/community/stable/el/$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://mirrors.aliyun.com/oceanbase/RPM-GPG-KEY-OceanBase [oceanbase.development-kit] name=OceanBase-development-kit-el$releasever baseurl=http://mirrors.aliyun.com/oceanbase/development-kit/el/$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://mirrors.aliyun.com/oceanbase/RPM-GPG-KEY-OceanBase EOF cp /usr/obd/mirror/remote/OceanBase.repo ~/.obd/mirror/remote/OceanBase.repo
开始 xxx.yaml 文件配置错误。然后,我手动修正了 ./.obd/cluster/lo/config.yaml 。再然后,启动看着不成功,不知道怎么后续了。
另: mini-xx 安装是否支持远程访问?