之前体验了oceanbase1.4版本,回顾:一步一步学习OceanBase系列
在实操1.4版本的过程中,对oceanbase基本的架构和功能有了一定的了解,在此基础上,进入2.2版本要顺畅一些了。
OceanBase 2.2集群初体验——手动安装ob2.2集群
一、安装规划
1.1、服务器规划:
一般需要 4 台服务器,其中:
1台部署 OCP 平台
3台部署最小规模的 OceanBase 1-1-1 架构的集群,每个 zone 一台机器。
资源要求:2.2版本要求服务器资源16cpu、128G内存以上,如果绕开OCP,内存至少64G。
官网下载的ob2.2只包含observer和obproxy,不包含ocp,因此这里只需要三台服务器,采用手动安装OB2.2集群,不通过OCP来安装配置,且按最小资源来安装。
本人亲测,内存小于64G,根本安装不上OB2.2版本,observer进程启动不起来:cannot allocate memory.sz=65536, pages_=0,total_=0
另外,不能按照安装包observer_trial_x86里面的安装步骤来手动安装,因为安装包里的步骤是没设置启动参数,不然64G内存也没法安装。
节点信息:16cpu+64g内存
ob01: 172.16.18.81
ob02: 172.16.18.82
ob03: 172.16.18.91
端口
ob集群内RPC服务端口 2882
observer客户端端口 2881
obproxy客户端端口 2883
安装用户 admin
软件安装目录 /home/admin/oceanbase
集群名称 obdemo
1.2、磁盘规划:
(1)、数据盘 /data/1
数据盘承载了基线数据,物理上只有一个基线数据文件block_file,在安装目录 store/sstable 下。
通过 OBServer 进程启动时一次性创建,大小根据启动参数 datafile_disk_percentage 采用磁盘预分配策略,默认值为 95%,创建后无法调整大小。
(2)、事务日志盘 /data/log1
事务日志盘包含多个固定大小的小文件,位于安装目录 store/{clog,ilog,slog},按需自动创建和清除,磁盘写到 80% 会触发自清除逻辑。
大小要求:内存大小3-4倍
(3)、OceanBase软件安装盘: /home
大小建议100G+
OceanBase 的 rpm 包安装目录在/home/admin/oceanbase 下,其中基线数据文件和事务日志文件会通过软连接指向上述的两个独立磁盘,
还有另外一个不断增长的文件是 OB 运行日志,在安装目录 log下。
OB 进程本身无法自删除运行日志,需要定时任务或运维脚本完成删除逻辑。
如:
/dev/vdb1 99G 61M 94G 1% /data/1
/dev/vdc1 99G 61M 94G 1% /data/log1
/dev/vdd1 99G 61M 94G 1% /home
注意 :
确保 /data/1 和 /data/log1 目录为空
/data/1 目录的磁盘已使用必须率低于 4%
1.3、操作系统要求:
CentOS 7.2+ / RedHat 7.2+
本文是基于centos7.7安装。
# cat /etc/system-release
CentOS Linux release 7.7.1908 (Core)
二、准备安装环境
2.1、操作系统检查
(1)、操作系统版本\CPU\内存\磁盘等检查
(2)、配置YUM源
(3).操作系统软件环境
Java环境: JDK 1.8+
Python环境: Python 2.7+
mysql客户端: mariadb
# rpm --query --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n" tree lvm2 lsof net-tools ntp ntpdate python mariadb
2.2、安装ob软件依赖包
# rpm --query --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n" expat expect gcc gcc-c++ glibc libgcc libaio libcurl openssl openldap
2.3、内核参数配置
内核参数主要是网络、内存相关的设置。修改/etc/sysctl.conf文件
# vi /etc/sysctl.conf
# for oceanbase 2.2
fs.file-max = 655350
fs.aio-max-nr = 3145728
kernel.core_uses_pid = 1
kernel.exec-shield = 1
kernel.msgmax = 65536
kernel.msgmnb = 65536
kernel.randomize_va_space = 1
kernel.sem = 250 32000 100 128
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.sysrq = 0
net.bridge.bridge-nf-call-arptables = 0
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.core.netdev_max_backlog = 10000
net.core.rmem_default = 262144
net.core.rmem_max = 16777216
net.core.somaxconn = 2048
net.core.wmem_default = 262144
net.core.wmem_max = 16777216
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.ip_forward = 0
net.ipv4.ip_local_port_range = 40000 65535
net.ipv4.tcp_fin_timeout = 5
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_mem = 8388608 12582912 16777216
net.ipv4.tcp_rmem = 8192 87380 16777216
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_wmem = 8192 65536 16777216
net.netfilter.nf_conntrack_max = 1200000
net.nf_conntrack_max = 1200000
vm.mmap_min_addr = 4096
vm.min_free_kbytes = 398520
vm.swappiness = 0
fs.bio_netoops = 0
2.4、用户会话设置
使用命令ulimit可以查看用户会话默认限制。修改下面文件可以默认会话限制修改永久生效。修改/etc/security/limits.conf文件
# vi /etc/security/limits.conf
* soft nofile 655360
* hard nofile 655360
* soft nproc 655360
* hard nproc 655360
* soft stack unlimited
* hard stack unlimited
2.5、关闭防火墙和SELinux
Linux的防火墙和SELinux安全特性可能会导致OceanBase各个节点之间通信异常,所以都建议关闭
# systemctl disable firewalld
# systemctl stop firewalld
# systemctl status firewalld
# vi /etc/selinux/config 文件 , 修改 SELINUX=disabled
2.6、配置ntp时钟同步
OceanBase是个分布式数据库,要求各个observer节点的时间保持同步,时间误差控制在50ms以内。
节点时间误差偏大时,后面初始化OceanBase集群会失败,或者现有的OceanBase集群会出现异常。
节点间的时间同步要靠Linux的NTP同步来保证。
检查时间误差使用clockdiff命令。
clockdiff 172.16.18.81
clockdiff 172.16.18.82
clockdiff 172.16.18.91
ntp配置示例:
(1).NTP Server 端: 172.16.18.81
# vi /etc/ntp.conf
server 127.127.1.0
# service ntpd restart
# chkconfig ntpd on
# ntpq -p
(2).NTP client 端: 172.16.18.82\172.16.18.91
# ntpdate 172.16.18.81
# vi /etc/ntp.conf
server 172.16.18.81
# service ntpd restart
# chkconfig ntpd on
# ntpq -p
2.7、创建安装用户
创建 OceanBase 的安装用户 admin
# groupadd -g 500 admin
# useradd -d "/home/admin" -u 500 -g 500 -m -s /bin/bash admin
# passwd admin
三、开始手动安装OceanBase2.2集群
3.1、清理老的OB(第一次不用,方便后面安装ob集群有问题时,重新做)
su - admin
kill -9 `pidof observer`
sleep 3
/bin/rm -rf /data/1/obdemo
/bin/rm -rf /data/log1/obdemo
/bin/rm -rf /home/admin/oceanbase/store/obdemo /home/admin/oceanbase/log/* /home/admin/oceanbase/etc/*config*
ps -ef|grep observer
df -h |egrep home\|data
--*/
3.2、安装oceanbase软件
首先确保admin用户已经创建,相应的文件系统目录{/home/admin/ , /data/1 , /data/log1 }都存在,并且空间大小符合要求。
oceanbase软件默认会安装在目录/home/admin/oceanbase下。
# rpm -ivh oceanbase-2.2.30-1855102.el7.x86_64.rpm
warning: Unable to get systemd shutdown inhibition lock: Unit is masked.
Preparing... ################################# [100%]
Updating / installing...
1:oceanbase-2.2.30-1855102.el7 ################################# [100%]
3.3、admin用户登录,初始化目录
su - admin
mkdir -p /data/1/obdemo/{etc3,sort_dir,sstable}
mkdir -p /data/log1/obdemo/{clog,etc2,ilog,slog,oob_clog}
mkdir -p /home/admin/oceanbase/store/obdemo
for t in {etc3,sort_dir,sstable};do ln -s /data/1/obdemo/$t /home/admin/oceanbase/store/obdemo/$t; done
for t in {clog,etc2,ilog,slog,oob_clog};do ln -s /data/log1/obdemo/$t /home/admin/oceanbase/store/obdemo/$t; done
3.4、启动OBserver进程
到每个节点的admin用户下,启动observer进程,注意修改 zone, IP, 网卡名字。
参数里指定数据文件的大小、内存的大小,以方便个别环境资源不足想精确控制observer对资源的占用。具体说明如下:
-i 后接网卡名称。如果有2个网卡,要指定业务IP所在的网卡名称。
-P RPC端口
-p 客户端连接断口
-z 后接Zone名称,可以自定义。Zone是逻辑机房概念,三台机器分属于不同机房,不能重复。
-d 后跟集群主目录,除集群名字obdemo外,其他不要变动。
-r 后跟一组服务器信息,格式是ip:RPC端口:客户端连接端口,如ip:2882:2881,分号分割,表示rootservice list信息。三台机器参数一致。
-c 后跟集群ID,一组数字,可以自定义。同一个集群,ID必须相同,不同集群不要重复即可。
-n 后跟集群名称,可以自定义,不同集群名称不要重复即可。
-o 后跟集群参数,需要根据实际情况设置。system_memory 指定OB内部保留内存,默认是30G,机器内存比较少的情况下把这个调小,影响就是可能在性能测试时有内存不足问题。
datafile_size 指定OceanBase数据文件sstable的大小(一次性初始化),根据/data/1/ 可用空间评估,建议不少于100G,同时又保留一些剩余空间。
如果/data/1跟/data/log1本身就是一个文件系统(共用一个盘),那么务必保证留给/data/log1的空间大小是内存的2-4倍。config_additional_dir指定参数文件的冗余目录。
# su - admin
$ cd /home/admin/oceanbase
zone1 81节点:
$ bin/observer -i eth0 -P 2882 -p 2881 -z zone1 -d /home/admin/oceanbase/store/obdemo -r '172.16.18.81:2882:2881;172.16.18.82:2882:2881;172.16.18.91:2882:2881' -c 20200812 -n obdemo -o "system_memory=10G,datafile_size=40G,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2"
devname: eth0
rpc port: 2882
mysql port: 2881
zone: zone1
data_dir: /home/admin/oceanbase/store/obdemo
rs list: 172.16.18.81:2882:2881;172.16.18.82:2882:2881;172.16.18.91:2882:2881
cluster id: 20200812
appname: obdemo
optstr: system_memory=10G,datafile_size=40G,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2
$
$ ps -ef|grep observer
admin 4932 1 99 11:36 ? 00:00:10 bin/observer -i eth0 -P 2882 -p 2881 -z zone1 -d /home/admin/oceanbase/store/obdemo -r 172.16.18.81:2882:2881;172.16.18.82:2882:2881;172.16.18.91:2882:2881 -c 20200812 -n obdemo -o system_memory=10G,datafile_size=40G,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2
admin 5880 4826 0 11:36 pts/0 00:00:00 grep --color=auto observer
$
$ df -h |egrep home\|data
/dev/vdb1 50G 41G 6.6G 86% /data/1
/dev/vdd1 50G 1.3G 46G 3% /home
/dev/vdc1 50G 117M 47G 1% /data/log1
$
备注:启动ob进程时,报错fid file doesn't exist(pidfile="run/observer.pid"),如果ob进程启动了,此错误可以忽略。
zone2 82节点:
$ bin/observer -i eth0 -P 2882 -p 2881 -z zone2 -d /home/admin/oceanbase/store/obdemo -r '172.16.18.81:2882:2881;172.16.18.82:2882:2881;172.16.18.91:2882:2881' -c 20200812 -n obdemo -o "system_memory=10G,datafile_size=40G,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2"
$ ps -ef|grep observer
$ cat log/observer.log
zone3 91节点:
$ bin/observer -i eth0 -P 2882 -p 2881 -z zone3 -d /home/admin/oceanbase/store/obdemo -r '172.16.18.81:2882:2881;172.16.18.82:2882:2881;172.16.18.91:2882:2881' -c 20200812 -n obdemo -o "system_memory=10G,datafile_size=40G,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2"
$ ps -ef|grep observer
$ cat log/observer.log
3.5、初始化OB集群
3个节点的observer进程都启动后,开始集群初始化bootstrap,这一步至关重要,成败在此一举。
使用mysql命令登录任一节点,然后执行bootstrap集群初始化命令。
$ mysql -h172.16.18.81 -uroot -P2881 -p
Enter password: --不要输入密码,直接回车
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221225472
Server version: 5.7.25 OceanBase 2.2.30 (r20200515183156-366007805d18f72e1fbd8568ada91849305c53ac) (Built May 15 2020 19:45:08)
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 [(none)]> set session ob_query_timeout=1000000000;
Query OK, 0 rows affected (0.00 sec)
MySQL [(none)]> alter system bootstrap ZONE 'zone1' SERVER '172.16.18.81:2882', ZONE 'zone2' SERVER '172.16.18.82:2882', ZONE 'zone3' SERVER '172.16.18.91:2882';
Query OK, 0 rows affected (42.02 sec)
MySQL [(none)]>
注意:
如果这一步初始化失败报错了,其原因很可能就是三节点observer进程启动参数有不对、observer相关目录权限不对、日志目录空间不足一定比例(跟数据目录合用了大目录,空间被数据目录占用了)、三节点时间不同步、节点内存资源不足等等。
请先排查这些问题点后,然后清理OB(从3.1开始)从头开始。
3.6、验证OB集群初始化成功
使用mysql命令登录任一节点,注意登录命令的username格式需要变化一下。ob集群默认会有个sys租户,该sys租户的管理员用户为root@sys,密码默认为空,初始化成功后请修改密码。
$ mysql -h172.16.18.81 -uroot@sys -P2881 -p -c -A
Enter password: --不要输入密码,直接回车
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221520383
Server version: 5.7.25 OceanBase 2.2.30 (r20200515183156-366007805d18f72e1fbd8568ada91849305c53ac) (Built May 15 2020 19:45:08)
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 [(none)]> select version();
+-----------+
| version() |
+-----------+
| 2.2.30 |
+-----------+
1 row in set (0.00 sec)
MySQL [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| oceanbase |
| information_schema |
| mysql |
| SYS |
| LBACSYS |
| ORAAUDITOR |
| test |
+--------------------+
7 rows in set (0.01 sec)
MySQL [(none)]>
能看到数据库列表里有oceanbase即可。
同时,对比oceanbase 1.4版本,2.x版本多了三个database: SYS、LBACSYS、ORAAUDITOR
四、配置OB集群
4.1、修改sys租户管理员密码
ob集群默认会有个sys租户,集群初始化成功后,修改默认sys租户管理员root@sys的密码。
$ mysql -h172.16.18.81 -uroot@sys -P2881 -p -c -A
Enter password: --不要输入密码,直接回车
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221520383
Server version: 5.7.25 OceanBase 2.2.30 (r20200515183156-366007805d18f72e1fbd8568ada91849305c53ac) (Built May 15 2020 19:45:08)
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 [(none)]> alter user root identified by 'admin123';
Query OK, 0 rows affected (0.05 sec)
MySQL [(none)]> exit
By
$
退出使用密码登录验证,查看集群资源信息。
$ mysql -h172.16.18.81 -uroot@sys -P2881 -padmin123 -c -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221522120
Server version: 5.7.25 OceanBase 2.2.30 (r20200515183156-366007805d18f72e1fbd8568ada91849305c53ac) (Built May 15 2020 19:45:08)
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 [(none)]> select version();
+-----------+
| version() |
+-----------+
| 2.2.30 |
+-----------+
1 row in set (0.00 sec)
MySQL [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| oceanbase |
| information_schema |
| mysql |
| SYS |
| LBACSYS |
| ORAAUDITOR |
| test |
+--------------------+
7 rows in set (0.01 sec)
MySQL [(none)]>
4.2、集群初始化参数配置
如果 /home/admin 目录空间很紧张,则设置运行日志滚动输出,根据实际情况修改。
mysql -h127.1 -uroot@sys -P2881 -p -c -A
Enter password:
-- observer log自清理设置
alter system set enable_syslog_recycle=true;
alter system set max_syslog_file_count=10;
show parameters where name in ('enable_syslog_recycle', 'max_syslog_file_count');
五、查看OB集群详细信息
$ mysql -h172.16.18.81 -uroot@sys -P2881 -padmin123 -c -A oceanbase
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221517290
Server version: 5.7.25 OceanBase 2.2.30 (r20200515183156-366007805d18f72e1fbd8568ada91849305c53ac) (Built May 15 2020 19:45:08)
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]> select version();
+-----------+
| version() |
+-----------+
| 2.2.30 |
+-----------+
1 row in set (0.00 sec)
MySQL [oceanbase]> show databases;
+--------------------+
| Database |
+--------------------+
| oceanbase |
| information_schema |
| mysql |
| SYS |
| LBACSYS |
| ORAAUDITOR |
| test |
+--------------------+
7 rows in set (0.01 sec)
查看OB集群所有节点信息
MySQL [oceanbase]> select zone,svr_ip,svr_port,inner_port,with_rootserver,status,gmt_create from __all_server order by zone, svr_ip;
+-------+--------------+----------+------------+-----------------+--------+----------------------------+
| zone | svr_ip | svr_port | inner_port | with_rootserver | status | gmt_create |
+-------+--------------+----------+------------+-----------------+--------+----------------------------+
| zone1 | 172.16.18.81 | 2882 | 2881 | 1 | active | 2020-08-12 12:04:47.793896 |
| zone2 | 172.16.18.82 | 2882 | 2881 | 0 | active | 2020-08-12 12:04:45.388593 |
| zone3 | 172.16.18.91 | 2882 | 2881 | 0 | active | 2020-08-12 12:04:45.374074 |
+-------+--------------+----------+------------+-----------------+--------+----------------------------+
3 rows in set (0.01 sec)
查看OB集群所有租户信息
MySQL [oceanbase]> select tenant_id, tenant_name, zone_list, locality ,gmt_modified from __all_tenant;
+-----------+-------------+-------------------+---------------------------------------------+----------------------------+
| tenant_id | tenant_name | zone_list | locality | gmt_modified |
+-----------+-------------+-------------------+---------------------------------------------+----------------------------+
| 1 | sys | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | 2020-08-12 12:05:00.986146 |
+-----------+-------------+-------------------+---------------------------------------------+----------------------------+
1 row in set (0.00 sec)
查看OceanBase集群所有节点可用资源情况
MySQL [oceanbase]> select zone, svr_ip, svr_port,inner_port, cpu_total, cpu_assigned,
-> round(mem_total/1024/1024/1024) mem_total_gb,
-> round(mem_assigned/1024/1024/1024) mem_ass_gb,
-> round(disk_total/1024/1024/1024) disk_total_gb,
-> unit_num, substr(build_version,1,6) version
-> from __all_virtual_server_stat
-> order by zone, svr_ip, inner_port;
+-------+--------------+----------+------------+-----------+--------------+--------------+------------+---------------+----------+---------+
| zone | svr_ip | svr_port | inner_port | cpu_total | cpu_assigned | mem_total_gb | mem_ass_gb | disk_total_gb | unit_num | version |
+-------+--------------+----------+------------+-----------+--------------+--------------+------------+---------------+----------+---------+
| zone1 | 172.16.18.81 | 2882 | 2881 | 14 | 2.5 | 43 | 11 | 40 | 1 | 2.2.30 |
| zone2 | 172.16.18.82 | 2882 | 2881 | 14 | 2.5 | 43 | 11 | 40 | 1 | 2.2.30 |
| zone3 | 172.16.18.91 | 2882 | 2881 | 14 | 2.5 | 43 | 11 | 40 | 1 | 2.2.30 |
+-------+--------------+----------+------------+-----------+--------------+--------------+------------+---------------+----------+---------+
3 rows in set (0.01 sec)
MySQL [oceanbase]> select a.zone,concat(a.svr_ip,':',a.svr_port) observer, cpu_total, (cpu_total-cpu_assigned) cpu_free,
-> round(mem_total/1024/1024/1024) mem_total_gb, round((mem_total-mem_assigned)/1024/1024/1024) mem_free_gb,
-> round(disk_total/1024/1024/1024) disk_total_gb,
-> substr(a.build_version,1,6) version,usec_to_time(b.start_service_time) start_service_time
-> from __all_virtual_server_stat a join __all_server b on (a.svr_ip=b.svr_ip and a.svr_port=b.svr_port)
-> order by a.zone, a.svr_ip;
+-------+-------------------+-----------+----------+--------------+-------------+---------------+---------+----------------------------+
| zone | observer | cpu_total | cpu_free | mem_total_gb | mem_free_gb | disk_total_gb | version | start_service_time |
+-------+-------------------+-----------+----------+--------------+-------------+---------------+---------+----------------------------+
| zone1 | 172.16.18.81:2882 | 14 | 11.5 | 43 | 33 | 40 | 2.2.30 | 2020-08-12 12:05:02.983508 |
| zone2 | 172.16.18.82:2882 | 14 | 11.5 | 43 | 33 | 40 | 2.2.30 | 2020-08-12 12:05:04.159878 |
| zone3 | 172.16.18.91:2882 | 14 | 11.5 | 43 | 33 | 40 | 2.2.30 | 2020-08-12 12:05:05.166067 |
+-------+-------------------+-----------+----------+--------------+-------------+---------------+---------+----------------------------+
3 rows in set (0.01 sec)
查看集群资源池具体使用情况
MySQL [oceanbase]> select t1.name resource_pool_name, t2.`name` unit_config_name, t2.max_cpu, t2.min_cpu,
-> round(t2.max_memory/1024/1024/1024) max_mem_gb, round(t2.min_memory/1024/1024/1024) min_mem_gb,
-> t3.unit_id, t3.zone, concat(t3.svr_ip,':',t3.`svr_port`) observer,t4.tenant_id, t4.tenant_name
-> from __all_resource_pool t1 join __all_unit_config t2 on (t1.unit_config_id=t2.unit_config_id)
-> join __all_unit t3 on (t1.`resource_pool_id` = t3.`resource_pool_id`)
-> left join __all_tenant t4 on (t1.tenant_id=t4.tenant_id)
-> order by t1.`resource_pool_id`, t2.`unit_config_id`, t3.unit_id
-> ;
+--------------------+------------------+---------+---------+------------+------------+---------+-------+-------------------+-----------+-------------+
| resource_pool_name | unit_config_name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | unit_id | zone | observer | tenant_id | tenant_name |
+--------------------+------------------+---------+---------+------------+------------+---------+-------+-------------------+-----------+-------------+
| sys_pool | sys_unit_config | 5 | 2.5 | 13 | 11 | 1 | zone1 | 172.16.18.81:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 13 | 11 | 2 | zone2 | 172.16.18.82:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 13 | 11 | 3 | zone3 | 172.16.18.91:2882 | 1 | sys |
+--------------------+------------------+---------+---------+------------+------------+---------+-------+-------------------+-----------+-------------+
3 rows in set (0.01 sec)
查看OB集群资源单元unit配置情况
MySQL [oceanbase]> select unit_config_id,name,max_cpu,min_cpu,round(max_memory/1024/1024/1024) max_mem_gb,
-> round(min_memory/1024/1024/1024) min_mem_gb, round(max_disk_size/1024/1024/1024) max_disk_size_gb
-> from __all_unit_config
-> order by unit_config_id;
+----------------+-----------------+---------+---------+------------+------------+------------------+
| unit_config_id | name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | max_disk_size_gb |
+----------------+-----------------+---------+---------+------------+------------+------------------+
| 1 | sys_unit_config | 5 | 2.5 | 13 | 11 | 40 |
+----------------+-----------------+---------+---------+------------+------------+------------------+
1 row in set (0.00 sec)
MySQL [oceanbase]>
从上面可以看出,oceanbase 2.2默认sys租户使用了2.5-5个CPU,11-13G内存。确实比ob1.4内存要求更大。整个OB2.2集群资源大概还可分配使用11.5cpu+33g内存。
到此,OceanBase2.2集群手动安装体验到此结束。
一步一步学习OceanBase系列
下次实操继续更新~~~
复制
最后修改时间:2020-08-13 08:43:32
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
👍,高产啊
4年前

1
相关阅读
2025年2月国产数据库中标情况一览:GoldenDB 3500+万!达梦近千万!
通讯员
914次阅读
2025-03-06 11:40:20
OceanBase赋能百丽核心系统上线,护航双11流量洪峰
OceanBase数据库
204次阅读
2025-03-20 20:34:04
OceanBase 单机版发布,针对中小规模业务场景
通讯员
176次阅读
2025-03-28 12:01:19
从理论到实践:深入探索 OceanBase 原生分布式架构
shunwahⓂ️
164次阅读
2025-03-13 16:06:34
宁波市政府框采:优炫、南大通用、东方金信、金仓、达梦、OceanBase等多家数据库产品入围
通讯员
151次阅读
2025-03-10 12:30:06
OceanBase亮相「党政信息化产品技术选型供需对接会」,助力党政关键业务系统升级
OceanBase
147次阅读
2025-03-27 09:55:58
TP与AP共生之道:OceanBase 4.3.5 HTAP混合负载实战
shunwahⓂ️
114次阅读
2025-03-27 15:04:42
OceanBase首届合作伙伴峰会:携手伙伴共赢云和AI时代
OceanBase数据库
106次阅读
2025-03-26 15:29:59
OceanBase单机版上线|构建分布式到单机场景的全栈解决方案
OceanBase数据库
88次阅读
2025-03-30 17:08:58
独立数据库OceanBase合作伙伴数量已超1200家
通讯员
81次阅读
2025-03-28 10:23:34