本文介绍了手动部署OceanBase单节点集群,到创建MySQL租户的实操步骤,供大家参考。
一、环境准备
[root@10 ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@10 ~]# free -g
total used free shared buff/cache available
Mem: 11 7 0 0 4 3
Swap: 4 0 4
因为docker安装经常会出现警告的提示,需要修改资源限制文件 vi /etc/security/limits.conf,添加以下内容
* soft nofile 655360
* hard nofile 655360
* soft nproc 655360
* hard nproc 655360
* soft core unlimited
* hard core unlimited
* soft stack unlimited
* hard stack unlimited
修改[/etc/sysctl.conf
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 = 0
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
vm.max_map_count=655360
fs.aio-max-nr=1048576
授权admin用户拥有sudo权限
[root@10 ~]# chmod u+w /etc/sudoers
[root@10 ~]#
[root@10 ~]# vi /etc/sudoers
二、安装OBSERVER
需要安装OceanBase 的 OBSERVER 软件来手动部署
[admin@10 ~]$ sudo rpm -ivh /tmp/oceanbase-ce-*.rpm
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for admin:
Preparing... ################################# [100%]
Updating / installing...
1:oceanbase-ce-libs-3.1.4-100000920################################# [ 50%]
2:oceanbase-ce-3.1.4-10000092022071################################# [100%]
初始化数据目录
OceanBase 节点上的相关目录都需要手动创建。
[admin@10 ~]$ sudo mkdir -p /data [admin@10 ~]$ sudo mkdir -p /redo [admin@10 ~]$ sudo chown -R admin:admin /data [admin@10 ~]$ sudo chown -R admin:admin /redo
mkdir -p ~/oceanbase/store/obdemo /data/obdemo/{sstable,etc3} /redo/ob