环境:
OceanBase Deploy: 2.10.1
REVISION: 9870cf1b400be9002d851b9a165b043f1da4e0e7
BUILD_BRANCH: HEAD
BUILD_TIME: Oct 12 2024 16:15:27OURCE
Copyright (C) 2021 OceanBase
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
obproxy-ce:
version: 4.3.2.0
oceanbase-ce:
version: 4.3.4.0
描述:
-
使用
obd cluster display myoceanbase
命令查看集群信息,如下[root@localhost myoceanbase]# obd cluster display myoceanbase Get local repositories and plugins ok Open ssh connection ok Cluster status check ok Connect to observer 192.168.124.46:2881 ok Wait for observer init ok +--------------------------------------------------+ | oceanbase-ce | +----------------+---------+------+-------+--------+ | ip | version | port | zone | status | +----------------+---------+------+-------+--------+ | 192.168.124.46 | 4.3.4.0 | 2881 | zone1 | ACTIVE | | 192.168.124.49 | 4.3.4.0 | 2881 | zone2 | ACTIVE | | 192.168.124.52 | 4.3.4.0 | 2881 | zone3 | ACTIVE | +----------------+---------+------+-------+--------+ obclient -h192.168.124.46 -P2881 -uroot -p'Yanfa2023' -Doceanbase -A cluster unique id: 610ea127-219d-5d68-8772-db9d0ee588ce-193bf1f88ca-00040304 Connect to obproxy ok +--------------------------------------------------+ | obproxy-ce | +----------------+------+-----------------+--------+ | ip | port | prometheus_port | status | +----------------+------+-----------------+--------+ | 192.168.124.38 | 2883 | 2884 | active | +----------------+------+-----------------+--------+ obclient -h192.168.124.38 -P2883 -uroot@proxysys -p'sys@Yanfa2023' -Doceanbase -A Trace ID: aaad7676-bdd9-11ef-87fb-bc24112b4e4e If you want to view detailed obd logs, please run: obd display-trace aaad7676-bdd9-11ef-87fb-bc24112b4e4e
-
直连登录,并查看用户信息
proxyro 初始集群创建后不存在,为手动创建,执行语句:
grant select on oceanbase.* to proxyro identified by 'proxyro@Yanfa2023';
obclient -h192.168.124.46 -P2881 -uroot -p'Yanfa2023' -Doceanbase -A obclient [oceanbase]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | LBACSYS | | mysql | | oceanbase | | ocs | | ORAAUDITOR | | SYS | | sys_external_tbs | | test | +--------------------+ 9 rows in set (0.006 sec) obclient [oceanbase]> select user,password from mysql.user; +---------+-------------------------------------------+ | user | password | +---------+-------------------------------------------+ | root | *d9cb9ededc4ea88036a346d852c579c08a95e976 | | proxyro | *3fb70093a1818bf24dce96bd9f25c1cfdedb0b92 | +---------+-------------------------------------------+ 2 rows in set (0.002 sec)
-
修改yaml 保持
obproxy-ce.observer_sys_password
与oceanbase-ce.proxyro_password
密码一致obd cluster edit-config myoceanbase username: root password: Yanfa2023 port: 22 oceanbase-ce: version: 4.3.4.0 release: 100000162024110717.el7 package_hash: 5d59e837a0ecff1a6baa20f72747c343ac7c8dce 192.168.124.46: zone: zone1 192.168.124.49: zone: zone2 192.168.124.52: zone: zone3 servers: - 192.168.124.46 - 192.168.124.49 - 192.168.124.52 global: appname: myoceanbase root_password: Yanfa2023 proxyro_password: proxyro@Yanfa2023 mysql_port: 2881 rpc_port: 2882 data_dir: /data/myoceanbase/data redo_dir: /data/myoceanbase/logs home_path: /root/myoceanbase/oceanbase scenario: htap datafile_maxsize: 50GB cluster_id: 1734077603 enable_syslog_wf: false max_syslog_file_count: 4 memory_limit: 10G datafile_size: 25G system_memory: 3G log_disk_size: 25G cpu_count: 16 production_mode: false datafile_next: 5G obproxy-ce: version: 4.3.2.0 package_hash: fd779e401be448715254165b1a4f7205c4c1bda5 release: 26.el7 servers: - 192.168.124.38 global: prometheus_listen_port: 2884 listen_port: 2883 rpc_listen_port: 2885 home_path: /root/myoceanbase/obproxy observer_sys_password: proxyro@Yanfa2023 obproxy_sys_password: sys@Yanfa2023 skip_proxy_sys_private_check: true enable_strict_kernel_release: false enable_cluster_checkout: false 192.168.124.38: proxy_id: 6327
-
reload集群:
obd cluster reload myoceanbase
-
尝试登录obProxy,登录失败
obclient -h192.168.124.38 -P2883 -uroot -p'proxyro@Yanfa2023' -Doceanbase -A > ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 11