视频源
系统配置信息
操作系统:CentOS Linux release 7.8.2003 (Core)
硬件配置:8c 16g
安装yum-utils
[root@ecs-7732 ~]# yum install -y yum-utils
Loaded plugins: fastestmirror
Determining fastest mirrors
base | 3.6 kB 00:00
epel | 4.7 kB 00:00
extras | 2.9 kB 00:00
updates | 2.9 kB 00:00
(1/7): epel/x86_64/group_gz | 96 kB 00:00
(2/7): base/7/x86_64/primary_db | 6.1 MB 00:00
(3/7): base/7/x86_64/group_gz | 153 kB 00:00
(4/7): epel/x86_64/primary_db | 7.0 MB 00:00
(5/7): epel/x86_64/updateinfo | 1.0 MB 00:00
(6/7): updates/7/x86_64/primary_db | 13 MB 00:00
(7/7): extras/7/x86_64/primary_db | 243 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-54.el7_8.noarch
--> Running transaction check
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
--> Running transaction check
---> Package python-chardet.noarch 0:2.2.1-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================
Package Arch Version Repository
Size
======================================================================
Installing:
yum-utils noarch 1.1.31-54.el7_8 base 122 k
Installing for dependencies:
python-chardet noarch 2.2.1-3.el7 base 227 k
python-kitchen noarch 1.1.1-5.el7 base 267 k
Transaction Summary
======================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 616 k
Installed size: 2.8 M
Downloading packages:
(1/3): python-chardet-2.2.1-3.el7.noarch.rpm | 227 kB 00:00
(2/3): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00
(3/3): yum-utils-1.1.31-54.el7_8.noarch.rpm | 122 kB 00:00
----------------------------------------------------------------------
Total 2.3 MB/s | 616 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-chardet-2.2.1-3.el7.noarch 1/3
Installing : python-kitchen-1.1.1-5.el7.noarch 2/3
Installing : yum-utils-1.1.31-54.el7_8.noarch 3/3
Verifying : python-kitchen-1.1.1-5.el7.noarch 1/3
Verifying : yum-utils-1.1.31-54.el7_8.noarch 2/3
Verifying : python-chardet-2.2.1-3.el7.noarch 3/3
Installed:
yum-utils.noarch 0:1.1.31-54.el7_8
Dependency Installed:
python-chardet.noarch 0:2.2.1-3.el7
python-kitchen.noarch 0:1.1.1-5.el7
Complete!
添加OceanBase.repo
[root@ecs-7732 ~]# echo $LANG
en_US.UTF-8
[root@ecs-7732 ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
Loaded plugins: fastestmirror
adding repo from: https://mirrors.aliyun.com/oceanbase/OceanBase.repo
grabbing file https://mirrors.aliyun.com/oceanbase/OceanBase.repo to /etc/yum.repos.d/OceanBase.repo
repo saved to /etc/yum.repos.d/OceanBase.repo
安装OBD
[root@ecs-7732 ~]# yum install -y ob-deploy
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
oceanbase.community.stable | 3.0 kB 00:00
oceanbase.development-kit | 3.0 kB 00:00
(1/2): oceanbase.development-kit/7/x86_64/primar | 15 kB 00:00
(2/2): oceanbase.community.stable/7/x86_64/prima | 19 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package ob-deploy.x86_64 0:1.1.2-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================
Package Arch Version Repository Size
======================================================================
Installing:
ob-deploy x86_64 1.1.2-1.el7 oceanbase.community.stable 14 M
Transaction Summary
======================================================================
Install 1 Package
Total download size: 14 M
Installed size: 19 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/oceanbase.community.stable/packages/ob-deploy-1.1.2-1.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID e9b4a7aa: NOKEY
Public key for ob-deploy-1.1.2-1.el7.x86_64.rpm is not installed
ob-deploy-1.1.2-1.el7.x86_64.rpm | 14 MB 00:07
Retrieving key from http://mirrors.aliyun.com/oceanbase/RPM-GPG-KEY-OceanBase
Importing GPG key 0xE9B4A7AA:
Userid : "OceanBase"
Fingerprint: ef7d e8e3 6987 b60c acf9 9a53 2ff8 45a6 e9b4 a7aa
From : http://mirrors.aliyun.com/oceanbase/RPM-GPG-KEY-OceanBase
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ob-deploy-1.1.2-1.el7.x86_64 1/1
Installation of obd finished successfully
Please source /etc/profile.d/obd.sh to enable it
Verifying : ob-deploy-1.1.2-1.el7.x86_64 1/1
Installed:
ob-deploy.x86_64 0:1.1.2-1.el7
Complete!
上传配置文件
从这里获取mini-local-example.yaml文件
oceanbase-ce:
servers:
# Please don't use hostname, only IP can be supported
- 127.0.0.1
global:
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /root/observer
# The directory for data storage. The default value is $home_path/store.
# data_dir: /data
# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
# redo_dir: /redo
# 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"
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
# please set memory limit to a suitable value which is matching resource.
memory_limit: 8G # The maximum running memory for an observer
system_memory: 4G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
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
sys_bkgd_migration_retry_num: 3
minor_freeze_times: 10
enable_separate_sys_clog: 0
enable_merge_by_turn: FALSE
datafile_disk_percentage: 20 # The percentage of the data_dir space to the total disk space. This value takes effect only when datafile_size is 0. The default value is 90.
syslog_level: INFO # System log level. The default value is INFO.
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.
# root_password: # root user password, can be empty
[root@ecs-7732 ~]# yum -y install lrzsz
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-36.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================
Package Arch Version Repository Size
======================================================================
Installing:
lrzsz x86_64 0.12.20-36.el7 base 78 k
Transaction Summary
======================================================================
Install 1 Package
Total download size: 78 k
Installed size: 181 k
Downloading packages:
lrzsz-0.12.20-36.el7.x86_64.rpm | 78 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : lrzsz-0.12.20-36.el7.x86_64 1/1
Verifying : lrzsz-0.12.20-36.el7.x86_64 1/1
Installed:
lrzsz.x86_64 0:0.12.20-36.el7
Complete!
[root@ecs-7732 ~]# rz -E
rz waiting to receive.
[root@ecs-7732 ~]# ls
mini-local-example.yaml
[root@ecs-7732 ~]#
root用户快速启动本地单节点数据库
[root@ecs-7732 ~]# obd cluster deploy demo -c mini-local-example.yaml
Update OceanBase-community-stable-el7 ok
Update OceanBase-development-kit-el7 ok
Download oceanbase-ce-3.1.1-4.el7.x86_64.rpm (46.21 M): 100% [######################################################################] Time: 0:00:32 1.47 MB/s
Package oceanbase-ce-3.1.1 is available.
install oceanbase-ce-3.1.1 for local ok
+-----------------------------------------------------------------------------+
| Packages |
+--------------+---------+---------+------------------------------------------+
| Repository | Version | Release | Md5 |
+--------------+---------+---------+------------------------------------------+
| oceanbase-ce | 3.1.1 | 4.el7 | f19f8bfb67723712175fb0dfd60579196b3168f1 |
+--------------+---------+---------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Remote oceanbase-ce-3.1.1-f19f8bfb67723712175fb0dfd60579196b3168f1 repository install ok
Remote oceanbase-ce-3.1.1-f19f8bfb67723712175fb0dfd60579196b3168f1 repository lib check !!
[WARN] 127.0.0.1 oceanbase-ce-3.1.1-f19f8bfb67723712175fb0dfd60579196b3168f1 require: libmariadb.so.3
[WARN] 127.0.0.1 oceanbase-ce-3.1.1-f19f8bfb67723712175fb0dfd60579196b3168f1 require: libaio.so.1
Try to get lib-repository
Download oceanbase-ce-libs-3.1.1-4.el7.x86_64.rpm (155.15 K): 100% [################################################################] Time: 0:00:00 3.16 MB/s
Package oceanbase-ce-libs-3.1.1 is available.
install oceanbase-ce-libs-3.1.1 for local ok
Use oceanbase-ce-libs-3.1.1-58384f7ab4ee736e9d530f4bdd63c20ced0e7aba for oceanbase-ce-3.1.1-f19f8bfb67723712175fb0dfd60579196b3168f1
Remote oceanbase-ce-libs-3.1.1-58384f7ab4ee736e9d530f4bdd63c20ced0e7aba repository install ok
Remote oceanbase-ce-3.1.1-f19f8bfb67723712175fb0dfd60579196b3168f1 repository lib check ok
Cluster status check ok
Initializes observer work home ok
demo deployed
安装obclient客户端
[root@ecs-7732 ~]# yum install -y obclient
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package obclient.x86_64 0:2.0.0-2.el7 will be installed
--> Processing Dependency: libobclient >= 2.0.0 for package: obclient-2.0.0-2.el7.x86_64
--> Running transaction check
---> Package libobclient.x86_64 0:2.0.0-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================
Package Arch Version Repository Size
=================================================================================
Installing:
obclient x86_64 2.0.0-2.el7 oceanbase.community.stable 40 M
Installing for dependencies:
libobclient x86_64 2.0.0-2.el7 oceanbase.community.stable 643 k
Transaction Summary
=================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 41 M
Installed size: 188 M
Downloading packages:
(1/2): libobclient-2.0.0-2.el7.x86_64.rpm | 643 kB 00:00:00
(2/2): obclient-2.0.0-2.el7.x86_64.rpm 44% [======================== ] 1.3 MB/s | 18 MB 00:00:16 ETA (2/2): obclient-2.0.0-2.el7.x86_64.rpm 44% [===========(2/2): obclient-2.0.0-2.el7.x86_64.rpm 44% [===========(2/2): obclient-2.0.0-2.el7.x86_64.rpm | 40 MB 00:00:30
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.3 MB/s | 41 MB 00:00:30
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libobclient-2.0.0-2.el7.x86_64 1/2
Installing : obclient-2.0.0-2.el7.x86_64 2/2
Verifying : libobclient-2.0.0-2.el7.x86_64 1/2
Verifying : obclient-2.0.0-2.el7.x86_64 2/2
Installed:
obclient.x86_64 0:2.0.0-2.el7
Dependency Installed:
libobclient.x86_64 0:2.0.0-2.el7
Complete!
启动集群并尝试登录
[root@ecs-7732 ~]# obd cluster start demo
Get local repositories and plugins ok
Open ssh connection ok
Cluster param config check ok
Check before start observer ok
[WARN] (127.0.0.1) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] (127.0.0.1) The recommended number of open files is 655350 (Current value: 65535)
[WARN] (127.0.0.1) clog and data use the same disk (/)
Start observer ok
observer program health check ok
Connect to observer ok
Initialize cluster
Cluster bootstrap ok
Wait for observer init ok
+---------------------------------------------+
| observer |
+-----------+---------+------+-------+--------+
| ip | version | port | zone | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 3.1.1 | 2881 | zone1 | active |
+-----------+---------+------+-------+--------+
demo running
[root@ecs-7732 ~]# obclient -h127.0.01 -P2881 -uroot
Welcome to the OceanBase. Commands end with ; or \g.
Your MySQL connection id is 3221487629
Server version: 5.7.25 OceanBase 3.1.1 (r4-8c615943cbd25a6f7b8bdfd8677a13a21709a05e) (Built Oct 21 2021 10:33:14)
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)]> \q
Bye
[root@ecs-7732 ~]#
学习资源
欢迎各位同学一起来交流学习心得!
最后修改时间:2021-12-26 10:15:30
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。