oceanbase 社区版安装
# 一、环境准备
|节点类别|主机名|IP|
|-|-|-|
|OBSERVER|observer1|192.168.3.41|
|OBSERVER|observer2|192.168.3.42|
|OBSERVER|observer3|192.168.3.43|
|ocp |ocpserver|192.168.3.47|
|中控机 |obcontrol|192.168.3.48|
# 二、名词解析
中控机:存储Oceanbase数据库安装包和集群配置信息的机器
目标机器:安装OceanBase数据库的机器
OBD:Oceanbase Deployer,Oceanbase 开源软件的安装部署工具,简称OBD
OBProxy:Oceanbase Database Proxy, OceanBase高性能反向代理服务器,简称OBProxy
OCP: OceanBase cloud Platform OceanBase运维管理工具,简称OCP
# 三、主机安装步骤
## 3.1 配置hosts文件和磁盘的规划
```
echo "192.168.3.41 observer1"> /etc/hosts
echo "192.168.3.42 observer2">> /etc/hosts
echo "192.168.3.43 observer3">> /etc/hosts
echo "192.168.3.47 ocpserver">> /etc/hosts
echo "192.168.3.48 obcontrol">> /etc/hosts
cat /etc/hosts
pvcreate /dev/sdb /dev/sdc
vgcreate redovg /dev/sdb
vgcreate datavg /dev/sdc
lvcreate -n datalv -L 200000M datavg
lvcreate -n adminlv -L 100000M datavg
lvcreate -n redolv -L 100000M redovg
mkfs.xfs /dev/datavg/datalv
mkfs.xfs /dev/datavg/adminlv
mkfs.xfs /dev/redovg/redolv
cat >> /etc/fstab << EOF
/dev/datavg/datalv /data xfs defaults 0 0
/dev/datavg/adminlv /home/admin xfs defaults 0 0
/dev/redovg/redolv /redo xfs defaults 0 0
EOF
cat /etc/fstab
```
## 3.2 创建目录和admin用户
```
mkdir -p /data/soft
mkdir /redo
mkdir /home/admin
mount /data
mount /home/admin
mount /redo
rm -fr /var/spool/mail/admin
userdel -r admin
groupadd -g 66000 admin
useradd -u 66000 -g admin -m -d /home/admin -s /bin/bash admin
cp /etc/skel/.bash* /home/admin/
echo "admin" | passwd --stdin admin
chown -R admin:admin /data
chown -R admin:admin /redo
chown -R admin:admin /home/admin
```
## 3.3 配置 sudoers文件和 字符集
```
cat >> /etc/sudoers << EOF
Admin ALL=(ALL) NOPASSWD: ALL
EOF
测试:
su - admin
sudo -su root
exit
exit;
echo "export LANG=en_US.UTF8" >> ~/.bash_profile
cat ~/.bash_profile
echo "export LANG=en_US.UTF8" >> /home/admin/.bash_profile
systemctl set-default multi-user.target
```
## 3.4 配置yum
```
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
cd /etc/yum.repos.d
mkdir bk
mv -f *.repo bk/
vi /etc/yum.repos.d/oracle.repo
[Server]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=file:///media/cdrom
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum install -y expect mariadb mariadb-devel python-devel openssl-devel gcc gcc-gfortran gcc-c++ python-setuptools bc et-tools mtr chrony bind-utils libaio tree
```
## 3.5 配置limits.conf和sysctl.conf
```
cat >> /etc/security/limits.conf << EOF
* soft nofile 655360
* hard nofile 655360
* soft nproc 655360
* hard nproc 655360
* hard core unlimited
* soft core unlimited
* hard stack 10240
* soft stack 10240
* hard cpu unlimited
* soft cpu unlimited
EOF
cat >> /etc/sysctl.conf << EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
vm.swappiness=1
vm.max_map_count=655360
kernel.pid_max=819200
#vm.nr_hugepages = 0
kernel.core_pattern=/data/1/core-%e-%p-%t
vm.min_free_kbytes=204800
net.core.somaxconn=32768
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=10000 65535
net.ipv4.ip_forward=1
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.default.accept_source_route=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_tw_reuse=1
net.ipv4.tcp_slow_start_after_idle=0
EOF
sysctl -p
```
## 3.6 配置时间服务
```
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock
echo "SELINUX=disabled" > /etc/selinux/config
echo "#SELINUXTYPE=targeted " >> /etc/selinux/config
cat /etc/selinux/config
setenforce 0
systemctl stop firewalld.service
systemctl disable firewalld.service
cat >> /home/admin/.vimrc << EOF
map <F10>:set paste<CR>
map <F11>:set nopaste<CR>
EOF
cat /sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never
cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
cat >> /etc/rc.d/rc.local << EOF
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
EOF
chmod +x /etc/rc.d/rc.local
/etc/rc.d/rc.local
# vim set_deadline.sh
for DISK in `ls /sys/block | grep "sd\?"` ; do echo deadline > /sys/block/$DISK/queue/scheduler ; done
yum -y install chrony
192.168.3.48:
/etc/chrony.conf
cp /etc/chrony.conf /etc/chrony.conf.bak
cat >> /etc/chrony.conf << EOF
server 127.127.1.0
allow 192.168.3.0/24
local stratum 10
EOF
systemctl start chronyd
systemctl enable chronyd
其他主机
cp /etc/chrony.conf /etc/chrony.conf.bak
cat >> /etc/chrony.conf << EOF
server 192.168.3.48
allow 192.168.3.0/24
local stratum 10
EOF
systemctl start chronyd
systemctl enable chronyd
timedatectl set-timezone Asia/Shanghai
chronyc -a makestep
chronyc sources -v
date
```
## 3.7 配置ssh
```
cd ssh
chmod u+x ssh
./ssh -user admin -hosts "observer1 observer2 observer3 observer4 observer5 observer6 ocpserver obcontrol " -advanced -exverify -confirm
chmod 600 /home/admin/.ssh/config
su - admin
ssh observer1 date
ssh observer2 date
ssh observer3 date
ssh observer4 date
ssh observer5 date
ssh observer6 date
ssh ocpserver date
ssh obcontrol date
```
# 四、 安装oceanbase
## 4.1 下载ob的软件 和上传软件
## 4.2 删除阿里云*.repo
```
cd /data
chown -R admin:admin soft
su - admin
cd /data/soft/
sudo rpm -ivh ob-deploy-1.2.1-9.el7.x86_64.rpm
source /etc/profile.d/obd.sh
rpm -ql `rpm -qa|grep ob-deploy`
obd mirror list
/bin/rm -rf ~/.obd/mirror/remote/*.repo
obd mirror clone /data/soft/*.rpm
obd mirror list local
```
## 4.3 配置 dbobce-3zones.yaml
```
cd /data
vi dbobce-3zones.yaml
:set paste
# Only need to configure when remote login is required
user:
username: admin
password: admin
oceanbase-ce:
servers:
- name: observer1
# Please don't use hostname, only IP can be supported
ip: 192.168.3.41
- name: observer2
ip: 192.168.3.42
- name: observer3
ip: 192.168.3.43
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"
devname: enp0s3
cluster_id: 2
# please set memory limit to a suitable value which is matching resource.
memory_limit: 8G # The maximum running memory for an observer
system_memory: 3G # 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
major_freeze_duty_time: Disable
minor_freeze_times: 10
enable_separate_sys_clog: 0
enable_merge_by_turn: FALSE
#datafile_disk_percentage: 3 # 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.
datafile_size: 10G
syslog_level: WARN # 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: 10 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.
# observer cluster name, consistent with obproxy's cluster_name
appname: eduobce
root_password: 123123 # root user password, can be empty
proxyro_password: rootroot # proxyro user pasword, consistent with obproxy's observer_sys_password, can be empty
observer1:
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/oceanbase-ce
# 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
zone: zone1
observer2:
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/oceanbase-ce
# 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
zone: zone2
observer3:
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/oceanbase-ce
# 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
zone: zone3
obproxy:
servers:
- 192.168.3.41
- 192.168.3.42
- 192.168.3.43
# Set dependent components for the component.
# When the associated configurations are not done, OBD will automatically get the these configurations from the dependent components.
depends:
- oceanbase-ce
global:
listen_port: 2883 # External port. The default value is 2883.
prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884.
home_path: /home/admin/obproxy
# oceanbase root server list
# format: ip:mysql_port;ip:mysql_port
rs_list: 192.168.3.41:2881;192.168.3.42:2881;192.168.3.43:2881
enable_cluster_checkout: false
# observer cluster name, consistent with oceanbase-ce's appname
cluster_name: eduobce
obproxy_sys_password: rootroot # obproxy sys user password, can be empty
observer_sys_password: rootroot # proxyro user pasword, consistent with oceanbase-ce's proxyro_password, can be empty
```
## 4.4安装eduobce
```
su - admin
obd cluster deploy eduobce -c dbobce-3zones.yaml
obd cluster list
obd cluster start eduobce
```
## 4.5 安装客户端
```
sudo rpm -ivh libobclient-2.0.0-2.el7.x86_64.rpm obclient-2.0.0-2.el7.x86_64.rpm
IPS="192.168.3.41 192.168.3.42 192.168.3.43"
for ob in $IPS;do echo $ob; ssh $ob "netstat -ntlp" ; done
```
## 4.6 查看集群状态
```
[admin@obcontrol ~]$ obd cluster display eduobce
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 |
+--------------+---------+------+-------+--------+
| 192.168.3.41 | 3.1.2 | 2881 | zone1 | active |
| 192.168.3.42 | 3.1.2 | 2881 | zone2 | active |
| 192.168.3.43 | 3.1.2 | 2881 | zone3 | active |
+--------------+---------+------+-------+--------+
Connect to obproxy ok
+------------------------------------------------+
| obproxy |
+--------------+------+-----------------+--------+
| ip | port | prometheus_port | status |
+--------------+------+-----------------+--------+
| 192.168.3.41 | 2883 | 2884 | active |
| 192.168.3.42 | 2883 | 2884 | active |
| 192.168.3.43 | 2883 | 2884 | active |
+--------------+------+-----------------+--------+
[admin@obcontrol ~]$
```
oceanbase 社区版安装的更多相关文章
- 【Git】 GitLab服务器社区版安装与配置
GitLab简介 GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务 GitLab系统架构 当~git在图片中引用时,它表示git用户的主目录 ...
- MYSQL社区版安装手册
https://www.jb51.net/article/140412.htm 在本教程中使用MySQL最新的MySQL服务8.0.11的社区绿色版本进行安装,绿色版为zip格式的包,安装分为以下四步 ...
- OpenAcc社区版安装教程(Linux版)(更新版)
官方安装过程如下图所示 1.安装前 下载OpenAcc社区版 1,目前为止的最新版,平台是Linux,选择Linux x86-64. 我的服务器系统是CentOs 下载地址链接:https://www ...
- MySQL 社区版 安装小记
根据刘铁猛老师的教程,自己折腾一下 1. 安装包准备 在Windows10 64bit上安装,故需要准备vc++ 2013和2015的Redistributable的包,搜索即有,无需细说. 示例数据 ...
- UOJ社区版安装多个Judger
目录 声明 在同一台机器上安装 在不同机子上安装 声明 本文档非官方文档,为我试坑的经验总结. 本文编写时间 2019.11.04 ,并不一定会随UOJ更新而更新. 由于UOJ需要用SVN传题,并不那 ...
- pycharm社区版安装及遇到的问题
1. 在官网上下载pycharm社区版安装包. 2. 按照该教程进行安装: https://jingyan.baidu.com/article/f00622286e92f4fbd2f0c855.htm ...
- 002.MongoDB社区版安装
一 前期准备 1.1 相关软件包介绍 包裹名字 描述 mongodb-org 一个将自动安装以下四个组件包的组合包. mongodb-org-server 包含mongod守护程序,关联的init脚本 ...
- Gitlab 社区版安装部署和维护指南
因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gitlab 升级到了 ...
- win10 Ubuntu子系统安装&odoo10社区版安装
参考文档: http://www.cnblogs.com/odoouse/p/5995603.html https://www.jianshu.com/p/58090215bda8 一.win10 U ...
- Ubuntu 16.04 (官方命令行)安装MongoDB 3.6.2(社区版)
概述 使用本教程从 .deb 包在LTS Ubuntu Linux系统上安装MongoDB Community Edition. 虽然Ubuntu包含自己的MongoDB包,但官方的MongoDB社区 ...
随机推荐
- 【C学习笔记】day4-2 求出0~999之间的所有“水仙花数”并输出。
2.求出0-999之间的所有"水仙花数"并输出."水仙花数"是指一个三位数,其各位数字的立方和确好等于该数本身,如:153=1+5+3?,则153是一个&quo ...
- 看图王 10.9.1.9791 With X64 去广告绿色版
修改历史:2022.12.14:自改官方 10.9.1.9791 最新正式版本2022.06.18:首个自改官方 10.9.0.9760 修改内容:美化部分关联图标:基于官方最新版本制作,精简部分非必 ...
- vue2 项目引入Fontawesome
官网: https://fontawesome.com/ 1.安装 `` `powershell npm i --save @fortawesome/fontawesome-svg-core Usin ...
- js网页禁止右键下载代码
<script type="text/javascript"> //禁用右键 document.onkeydown = function() { var e = win ...
- Jmeter使用文档(循环怎么用)
Jmeter使用文档(循环怎么用) 基础用法 修改语言 Jmeter之界面语言设置 下面使用简体中文的命名进行说明 打开日志 启动后,右上角有个黄色的感叹号图标,点击即可打开即时日志 如果没有看到重启 ...
- MAC怎么获取文件路径 MAC获取文件路径的四种方法
MAC怎么获取文件路径介绍 方法一:最简单的方法 右键文件或者文件夹,选择显示简介 2在弹出来的窗口中找到位置,即为路径,在mac 10.10之前的系统是正常的路径,10.10开始是小箭头代替/显示 ...
- 085_JS Promise
js对undefined的处理 https://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000 ...
- 【SSO单点系列】(6):CAS4.0 之中文乱码
CAS登录会将登录名回传给客户端以xml的格式 但是回传后乱码客户端无法正确解析 二.解决方法 ServiceValidateController.java private ModelAndVie ...
- C# 读取串口设备列表
ManagementObjectSearcher 解析不到头文件,需要手动 Add Referance 需要添加引用:System.Management,然后引入命名空间:using System.M ...
- 发生错误:请确认您的电脑是否安装了excel软件,并且您的浏览器是否允许远行excel!具体操作请查阅帮助.
1.要先下载 activeX 这个控件 2.进入internet选项--->安全--->将安全级别调到最低 3,是否下载了excel. 4,关闭window防火墙