当前位置:网站首页>The OBD deployment mode of oceanbase Community Edition is installed locally
The OBD deployment mode of oceanbase Community Edition is installed locally
2022-07-05 15:41:00 【Prodigal son Wu Tian】
One 、OceanBase Database introduction
OceanBase It is a domestic native distributed database independently developed by ant group , From 2010 year . Innovative launch “ Three places five centers ” New urban disaster recovery standards , It's a TPC-C and TPC-H A domestic native distributed database that has set a new world record in the test . The product adopts self-developed integrated architecture , Take into account the scalability of distributed architecture and the performance advantages of centralized architecture , Support with one set of engines at the same time TP and AP Mixed load of , With strong data consistency 、 High availability 、 High performance 、 Online expansion 、 Highly compatible SQL Standards and mainstream relational databases 、 Low cost and so on .2021 year 6 month 1 Japan ,OceanBase Officially announced open source , And set up OceanBase The open source community , The community official website is online at the same time ,300 Wanhang's core code is open to the community .
Two 、 Installation requirements
Local installation , That is, the central control machine and the target machine are the same machine . With OceanBase database 3.1.3 Version as an example , The system software and hardware requirements are as follows :
project | describe |
---|---|
System | Anolis OS 8.X edition ( kernel Linux 3.10.0 Version and above )-- recommend Red Hat Enterprise Linux Server 7.X edition 、8.X edition ( kernel Linux 3.10.0 Version and above ) – recommend CentOS Linux 7.X edition 、8.X edition ( kernel Linux 3.10.0 Version and above ) – recommend Debian 9.X Version and above ( kernel Linux 3.10.0 Version and above ) Ubuntu 20.X Version and above ( kernel Linux 3.10.0 Version and above ) |
CPU | Minimum requirements for enterprise users 16 nucleus , recommend 32 Nuclear and above Minimum requirements for individual users 2 nucleus , recommend 8 Nuclear and above |
Memory | Minimum requirements for enterprise users 64G, recommend 256G And above Minimum requirements for simple trial of individual users 8G, The requirement for long-term use is no less than 32G, recommend 64G And above Memory is less than 64G It is recommended to use OBD Deployment cluster , Not recommended OCP Deploy small clusters |
Disk type | Recommended SSD |
Disk storage space | Memory size 4 Times and above |
file system | EXT4 A kind of XFS, When the data exceeds 16T when , Use XFS |
network card | Gigabit interconnection and above |
3、 ... and 、 Environmental preparation
1、 View software and hardware resources
# Use the following command to check whether the system software and hardware environment meet OceanBase Database deployment requirements .
[[email protected] ~]# cat /etc/centos-release
[[email protected] ~]# uname -a
[[email protected] ~]# free -h
[[email protected] ~]# df -h
[[email protected] ~]# ifconfig
2、 To configure ssh Password free login
linux The server ssh See blog for password free login configuration Linux And SSH Password free login configuration .
3、 To configure ntp Clock source
Linux Server configuration ntp Clock source can refer to blog Linux And NTP Server and client installation and configuration .
[[email protected] ~]# ntpq -4p
remote refid st t when poll reach delay offset jitter
==============================================================================
*119.28.206.193 100.122.36.196 2 u 1 64 1 45.157 -8.968 0.559
ntp6.flashdance 194.58.203.20 2 u 2 64 1 308.171 -5.071 6.429
ntp5.flashdance .INIT. 16 u - 64 0 0.000 0.000 0.000
139.199.214.202 100.122.36.196 2 u 2 64 1 18.823 -2.983 0.222
[[email protected] ~]# ntpstat
synchronised to NTP server (139.199.214.202) at stratum 3
time correct to within 228 ms
polling server every 64 s
4、 To configure limits.conf
OceanBase The limitations involved in the database process include the maximum stack space of threads (Stack)、 Maximum number of file handles (Open Files) and core file size (Core File Size). Set the maximum stack space size at the session level to unlimited, The maximum number of file handles is set to 655350,Core The file size is set to unlimited.
[[email protected] ~]# vim /etc/security/limits.conf
Add the following and save
root soft nofile 655350
root hard nofile 655350
* soft nofile 655350
* hard nofile 655350
* soft stack 20480
* hard stack 20480
* soft nproc 655360
* hard nproc 655360
* soft core unlimited
* hard core unlimited
# After modification, reconnect to view , To take effect
[[email protected] ~]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 31190
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 655350
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 20480
cpu time (seconds, -t) unlimited
max user processes (-u) 655360
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
5、 To configure sysctl.conf
To guarantee OceanBase The database is working properly , In the installation OceanBase Before the database , You need to modify all machines sysctl.conf To configure , In order to improve the Linux System performance . If you are an individual user , You can skip this step . If you are an enterprise user , You must configure sysctl.conf.
[[email protected] ~]# vim /etc/sysctl.conf
# Add the following and save
# for oceanbase
## Modify kernel asynchrony I/O Limit
fs.aio-max-nr=1048576
# After the modification, use the following command to make the configuration effective
[[email protected] etc]# sysctl -p
fs.aio-max-nr = 1048576
6、 Close the firewall and SELinux
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[[email protected] ~]# setenforce 0
[[email protected] ~]# sed -i ‘s/=enforcing/=disabled/g’ /etc/selinux/config
7、 Create installation users
[[email protected] ~]# useradd wuhs
# to wuhs Users add sudo to grant authorization
[[email protected] ~]# sed -i ‘108a %wuhs ALL=(ALL) ALL’ /etc/sudoers
8、 Disk planning
OceanBase The server of the database depends on the data disk 、 Transaction log disk and OceanBase Database installation disk .
[[email protected] ~]# mkdir /data
[[email protected] ~]# mkdir /redo
[[email protected] ~]# chown -R wuhs.wuhs /data
[[email protected] ~]# chown -R wuhs.wuhs /redo
9、 Close the transparent large page manually
[[email protected] ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[[email protected] ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
Four 、 Installation steps
1、 Download and install OBD
[[email protected] ~]$ sudo yum install -y yum-utils
…
Installed:
yum-utils.noarch 0:1.1.31-54.el7_8
…
Complete!
[[email protected] ~]$ sudo 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
[[email protected] ~]$ ll /etc/yum.repos.d/
total 36
-rw-r–r–. 1 root root 1664 Nov 23 2018 CentOS-Base.repo
…
-rw-r–r–. 1 root root 512 May 14 2021 OceanBase.repo
[[email protected] ~]$ sudo yum install -y ob-deploy
…
2、 install OBClient
[[email protected] ~]$ sudo yum install -y obclient
…
Installed:
obclient.x86_64 0:2.0.1-2.el7
…
Complete!
3、 Download the local installation configuration file
Visit the official website mini-local-example.yaml Download the local installation configuration file to the server , Copy can be used .
[[email protected] ~]$ vim mini-local.yaml
# The official website min-local-example.yaml Copy the contents of the example to mini-local.yaml In file
4、 Modify... In the configuration file devname Variables and home_path
[[email protected] ~]$ mkdir oceanbase
5、 Use obd Command deployment
Run the following command to deploy the cluster , among , Parameters deploy_name Name the deployment cluster , It can be understood as the alias of the configuration file . This command checks home_path and data_dir Whether the directory pointed to is empty . If the directory is not empty , False report . You can add -f Options , Force clear . After you execute obd cluster deploy After the command ,OBD Will check if your target machine has OceanBase Database installation package . If there is no installation package ,OBD Will automatically from yum Source acquisition . If your machine cannot access the public network , You can learn from OceanBase Download the installation package on the official website .
obd cluster deploy <deploy_name> -c <deploy_config_path>
# Example
[[email protected] ~]$ obd cluster deploy obtest -c mini-local.yaml
# In the figure warning Because it is not installed obclient, No such after installation warning.
6、 start-up OceanBase database
Run the following command to start the cluster , This command will check the system parameters fs.aio-max-nr Is it not less than 1048576. Usually, a machine starts a node without modification fs.aio-max-nr. But when a machine needs to start 4 When there are more than nodes , Please be sure to revise fs.aio-max-nr.
Start command :obd cluster display <deploy_name>
# Example
[[email protected] ~]$ obd cluster start obtest
Get local repositories and plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
Start observer ok
observer program health check ok
Connect to observer ok
Wait for observer init ok
±--------------------------------------------+
| observer |
±----------±--------±-----±------±-------+
| ip | version | port | zone | status |
±----------±--------±-----±------±-------+
| 127.0.0.1 | 3.1.3 | 2881 | zone1 | active |
±----------±--------±-----±------±-------+
obtest running
7、 Check cluster status
[[email protected] ~]$ obd cluster display obtest
Get local repositories and plugins ok
Open ssh connection ok
Cluster status check ok
Connect to observer ok
Wait for observer init ok
±--------------------------------------------+
| observer |
±----------±--------±-----±------±-------+
| ip | version | port | zone | status |
±----------±--------±-----±------±-------+
| 127.0.0.1 | 3.1.3 | 2881 | zone1 | active |
±----------±--------±-----±------±-------+
8、 Connect to database
[[email protected] ~]$ obclient -h127.0.0.1 -P2881 -uroot
Welcome to the OceanBase. Commands end with ; or \g.
Your MySQL connection id is 3221487630
Server version: 5.7.25 OceanBase 3.1.3 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Apr 15 2022 02:16:22)
Copyright 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MySQL [(none)]>
9、 view the database
MySQL [(none)]> show databases;
±-------------------+
| Database |
±-------------------+
| oceanbase |
| information_schema |
| mysql |
| SYS |
| LBACSYS |
| ORAAUDITOR |
| test |
±-------------------+
7 rows in set (0.004 sec)
MySQL [oceanbase]> select version();
±-------------------+
| version() |
±-------------------+
| 3.1.3-OceanBase CE |
±-------------------+
1 row in set (0.001 sec)
10、 View resource consumption
Check the running status of virtual machine , We can know OceanBase Memory used in local installation 7.43G, So the official website requires memory 8G The above is true , It's too low to run . Bloggers have tried 4G Install in memory OceanBase database , An error was reported during installation .
边栏推荐
- Object. defineProperty() - VS - new Proxy()
- Summary of the third class
- Common MySQL interview questions (1) (written MySQL interview questions)
- 20.[STM32]利用超声波模块和舵机实现智能垃圾桶功能
- wxml2canvas
- 复现Thinkphp 2.x 任意代码执行漏洞
- Basic JSON operations of MySQL 5.7
- 六种常用事务解决方案,你方唱罢,我登场(没有最好只有更好)
- Data communication foundation - routing communication between VLANs
- [brief notes] solve the problem of IDE golang code red and error reporting
猜你喜欢
Fundamentals of data communication - Principles of IP routing
Thymeleaf uses background custom tool classes to process text
First PR notes
Ctfshow web entry information collection
CODING DevSecOps 助力金融企业跑出数字加速度
OSI seven layer model
Detailed explanation of QT creator breakpoint debugger
示例项目:简单的六足步行者
lv_ font_ Conv offline conversion
Ten billion massage machine blue ocean, difficult to be a giant
随机推荐
I'm fat, huh
Bugku's Ah Da
CSDN I'm coming
Interval DP (gravel consolidation)
Vulnhub-Moneybox
Fundamentals of data communication - Principles of IP routing
sql server char nchar varchar和nvarchar的区别
把 ”中台“ 的思想迁移到代码中去
Ten billion massage machine blue ocean, difficult to be a giant
Redis distributed lock principle and its implementation with PHP (1)
1330: [example 8.3] minimum steps
Appium自动化测试基础 — APPium基础操作API(一)
Detailed explanation of QT creator breakpoint debugger
Usage and usage instructions of JDBC connection pool
Noi / 1.3 01: a+b problem
wyt 。。
MySQL5.7的JSON基本操作
Huiyuan, 30, is going to have a new owner
The difference between SQL Server char nchar varchar and nvarchar
go学习 ------jwt的相关知识