一、安装OBD部署工具
# 1、如果没有yum-utils,则需要安装
yum install -y yum-utils
# 2、配置OBD yum源
yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
# 3、安装OBD
yum install -y ob-deploy
二、部署名为demo的OB数据库
# 部署名为demo实例的命令
obd cluster deploy demo -c mini-local-example.yaml
# mini-local-example.yaml配置文件内容见下文
# 也可从gitee上面下载:https://gitee.com/oceanbase/obdeploy/tree/master/example
oceanbase-ce:
servers:
- 127.0.0.1
global:
home_path: /root/observer
devname: lo
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
memory_limit: 6G # The maximum running memory for an observer
system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
datafile_size: 2G # Size of the data file.
datafile_next: 2G # the auto extend step. Please enter an capacity, such as 2G
datafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20G
log_disk_size: 13G # The size of disk space used by the clog files.
cpu_count: 16
production_mode: false
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.
三、安装客户端,并修改系统资源配置
# 1.安装obclient客户端工具
yum install -y obclient
# 2.查看系统资源配置情况
ulimit -a
# 3.修改文件描述符的最大值为20万,缺省值是1024,1024对于OB数据库来说不够用,启动会报错
ulimit -n 200000
# 4.修改用户最大可用进程数为20万,缺省值是14988,修改原因同上
ulimit -u 200000
四、启动demo实例
# 启动命令
obd cluster start demo
# 销毁命令用destroy(若启动失败,要先销毁再重新部署)
obd cluster destroy demo
五、连接demo实例,结果如下
启动成功后,会打印出连接命令(见上图红框内容),复制粘贴即可。
参考链接:
1. 两分钟快速试玩 OceanBase 数据库_哔哩哔哩_bilibili
2. OceanBase社区