由于测试资源限制,本次为单机部署。
-
更改系统参数
-
下载需要的离线离线包上传至中控机
https://open.oceanbase.com/softwareCenter/community
- 安装obd
rpm -ivh ob-deploy-1.2.1-9.el7.x86_64.rpm
- 构建本地源
source /etc/profile.d/obd.sh
obd mirror clone *.rpm
- 准备配置文件
## Only need to configure when remote login is required
#https://gitee.com/oceanbase/obdeploy/blob/master/example/mini-distributed-example.yaml
user:
username: root
password: root
# key_file: your ssh-key file path if need
oceanbase-ce:
servers:
- name: z1
# Please don't use hostname, only IP can be supported
ip: 127.0.0.1
global:
# 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"
syslog_level: ERROR
devname: lo
cluster_id: 1
datafile_size: 8G
# please set memory limit to a suitable value which is matching resource.
memory_limit: 8G
system_memory: 4G
stack_size: 512K
cpu_count: 16
cache_wash_threshold: 1G
__min_full_resource_pool_memory: 268435456
workers_per_cpu_quota: 10
schema_history_expire_time: 1d
# The value of net_thread_count had better be same as cpu's core number.
net_thread_count: 4
major_freeze_duty_time: Disable
minor_freeze_times: 10
enable_separate_sys_clog: 0
enable_merge_by_turn: FALSE
datafile_disk_percentage: 20
appname: myob_test8
z1:
mysql_port: 13881
rpc_port: 13882
home_path: /root/observer_test
zone: zone1
- 部署
obd cluster deploy myob -c mini-local-example.yaml
- 启动
obd cluster start test
- 安装obproxy
rpm -ivh obproxy-3.2.0-1.el7.x86_64.rpm
cd /home/admin/obproxy-3.2.0/ && bin/obproxy -r "127.0.0.1:13881" -p 2883 -o "enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false" -c obdemo
登陆:
- 创建租户
CREATE resource unit S4C1G max_cpu=4, min_cpu=4, max_memory='1G', min_memory='1G', max_iops=10000, min_iops=1000, max_session_num=1000000, max_disk_size='1024G';
CREATE resource pool my_pool unit = 'S4C1G', unit_num = 1;
create tenant obmysql resource_pool_list=('my_pool'), primary_zone='RANDOM',comment 'mysql tenant/instance', charset='utf8' set ob_tcp_invited_nodes='%', ob_compatibility_mode='mysql';
- 使用租户登陆创建业务表