手动部署OceanBase集群(单zone)

薅OBCP考试券的社区活动

https://ask.oceanbase.com/t/topic/35600926

本次实验:手动部署OceanBase。单节点的OBserver+OBProxy

虚拟机配置:4C12G

0、部署前配置

因为是单机部署,省略了部分步骤。

设置ssh

配置时钟

规划磁盘

配置/etc/security/limits.conf

vi /etc/security/limits.conf
root soft nofile 655350
root hard nofile 655350
* soft nofile 655350
* hard nofile 655350
* soft stack unlimited
* hard stack unlimited
* soft nproc 655360
* hard nproc 655360
* soft core unlimited
* hard core unlimited

ulimit -a

/etc/sysctl.conf

vi /etc/sysctl.conf
# for oceanbase
# 修改内核异步 I/O 限制
fs.aio-max-nr=1048576

# 网络优化
net.core.somaxconn = 2048
net.core.netdev_max_backlog = 10000 
net.core.rmem_default = 16777216 
net.core.wmem_default = 16777216 
net.core.rmem_max = 16777216 
net.core.wmem_max = 16777216

net.ipv4.ip_local_port_range = 3500 65535 
net.ipv4.ip_forward = 0 
net.ipv4.conf.default.rp_filter = 1 
net.ipv4.conf.default.accept_source_route = 0 
net.ipv4.tcp_syncookies = 1 
net.ipv4.tcp_rmem = 4096 87380 16777216 
net.ipv4.tcp_wmem = 4096 65536 16777216 
net.ipv4.tcp_max_syn_backlog = 16384 
net.ipv4.tcp_fin_timeout = 15 
net.ipv4.tcp_max_syn_backlog = 16384 
net.ipv4.tcp_tw_reuse = 1 
net.ipv4.tcp_tw_recycle = 1 
net.ipv4.tcp_slow_start_after_idle=0

vm.swappiness = 0
vm.min_free_kbytes = 2097152
fs.file-max = 6573688

# 修改进程可以拥有的虚拟内存区域数量
vm.max_map_count = 655360

# 此处为 OceanBase 数据库的 data 目录
kernel.core_pattern = /home/admin/observer/store/core-%e-%p-%t

1、创建用户

useradd -U admin -d /home/admin -s /bin/bash
mkdir -p /home/admin
chown -R admin:admin /home/admin

passwd admin

为用户创建添加sudo权限

vim /etc/sudoers
添加如下内容:
Same thing without a password
%wheel        ALL=(ALL)       NOPASSWD: ALL
admin       ALL=(ALL)       NOPASSWD: ALL

2、安装all-in-one部署包

https://www.oceanbase.com/softwarecenter
从 V4.0.0 开始,OceanBase 提供统一的安装包 all-in-one package。您可以通过这个统一的安装包一次性完成 OBD、OceanBase 数据库、ODP、OBAgent 等组件的安装。

tar -xzf oceanbase-all-in-one-*.tar.gz
cd oceanbase-all-in-one/bin/
./install.sh
source ~/.oceanbase-all-in-one/bin/env.sh

安装 all-in-one 安装包后默认关闭远程仓库,您可通过 obd mirror list 命令进行确认,查看 Type=remote 对应的 Enabled 变成了 False,说明已关闭远程镜像源。

手动禁用:obd mirror disable remote

[root@node1 bin]# obd mirror list
+-----------------------------------------------------------------------------+
|                            Mirror Repository List                           |
+----------------------------+--------+---------+----------+------------------+
| SectionName                | Type   | Enabled | Avaiable | Update Time      |
+----------------------------+--------+---------+----------+------------------+
| oceanbase.community.stable | remote | False   | False    | 1970-01-01 08:00 |
| oceanbase.development-kit  | remote | False   | False    | 1970-01-01 08:00 |
| local                      | local  | -       | True     | 2024-03-13 22:58 |
+----------------------------+--------+---------+----------+------------------+
Use `obd mirror list <section name>` for more details
Trace ID: 34c28878-e14a-11ee-9149-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace 34c28878-e14a-11ee-9149-000c2961cc7f

查看本地安装包列表

[root@node1 bin]# obd mirror list local
+------------------------------------------------------------------------------------------------------------------+
|                                                local Package List                                                |
+---------------------------+---------+------------------------+--------+------------------------------------------+
| name                      | version | release                | arch   | md5                                      |
+---------------------------+---------+------------------------+--------+------------------------------------------+
| grafana                   | 7.5.17  | 1                      | x86_64 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obagent                   | 4.2.2   | 100000042024011120.el7 | x86_64 | 19739a07a12eab736aff86ecf357b1ae660b554e |
| ob-configserver           | 1.0.0   | 2.el7                  | x86_64 | feca6b9c76e26ac49464f34bfa0780b5a8d3f4a0 |
| ob-deploy                 | 2.6.1   | 6.el7                  | x86_64 | e9a0a7af5ecedd7a267ccef44e64b6323ea568c2 |
| obproxy-ce                | 4.2.1.0 | 11.el7                 | x86_64 | 0aed4b782120e4248b749f67be3d2cc82cdcb70d |
| oceanbase-ce              | 4.2.2.0 | 100010012024022719.el7 | x86_64 | 60fe842818ef64631dd3bb6f90bf4cab0e737195 |
| oceanbase-ce-libs         | 4.2.2.0 | 100010012024022719.el7 | x86_64 | 756bc0a7949701b0a6c707a29cf623f7fb966bb7 |
| oceanbase-diagnostic-tool | 1.5.2   | 22024010415.el7        | x86_64 | 4c0f0551be4ad04bc40a66763f66f76fb8bdf10c |
| ocp-express               | 4.2.2   | 100000022024011120.el7 | x86_64 | 09ffcf156d1df9318a78af52656f499d2315e3f7 |
| prometheus                | 2.37.1  | 10000102022110211.el7  | x86_64 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
+---------------------------+---------+------------------------+--------+------------------------------------------+
Trace ID: 950a85d0-e14c-11ee-99b5-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace 950a85d0-e14c-11ee-99b5-000c2961cc7f

3.修改配置文件

在~/.oceanbase-all-in-one/obd/usr/obd/example路径下,存放着示例配置文件。

如果您选择单机部署,即目标机器只有一台,可使用单机部署配置文件。

本地单机部署配置样例:mini-local-example.yaml、local-example.yaml

单机部署配置样例:mini-single-example.yaml、single-example.yaml

单机部署 + ODP 配置样例:mini-single-with-obproxy-example.yaml、single-with-obproxy-example.yaml

如果您选择分布式部署,即目标机器有多台,可使用分布式安装配置文件。

分布式部署配置样例:mini-distributed-example.yaml、distributed-example.yaml

分布式部署 + ODP 配置样例:mini-distributed-with-obproxy-example.yaml、distributed-with-obproxy-example.yaml

分布式部署 + ODP + OCP Express 配置样例:default-components.yaml、default-components-min.yaml

分布式部署全部组件:all-components-min.yaml、all-components.yaml

这里根据自身配置,选择单机部署 + ODP 配置样例:mini-single-with-obproxy-example.yaml

修改配置文件

cp mini-single-with-obproxy-example.yaml mini-single-with-obproxy-example.yaml.bak

[root@node1 example]# vim mini-single-with-obproxy-example.yaml

## Only need to configure when remote login is required
user: 
   username: admin
   password: Admin123
#   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
    - 192.168.40.111
  global:
    #  The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
    home_path: /home/admin/observer
    # 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
    # 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
    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.
    zone: zone1
    cluster_id: 1
    # please set memory limit to a suitable value which is matching resource. 
    memory_limit: 4G # The maximum running memory for an observer
    system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
    datafile_size: 1G # Size of the data file. 
    datafile_next: 1G # the auto extend step. Please enter an capacity, such as 2G
    datafile_maxsize: 20G # 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.
    cpu_count: 2
    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: 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: obcluster
    # root_password: # root user password, can be empty
    # proxyro_password: # proxyro user pasword, consistent with obproxy's observer_sys_password, can be empty
obproxy-ce:
  # 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:
    - 192.168.40.111
  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
    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
    obproxy_sys_password: Admin123 # 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: Admin123 # 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.

4.部署集群

[root@node1 example]# obd cluster deploy obtest -c /soft/oceanbase-all-in-one/obd/usr/obd/example/mini-single-with-obproxy-example.yaml
Package oceanbase-ce-4.2.2.0-100010012024022719.el7 is available.
Package obproxy-ce-4.2.1.0-11.el7 is available.
install oceanbase-ce-4.2.2.0 for local ok
install obproxy-ce-4.2.1.0 for local ok
+--------------------------------------------------------------------------------------------+
|                                          Packages                                          |
+--------------+---------+------------------------+------------------------------------------+
| Repository   | Version | Release                | Md5                                      |
+--------------+---------+------------------------+------------------------------------------+
| oceanbase-ce | 4.2.2.0 | 100010012024022719.el7 | 60fe842818ef64631dd3bb6f90bf4cab0e737195 |
| obproxy-ce   | 4.2.1.0 | 11.el7                 | 0aed4b782120e4248b749f67be3d2cc82cdcb70d |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Cluster status check ok
Initializes observer work home ok
Initializes obproxy work home ok
Remote oceanbase-ce-4.2.2.0-100010012024022719.el7-60fe842818ef64631dd3bb6f90bf4cab0e737195 repository install ok
Remote oceanbase-ce-4.2.2.0-100010012024022719.el7-60fe842818ef64631dd3bb6f90bf4cab0e737195 repository lib check !!
Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository install ok
Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository lib check ok
Try to get lib-repository
Package oceanbase-ce-libs-4.2.2.0-100010012024022719.el7 is available.
install oceanbase-ce-libs-4.2.2.0 for local ok
Remote oceanbase-ce-libs-4.2.2.0-100010012024022719.el7-756bc0a7949701b0a6c707a29cf623f7fb966bb7 repository install ok
Remote oceanbase-ce-4.2.2.0-100010012024022719.el7-60fe842818ef64631dd3bb6f90bf4cab0e737195 repository lib check ok
obtest deployed
Please execute ` obd cluster start obtest ` to start
Trace ID: b6f3405a-e14d-11ee-87ea-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace b6f3405a-e14d-11ee-87ea-000c2961cc7f

中途报错

yaml格式报错,报错原因是user前多了一个空格。
/root/.obd/cluster/obtest/config.yaml实际就是上面的配置文件。

[root@node1 example]# obd cluster deploy obtest -c /soft/oceanbase-all-in-one/obd/usr/obd/example/mini-single-with-obproxy-example.yaml
[ERROR] Parsing error:
expected a single document in the stream
  in "/root/.obd/cluster/obtest/config.yaml", line 2, column 2
but found another document
  in "/root/.obd/cluster/obtest/config.yaml", line 8, column 1
[ERROR] Components not detected.
Please check the syntax of your configuration file.
See https://github.com/oceanbase/obdeploy/blob/master/docs/zh-CN/4.configuration-file-description.md
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 2a2be410-e14d-11ee-93e0-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace 2a2be410-e14d-11ee-93e0-000c2961cc7f

5. 启动集群

部署完成后,查看状态

[root@node1 example]# obd cluster list
+------------------------------------------------------+
|                     Cluster List                     |
+--------+---------------------------+-----------------+
| Name   | Configuration Path        | Status (Cached) |
+--------+---------------------------+-----------------+
| obtest | /root/.obd/cluster/obtest | deployed        |
+--------+---------------------------+-----------------+
Trace ID: 1f9b5b60-e14e-11ee-9f10-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace 1f9b5b60-e14e-11ee-9f10-000c2961cc7f

启动集群

[root@node1 example]# obd cluster start obtest
Get local repositories ok
Search plugins ok
Load cluster param plugin ok
Open ssh connection ok
Check before start observer ok
Check before start obproxy ok
[WARN] OBD-4521: The config observer_sys_password in obproxy-ce did not take effect, please config it in oceanbase-ce

Start observer ok
observer program health check ok
obshell program health check ok
Connect to observer 192.168.40.111:2881 ok
Start obproxy ok
obproxy program health check ok
Connect to obproxy ok
Initialize obproxy-ce ok
Wait for observer init ok
+--------------------------------------------------+
|                     observer                     |
+----------------+---------+------+-------+--------+
| ip             | version | port | zone  | status |
+----------------+---------+------+-------+--------+
| 192.168.40.111 | 4.2.2.0 | 2881 | zone1 | ACTIVE |
+----------------+---------+------+-------+--------+
obclient -h192.168.40.111 -P2881 -uroot -p'52dB7rUMoIHu7CkHpmyw' -Doceanbase -A

+--------------------------------------------------+
|                     obproxy                      |
+----------------+------+-----------------+--------+
| ip             | port | prometheus_port | status |
+----------------+------+-----------------+--------+
| 192.168.40.111 | 2883 | 2884            | active |
+----------------+------+-----------------+--------+
obclient -h192.168.40.111 -P2883 -uroot -p'52dB7rUMoIHu7CkHpmyw' -Doceanbase -A 

obtest running
Trace ID: c701c3a2-e14f-11ee-82a3-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace c701c3a2-e14f-11ee-82a3-000c2961cc7f




中途报错

报错原因,系统配置文件不符合ob的安装要求。
乖乖回去修改0步骤,部署前配置。

[root@node1 example]# obd cluster start obtest
Get local repositories ok
Search plugins ok
Load cluster param plugin ok
Open ssh connection ok
Check before start observer x
[ERROR] OBD-1007: (192.168.40.111) The value of the ulimit parameter "open files" must not be less than 20000 (Current value: 1024), Please execute `echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf` as root in 192.168.40.111. if it dosen't work, please check whether UsePAM is yes in /etc/ssh/sshd_config.
[ERROR] OBD-1007: (192.168.40.111) The value of the ulimit parameter "max user processes" must not be less than 120000 (Current value: 47471), Please execute `echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/nproc.conf` as root in 192.168.40.111. if it dosen't work, please check whether UsePAM is yes in /etc/ssh/sshd_config.
[WARN] OBD-1007: (192.168.40.111) The recommended number of core file size is unlimited (Current value: 0)
[WARN] OBD-1007: (192.168.40.111) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (192.168.40.111) The value of the "vm.max_map_count" must be within [327600, 1310720] (Current value: 65530, Recommended value: 655360)
[WARN] OBD-1017: (192.168.40.111) The value of the "vm.overcommit_memory" must be 0 (Current value: 2, Recommended value: 0)
[WARN] OBD-1012: (192.168.40.111) clog and data use the same disk (/)

6.连接数据库

中途报错

2881可以访问,2883报错,说明obproxy存在问题

[root@node1 example]# obclient -h192.168.40.111 -P2883 -uroot -p'52dB7rUMoIHu7CkHpmyw' -Doceanbase -A
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 11

[root@node1 example]# obclient -h192.168.40.111 -P2881 -uroot  -Doceanbase -A
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 3221493799
Server version: OceanBase_CE 4.2.2.0 (r100010012024022719-c984fe7cb7a4cef85a40323a0d073f0c9b7b8235) (Built Feb 27 2024 19:20:54)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

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

obclient [oceanbase]> 

官网解释如下:

认证错误
通过 ODP 连接 OceanBase 集群时,命令行输出如下:

ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 0
出现该错误的场景有如下几种。

observer_sys_password 配置问题

通过 ODP 连接 OceanBase 集群依赖于 OceanBase 集群中的 proxyro@sys 用户,您可直连 OceanBase 集群查看是否存在 proxyro@sys 用户。

若 sys 租户下不存在 proxyro 用户,您需在 sys 租户下创建 proxyro 用户,并设置其密码与配置项 observer_sys_password 的明文密码一致。

若 sys 租户下存在 proxyro 用户,您可确认 ODP 中配置的密码(配置项 observer_sys_password)是否与 OceanBase 集群中 proxyro 用户密码一致。若无法判断是否一致,您可直接重新配置 proxyro 用户密码或 observer_sys_password 配置项,使两者明文密码保持一致。

尝试一:
分析可能是配置文件中:
obproxy_sys_password、observer_sys_password 设置了密码
但global中的root_password、proxyro_password密码为空的原因。

修改配置重新部署。
但并没生效,仍然报错。

redeploy没有生效,但先destroy,在deploy重建后,没有出现这个错误了。

[root@node1 example]# obd cluster stop obtest
Get local repositories ok
Search plugins ok
Open ssh connection ok
Stop observer ok
Stop obshell ok
Stop obproxy ok
obtest stopped
Trace ID: f40c1788-e151-11ee-ab4a-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace f40c1788-e151-11ee-ab4a-000c2961cc7f
[root@node1 example]# obd cluster redeploy obtest -c /soft/oceanbase-all-in-one/obd/usr/obd/example/mini-single-with-obproxy-example
[WARN] no such option: -c
Are you sure to  destroy the "obtest" cluster and rebuild it? [y/n]: y

尝试二:
通过2881登录数据库,修改proxyro密码
select * from mysql.user where user=‘proxyro’;
alter user proxyro identified by ‘Admin123’;

然后可以正常登录2883了。

7.创建租户

定义单元规格

CREATE RESOURCE UNIT S1C2G
        MEMORY_SIZE = '2G',
        MAX_CPU = 1, MIN_CPU = 1,
        LOG_DISK_SIZE = '2G',
        MAX_IOPS = 10000, MIN_IOPS = 10000, IOPS_WEIGHT=1;

创建资源池

CREATE RESOURCE POOL my_pool_1 
    UNIT='S1C2G', 
    UNIT_NUM=1, 
    ZONE_LIST=('zone1'); 

 
ERROR 4733 (HY000): zone 'zone1' resource not enough to hold 1 unit. You can check resource info by views: DBA_OB_UNITS, GV$OB_UNITS, GV$OB_SERVERS.
server '"192.168.40.111:2882"' MEMORY resource not enough

查询资源发现,MEMORY_LIMIT_GB=4GB,是第一次的配置,后面修改了到了11g后,redeploy并没有生效。
重建集群。先destroy,在deploy。
SELECT SVR_IP ,
        SVR_PORT ,
        ZONE ,
        SQL_PORT ,
        CPU_CAPACITY ,
        CPU_CAPACITY_MAX ,
        CPU_ASSIGNED ,
        CPU_ASSIGNED_MAX ,
        MEM_CAPACITY/1024/1024/1024 as  MEM_CAPACITY_GB ,
        MEM_ASSIGNED/1024/1024/1024 as MEM_ASSIGNED_GB,
        LOG_DISK_CAPACITY/1024/1024/1024 as LOG_DISK_CAPACITY_GB  ,
        LOG_DISK_ASSIGNED/1024/1024/1024 as LOG_DISK_ASSIGNED_GB ,
        LOG_DISK_IN_USE/1024/1024/1024 as LOG_DISK_IN_USE_GB ,
        DATA_DISK_CAPACITY/1024/1024/1024 as DATA_DISK_CAPACITY_GB ,
        DATA_DISK_IN_USE/1024/1024/1024 as DATA_DISK_IN_USE_GB,
        DATA_DISK_HEALTH_STATUS ,
        MEMORY_LIMIT/1024/1024/1024 as MEMORY_LIMIT_GB 
FROM GV$OB_SERVERS\G

创建租户

CREATE TENANT  my_tenant 
    PRIMARY_ZONE='zone1', 
    RESOURCE_POOL_LIST=('my_pool_1')
    set OB_TCP_INVITED_NODES='%';
    
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS\G

连接租户

[root@node1 example]# obclient -h192.168.40.111 -P2883 -uroot@my_tenant -Doceanbase -A
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 45
Server version: OceanBase_CE 4.2.2.0 (r100010012024022719-c984fe7cb7a4cef85a40323a0d073f0c9b7b8235) (Built Feb 27 2024 19:20:54)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

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

obclient [oceanbase]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| oceanbase          |
| test               |
+--------------------+
4 rows in set (0.004 sec)

obclient [oceanbase]> 

建个表

obclient [my_ob]> create table tb_test(id int,name varchar(100));
Query OK, 0 rows affected (1.555 sec)

obclient [my_ob]> insert into tb_test values('1','Tom');
Query OK, 1 row affected (0.389 sec)

obclient [my_ob]> select * from tb_test \g
+------+------+
| id   | name |
+------+------+
|    1 | Tom  |
+------+------+
1 row in set (0.002 sec)

关闭集群

[root@node1 example]# obd cluster list
+------------------------------------------------------+
|                     Cluster List                     |
+--------+---------------------------+-----------------+
| Name   | Configuration Path        | Status (Cached) |
+--------+---------------------------+-----------------+
| obtest | /root/.obd/cluster/obtest | destroyed       |
| myob   | /root/.obd/cluster/myob   | running         |
+--------+---------------------------+-----------------+
Trace ID: c7c2456a-e158-11ee-ae7d-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace c7c2456a-e158-11ee-ae7d-000c2961cc7f
[root@node1 example]# obd cluster stop myob
Get local repositories ok
Search plugins ok
Open ssh connection ok
Stop observer ok
Stop obshell ok
Stop obproxy ok
myob stopped
Trace ID: cec1e564-e158-11ee-aed8-000c2961cc7f
If you want to view detailed obd logs, please run: obd display-trace cec1e564-e158-11ee-aed8-000c2961cc7f

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值