OBD自动部署单节点

【产品名称】oceanbase

【产品版本】社区版最新

【问题描述】部署显示成功:

[admin@duizhang ~]$ obd cluster list ±---------------------------------------------------------------------+ | Cluster List | ±------------±-------------------------------------±----------------+ | Name | Configuration Path | Status (Cached) | ±------------±-------------------------------------±----------------+ | obce-single | /home/admin/.obd/cluster/obce-single | destroyed | | obsingle | /home/admin/.obd/cluster/obsingle | deployed | ±------------±-------------------------------------±----------------+

1 个赞

启动的时候报错:


[admin@duizhang ~]$ obd cluster start obsingle
Get local repositories and plugins ok
Open ssh connection ok
Cluster param config check ok
Check before start observer x
[WARN] (127.0.0.1) clog and data use the same disk (/)
[ERROR] 127.0.0.1 eth0 fail to ping 127.0.0.1. Please check configuration `devname`



参数文件如下:


[admin@duizhang ~]$ more obce-single.yaml
## 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/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
    # 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: 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: 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_si
ze is 0. The default value is 90.
    syslog_level: INFO # 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.
    root_password: oracle_4U # root user password, can be empty




hosts文件配置如下:


[admin@duizhang ~]$ more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


192.168.211.54 duizhang.novalocal duizhang


ssh本机免登录:


[admin@duizhang ~]$ ssh `hostname -i`
Last login: Fri Nov 26 14:27:53 2021
[admin@duizhang ~]$


看报错提示,再看下 配置文件中的注释

devname 参数值改成 lo

给成lo,也没成功。

网卡信息:


[admin@duizhang ~]$ ifconfig -a
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:c6ff:feae:b530  prefixlen 64  scopeid 0x20<link>
        ether 02:42:c6:ae:b5:30  txqueuelen 0  (Ethernet)
        RX packets 2  bytes 56 (56.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7  bytes 522 (522.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.211.54  netmask 255.255.255.0  broadcast 192.168.211.255
        inet6 fe80::f816:3eff:feaf:c960  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:af:c9:60  txqueuelen 1000  (Ethernet)
        RX packets 1474529  bytes 1415042190 (1.3 GiB)
        RX errors 0  dropped 7  overruns 0  frame 0
        TX packets 712763  bytes 2250048543 (2.0 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 293958  bytes 43315828 (41.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 293958  bytes 43315828 (41.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


重新部署成功了。过程大概如下:

删除observer目录。删除/home/admin/.obd/目录下所有的东西。

执行:obd cluster deploy obce-single -c obce-single.yaml


[admin@duizhang ~]$ obd cluster start obce-single
Get local repositories and plugins ok
Open ssh connection ok
Cluster param config check ok
Check before start observer ok
[WARN] (192.168.211.54) clog and data use the same disk (/)


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 |
+----------------+---------+------+-------+--------+
| 192.168.211.54 | 3.1.1   | 2881 | zone1 | active |
+----------------+---------+------+-------+--------+


obce-single running


1 个赞

yaml文件:


[admin@duizhang ~]$ cat obce-single.yaml
oceanbase-ce:
  servers:
    - 192.168.211.54
  global:
    home_path: /home/admin/observer
    devname: eth0
    mysql_port: 2881
    rpc_port: 2882
    zone: zone1
    cluster_id: 1
    memory_limit: 8G
    system_memory: 4G
    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
    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
    syslog_level: INFO
    enable_syslog_wf: false
    enable_syslog_recycle: true
    max_syslog_file_count: 4


当deploy后修改配置文件正确的方法是 :obd cluster edit-config obce-single

修改才会生效。

可能是这个原因。

后面你删除了 ~/.obd 目录, 重新部署,那效果一样。

2 个赞