obd 部署 1-1-1 ob集群,使用obproxy无法连接

【 使用环境 】测试环境
【 OB or 其他组件 】
【 使用版本 】oceabase 3.1.5
【问题描述】obclient 直连observer可以登录,通过obproxy 2883端口无法连接上
【复现路径】obclient -h 10.11.99.101 -uroot@sys#obcp-3zone3 -P2883 -p"obcp_2024" -c -A oceanbase
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11

tail ~/.obd/cluster/obcp-3zones/config.yaml
rs_list: 10.11.99.100:2881;10.11.99.101:2881;10.11.99.102:2881
enable_cluster_checkout: false
# observer cluster name, consistent with oceanbase-ce’s appname. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
# cluster_name: obcluster
skip_proxy_sys_private_check: true
enable_strict_kernel_release: false
enable_cluser_checkout: false
cluster_name: obcp_test
obproxy_sys_password: obcp_2024 # obproxy sys user password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
observer_sys_password: obcp_2024 # proxyro user pasword, consistent with oceanbase-ce’s proxyro_password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.

obd cluster edit-config obcp-3zone3

这个是完整的配置文件嘛?

yaml

## Only need to configure when remote login is required
user:
  username: admin
#   password: your password if need
  key_file: /home/admin/.ssh/id_rsa.pub
#   port: your ssh port, default 22
#   timeout: ssh connection timeout (second), default 30
oceanbase-ce:
  version: 3.1.5
  servers:
  - name: ob-server01
      # Please don't use hostname, only IP can be supported
    ip: 10.11.99.100
  - name: ob-server02
    ip: 10.11.99.101
  - name: ob-server03
    ip: 10.11.99.102
  global:
    # Starting from observer version 4.2, the network selection for the observer is based on the 'local_ip' parameter, and the 'devname' parameter is no longer mandatory.
    # If the 'local_ip' parameter is set, the observer will first use this parameter for the configuration, regardless of the 'devname' parameter.
    # If only the 'devname' parameter is set, the observer will use the 'devname' parameter for the configuration.
    # If neither the 'devname' nor the 'local_ip' parameters are set, the 'local_ip' parameter will be automatically assigned the IP address configured above.
    # devname: eth0
    #use "ens3"
    devname: ens3
    #cluster_id: 1
    cluster_id: 2
    # please set memory limit to a suitable value which is matching resource. 
    memory_limit: 0 # The maximum running memory for an observer
    memory_limit_percentage: 80
    system_memory: 6G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
    datafile_size: 20G # Size of the data file. 
    datafile_next: 2G # the auto extend step. Please enter an capacity, such as 2G
    datafile_maxsize: 50G # the auto extend max size. Please enter an capacity, such as 20G
    log_disk_size: 14G # The size of disk space used by the clog files.
    stack_size: 512K
    cpu_count: 4
    cach_wash_threshold: 1G
    #__min_full_resource_pool_memory: 368435456
    worker_per_cpu_quota: 2
    schema_histroy_expire_time: 1d
    net_thread_count: 2
    major_freeze_duty_time: Disable
    minor_freeze_times: 10
    enable_separate_sys_clog: 0
    enable_merge_by_turn: false
    production_mode: false
    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: 2 # 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: obcp_cluster
    root_password: obcp_2024 # root user password, can be empty
    proxyro_password: obcp_2024 # proxyro user pasword, consistent with obproxy's observer_sys_password, can be empty
  ob-server01:
    mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
    rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
    #  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
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    redo_dir: /redo
    zone: zone1
  ob-server02:
    mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
    rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
    #  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
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    redo_dir: /redo
    zone: zone2
  ob-server03:
    mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
    rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
    #  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
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    redo_dir: /redo
    zone: zone3
obproxy-ce:
  version: 3.2.3.5
  # Set dependent components for the component.
  # When the associated configurations are not done, OBD will automatically get the these configurations from the dependent components.
  depends:
  - oceanbase-ce
  servers:
  - 10.11.99.100
  - 10.11.99.101
  - 10.11.99.102
  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. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    # rs_list: 192.168.1.2:2881;192.168.1.3:2881;192.168.1.4:2881
    rs_list: 10.11.99.100:2881;10.11.99.101:2881;10.11.99.102:2881
    enable_cluster_checkout: false
    # observer cluster name, consistent with oceanbase-ce's appname. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    # cluster_name: obcluster
    skip_proxy_sys_private_check: true
    enable_strict_kernel_release: false
    enable_cluser_checkout: false
    cluster_name: obcp_test
    obproxy_sys_password: obcp_2024 # obproxy sys user password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    observer_sys_password: obcp_2024 # proxyro user pasword, consistent with oceanbase-ce's proxyro_password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    observer_root_password: obcp_2024

bash
If you want to view detailed obd logs, please run: obd display-trace 06b8a626-e2b0-11ee-9ef5-525400321712
[admin@kvm-clone01 sysbench-1.0.20]$ obd cluster display obcp-3zones
Get local repositories and plugins ok
Open ssh connection ok
Cluster status check ok
Connect to observer 10.11.99.100:2881 ok
Wait for observer init ok
+------------------------------------------------+
|                    observer                    |
+--------------+---------+------+-------+--------+
| ip           | version | port | zone  | status |
+--------------+---------+------+-------+--------+
| 10.11.99.100 | 3.1.5   | 2881 | zone1 | active |
| 10.11.99.101 | 3.1.5   | 2881 | zone2 | active |
| 10.11.99.102 | 3.1.5   | 2881 | zone3 | active |
+--------------+---------+------+-------+--------+
obclient -h10.11.99.100 -P2881 -uroot -p'obcp_2024' -Doceanbase -A

Connect to obproxy ok
+------------------------------------------------+
|                    obproxy                     |
+--------------+------+-----------------+--------+
| ip           | port | prometheus_port | status |
+--------------+------+-----------------+--------+
| 10.11.99.100 | 2883 | 2884            | active |
| 10.11.99.101 | 2883 | 2884            | active |
| 10.11.99.102 | 2883 | 2884            | active |
+--------------+------+-----------------+--------+
obclient -h10.11.99.100 -P2883 -uroot -p'obcp_2024' -Doceanbase -A 

Trace ID: 0fef1068-e2b0-11ee-ac54-525400321712
If you want to view detailed obd logs, please run: obd display-trace 0fef1068-e2b0-11ee-ac54-525400321712

[admin@kvm-clone01 sysbench-1.0.20]$ obclient -h10.11.99.100 -P2883 -uroot -p'obcp_2024' -Doceanbase -A
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 11

bash
[admin@kvm-clone01 sysbench-1.0.20]$ obclient -h10.11.99.100 -P2883 -uroot@sys#obcp-3zone3 -p'obcp_2024' -Doceanbase -A
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 11

参考下这个试试https://open.oceanbase.com/blog/1100261

先直接连集群试试

这个报错有2个可能:

  1. 登录数据库修改过租户密码,导致配置文件中密码和数据库不一致、
    修复方式:需要数据库中修改密码和配置中保持一致,如果有修改密码需求可以obd cluster edit-config方式修改。

  2. obclient 客户端命令框架问题。
    修复方式:替换使用mysql客户端,或者 增加 --proxy-mode 参数 或者 升级到最新版本obclient。