龙空技术网

Obd工具扩容集群

葫芦儿的成长记录 193

前言:

此时各位老铁们对“ubuntu ssh connection timeout”可能比较关心,姐妹们都想要学习一些“ubuntu ssh connection timeout”的相关资讯。那么小编在网摘上搜集了一些对于“ubuntu ssh connection timeout””的相关文章,希望各位老铁们能喜欢,同学们一起来了解一下吧!

Obd集群扩容新建yaml配置文件

由于资源限制问题,本次在三台机器上面启动两个observer进程模式2-2-2部署方式。

通过启动不同的监听端口实现。server不变,每台server上面启动两个ob进程。

删除proxy配置

部署ob服务

[admin@obd soft]$ obd cluster deploy obce-3zones-2 -c obce-3zone-addserver.yamlUpdate OceanBase-community-stable-el7 okUpdate OceanBase-development-kit-el7 okoceanbase-ce-3.1.2 already installed.+-------------------------------------------------------------------------------------------+| Packages |+--------------+---------+-----------------------+------------------------------------------+| Repository | Version | Release | Md5 |+--------------+---------+-----------------------+------------------------------------------+| oceanbase-ce | 3.1.2 | 10000392021123010.el7 | 7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed |+--------------+---------+-----------------------+------------------------------------------+Repository integrity check okParameter check okOpen ssh connection okRemote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository install okRemote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository lib check okCluster status check okInitializes observer work home okobce-3zones-2 deployed[admin@obd soft]$ obd cluster list+--------------------------------------------------------------------------+| Cluster List |+---------------+----------------------------------------+-----------------+| Name | Configuration Path | Status (Cached) |+---------------+----------------------------------------+-----------------+| obce-3zones | /home/admin/.obd/cluster/obce-3zones | running || obagent-only | /home/admin/.obd/cluster/obagent-only | running || obce-3zones-2 | /home/admin/.obd/cluster/obce-3zones-2 | deployed |+---------------+----------------------------------------+-----------------+

每台服务器下已经创建了对应的目录。

[root@observer01 admin]# cd /data[root@observer01 data]# lslost+found ob01 ob02[root@observer01 data]# cd /home/admin/obproxy/[root@observer01 obproxy]# cd ..[root@observer01 admin]# cd /home/admin[root@observer01 admin]# lsobproxy oceanbase-ce oceanbase-ce02[root@observer01 admin]#
修改集群配置文件

修改现有集群的配置文件将新增的observer服务器信息添加到原有集群中。

[admin@obd soft]$ cd /home/admin/.obd/cluster/obce-3zones[admin@obd obce-3zones]$ lsconfig.yaml[admin@obd obce-3zones]$ vi config.yaml

增加新服务器信息。

重启集群

[admin@obd ~]$ obd cluster restart obce-3zonesGet local repositories and plugins okOpen ssh connection okStop observer okStop obproxy okobce-3zones stoppedGet local repositories and plugins okOpen ssh connection okLoad cluster param plugin okCheck before start observer okCheck before start obproxy okStart observer okobserver program health check okConnect to observer okWait for observer init ok+--------------------------------------------------+| observer |+----------------+---------+------+-------+--------+| ip | version | port | zone | status |+----------------+---------+------+-------+--------+| xxx.xx.153.211 | 3.1.2 | 2881 | zone1 | active || xxx.xx.153.212 | 3.1.2 | 2881 | zone2 | active || xxx.xx.153.213 | 3.1.2 | 2881 | zone3 | active |+----------------+---------+------+-------+--------+Start obproxy okobproxy program health check okConnect to obproxy ok+--------------------------------------------------+| obproxy |+----------------+------+-----------------+--------+| ip | port | prometheus_port | status |+----------------+------+-----------------+--------+| xxx.xx.153.211 | 2883 | 2884 | active || xxx.xx.153.212 | 2883 | 2884 | active || xxx.xx.153.213 | 2883 | 2884 | active |+----------------+------+-----------------+--------+obce-3zones running[admin@obd ~]$
添加到集群中
MySQL [oceanbase]> alter system add server 'xxx.xx.153.212:3882' zone 'zone2'-> ;Query OK, 0 rows affected (0.024 sec)MySQL [oceanbase]> alter system add server 'xxx.xx.153.211:3882' zone 'zone1'-> ;Query OK, 0 rows affected (0.008 sec)MySQL [oceanbase]> alter system add server 'xxx.xx.153.213:3882' zone 'zone3'-> ;Query OK, 0 rows affected (0.007 sec)MySQL [oceanbase]> select svr_ip,id,zone,status from __all_server;+----------------+----+-------+--------+| svr_ip | id | zone | status |+----------------+----+-------+--------+| xxx.xx.153.211 | 1 | zone1 | active || xxx.xx.153.211 | 5 | zone1 | active || xxx.xx.153.212 | 2 | zone2 | active || xxx.xx.153.212 | 4 | zone2 | active || xxx.xx.153.213 | 3 | zone3 | active || xxx.xx.153.213 | 6 | zone3 | active |+----------------+----+-------+--------+6 rows in set (0.005 sec)MySQL [oceanbase]>
报错及处理
执行完毕2.4.4后执行添加服务器节点到集群的操作报错如下MySQL [oceanbase]> alter system add server 'xxx.xx.153.211:3882' zone 'zone1';ERROR 4179 (HY000): add non-empty server not allowedMySQL [oceanbase]> alter system add server 'xxx.xx.153.212:3882' zone 'zone2';ERROR 4179 (HY000): add non-empty server not allowed登陆集群无法添加observer到对应的zone中?解决办法:重置observer04-06步骤:1、kill observer04服务进程

2、删除对应observer的日志及data目录

rm –fr /home/admin/oceanbase-ce02/run/*rm –fr /home/admin/oceanbase-ce02/log/*rm –fr /data/ob02/sstable/*rm -fr /redo/ob02/clog/*rm -fr /redo/ob02/ilog/*rm -fr /redo/ob02/slog/*

3、obd重启集群

[admin@obd ~]$ obd cluster start obce-3zonesGet local repositories and plugins okOpen ssh connection okLoad cluster param plugin okCheck before start observer okCheck before start obproxy okStart observer okobserver program health check okConnect to observer okWait for observer init ok+--------------------------------------------------+| observer |+----------------+---------+------+-------+--------+| ip | version | port | zone | status |+----------------+---------+------+-------+--------+| xxx.xx.153.211 | 3.1.2 | 2881 | zone1 | active || xxx.xx.153.212 | 3.1.2 | 2881 | zone2 | active || xxx.xx.153.213 | 3.1.2 | 2881 | zone3 | active |+----------------+---------+------+-------+--------+Start obproxy okobproxy program health check okConnect to obproxy ok+--------------------------------------------------+| obproxy |+----------------+------+-----------------+--------+| ip | port | prometheus_port | status |+----------------+------+-----------------+--------+| xxx.xx.153.211 | 2883 | 2884 | active || xxx.xx.153.212 | 2883 | 2884 | active || xxx.xx.153.213 | 2883 | 2884 | active |+----------------+------+-----------------+--------+obce-3zones running

4、登陆sys租户添加ob节点

[admin@obd ~]$ obclient -hxxx.xx.153.211 -uroot@sys#obce-3zones -P2883 -p0EI5N08d -c -A oceanbaseWelcome to the OceanBase. Commands end with ; or \g.Your MySQL connection id is 3Server version: 5.6.25 OceanBase 3.1.2 (r10000392021123010-d4ace121deae5b81d8f0b40afbc4c02705b7fc1d) (Built Dec 30 2021 02:47:29)Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MySQL [oceanbase]>MySQL [oceanbase]>MySQL [oceanbase]>MySQL [oceanbase]> alter system add server 'xxx.xx.153.212:3882' zone 'zone2'-> ;Query OK, 0 rows affected (0.024 sec)MySQL [oceanbase]> alter system add server 'xxx.xx.153.211:3882' zone 'zone1'-> ;Query OK, 0 rows affected (0.008 sec)MySQL [oceanbase]> alter system add server 'xxx.xx.153.213:3882' zone 'zone3'-> ;Query OK, 0 rows affected (0.007 sec)MySQL [oceanbase]> select svr_ip,id,zone,status from __all_server;+----------------+----+-------+--------+| svr_ip | id | zone | status |+----------------+----+-------+--------+| xxx.xx.153.211 | 1 | zone1 | active || xxx.xx.153.211 | 5 | zone1 | active || xxx.xx.153.212 | 2 | zone2 | active || xxx.xx.153.212 | 4 | zone2 | active || xxx.xx.153.213 | 3 | zone3 | active || xxx.xx.153.213 | 6 | zone3 | active |+----------------+----+-------+--------+6 rows in set (0.005 sec)
再次重启集群查看
[admin@obd ~]$ obd cluster stop obce-3zonesGet local repositories and plugins okOpen ssh connection okStop observer okStop obproxy okobce-3zones stopped[admin@obd ~]$ obd cluster start obce-3zonesGet local repositories and plugins okOpen ssh connection okLoad cluster param plugin okCheck before start observer okCheck before start obproxy okStart observer okobserver program health check okConnect to observer okWait for observer init ok+--------------------------------------------------+| observer |+----------------+---------+------+-------+--------+| ip | version | port | zone | status |+----------------+---------+------+-------+--------+| xxx.xx.153.211 | 3.1.2 | 2881 | zone1 | active || xxx.xx.153.211 | 3.1.2 | 3881 | zone1 | active || xxx.xx.153.212 | 3.1.2 | 2881 | zone2 | active || xxx.xx.153.212 | 3.1.2 | 3881 | zone2 | active || xxx.xx.153.213 | 3.1.2 | 2881 | zone3 | active || xxx.xx.153.213 | 3.1.2 | 3881 | zone3 | active |+----------------+---------+------+-------+--------+Start obproxy okobproxy program health check okConnect to obproxy ok+--------------------------------------------------+| obproxy |+----------------+------+-----------------+--------+| ip | port | prometheus_port | status |+----------------+------+-----------------+--------+| xxx.xx.153.211 | 2883 | 2884 | active || xxx.xx.153.212 | 2883 | 2884 | active || xxx.xx.153.213 | 2883 | 2884 | active |+----------------+------+-----------------+--------+obce-3zones running

参考配置文件:

新增server配置文件:obce-3zone-addserver.yaml

# Only need to configure when remote login is requireduser:username: admin# password: your password if needkey_file: /home/admin/.ssh/id_rsa.pubport: your ssh port, default 22# timeout: ssh connection timeout (second), default 30oceanbase-ce:servers:- name: observer04# Please don't use hostname, only IP can be supportedip: xxx.153.211- name: observer05ip: xxxx3.212- name: observer06ip: 1xxxx53.213global:# 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: ens192cluster_id: 2# please set memory limit to a suitable value which is matching resource.memory_limit: 8G # The maximum running memory for an observer #min need 8g or server not startsystem_memory: 3G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.stack_size: 512Kcpu_count: 16 #不强制要求主机有16c代表cache_wash_threshold: 1G__min_full_resource_pool_memory: 268435456workers_per_cpu_quota: 10schema_history_expire_time: 1d# The value of net_thread_count had better be same as cpu's core number.net_thread_count: 4major_freeze_duty_time: Disableminor_freeze_times: 10enable_separate_sys_clog: 0enable_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: 20Gsyslog_level: WARN # 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: 10 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.# observer cluster name, consistent with obproxy's cluster_nameappname: obce-3zonesroot_password: 0EI5N08d # root user password, can be emptyproxyro_password: uY7Yf8zx # proxyro user pasword, consistent with obproxy's observer_sys_password, can be emptyobserver04:mysql_port: 3881 # External port for OceanBase Database. The default value is 2881.rpc_port: 3882 # Internal port for OceanBase Database. The default value is 2882.# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.home_path: /home/admin/oceanbase-ce02# The directory for data storage. The default value is $home_path/store.data_dir: /data/ob02# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.redo_dir: /redo/ob02zone: zone1observer05:mysql_port: 3881 # External port for OceanBase Database. The default value is 2881.rpc_port: 3882 # Internal port for OceanBase Database. The default value is 2882.# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.home_path: /home/admin/oceanbase-ce02# The directory for data storage. The default value is $home_path/store.data_dir: /data/ob02# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.redo_dir: /redo/ob02zone: zone2observer06:mysql_port: 3881 # External port for OceanBase Database. The default value is 2881.rpc_port: 3882 # Internal port for OceanBase Database. The default value is 2882.# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.home_path: /home/admin/oceanbase-ce02# The directory for data storage. The default value is $home_path/store.data_dir: /data/ob02# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.redo_dir: /redo/ob02zone: zone3

标签: #ubuntu ssh connection timeout