手动部署 OceanBase 集群

举报
snowofsummer 发表于 2021/12/06 15:52:38 2021/12/06
【摘要】 1,软件下载地址https://open.oceanbase.com/softwareCenter/community软件包:2,系统版本[root@db01 ~]# cat /etc/redhat-releaseCentOS Linux release 7.8.2003 (Core)3,新建admin用户,并配置系统参数# 新增普通用户 adminuseradd admin# 改用户密码p...

1,软件下载地址

https://open.oceanbase.com/softwareCenter/community

软件包:

2,系统版本

[root@db01 ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)

3,新建admin用户,并配置系统参数

# 新增普通用户 admin
useradd admin

# 改用户密码
passwd admin

# 或下面命令指定密码,密码修改为自己的。

echo 'admin:adminPWD123' | chpasswd



vim /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


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

vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled

systemctl disable firewalld 
systemctl stop firewalld
systemctl status firewalld

4,软件安装

rpm -ivh oceanbase-ce-*.rpm
rpm -ivh obclient-2.0.0-1.el7.x86_64.rpm
rpm -ivh obproxy-3.1.0-1.el7.x86_64.rpm

5,admin用户初始化相关目录

#admin用户:

mkdir /data
mkdir /redo
chown admin:admin /data
chown admin:admin /redo
su - admin
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/oceanbase/lib' >> ~/.bash_profile
. ~/.bash_profile
mkdir -p ~/oceanbase/store/obdemo  /data/obdemo/{sstable,etc3} /redo/obdemo/{clog,ilog,slog,etc2}
for f in {clog,ilog,slog,etc2}; do ln -s /redo/obdemo/$f ~/oceanbase/store/obdemo/$f ; done
for f in {sstable,etc3}; do ln -s /data/obdemo/$f ~/oceanbase/store/obdemo/$f; done

#redo,data建议独立磁盘分区,大小100G

6,admin用户启动observer 

cd ~/oceanbase && 
bin/observer -i ens192 -p 2881 -P 2882 -z zone1 -d ~/oceanbase/store/obdemo -r '192.168.5.200:2882:2881' -c 20210912 -n obdemo -o 

"memory_limit=8G,cache_wash_threshold=1G,__min_full_resource_pool_memory=268435456,system_memory=3G,memory_chunk_cache_size=128M,cpu_count=16,net_thread_count=4,datafi

le_size=50G,stack_size=1536K,config_additional_dir=/data/obdemo/etc3;/redo/obdemo/etc2"

7,集群初始化

obclient -h 192.168.5.200 -u root -P 2881 -p -c -A
set session ob_query_timeout=1000000000; alter system bootstrap ZONE 'zone1' SERVER '192.168.5.200:2882';

8,建立proxyro用户

登陆数据库:root@sys 
#密码为空
obclient -h 192.168.5.200  -u root@sys -P 2881 -p -c -A
grant select on oceanbase.* to proxyro identified by 'SWoLCQRH' ;

9,启动proxy

#启动proxy
#集群名称和observer要一致。
/home/admin/obproxy-3.2.0/bin/obproxy -r "127.0.0.1:2881" -p 2883 -o "enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false" -c  obdemo

#连接obproxy,并设置密码,才能连接后端数据库
obclient -h 127.0.0.1 -u root@proxysys -P 2883 -p
alter proxyconfig set observer_sys_password = 'SWoLCQRH' ;

10,通过obproxy 2883l连接数据库

#通过proxy连接租户:用户:租户:集群名称
obclient -h127.1 -uroot@sys#obdemo -P2883 -prootPWD123 -c -A oceanbase

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。