oceanbase V4.2.2社区版集群离线部署

oceanbase V4.2.2社区版

集群离线部署

通过 OBD 白屏部署 OceanBase 集群

https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000510452

本文以 x86 架构的 CentOS Linux 7.6 镜像作为环境介绍如何使用 OBD 白屏部署 OceanBase 数据库。

环境:

序号

IP地址

主机名

系统配置

系统版本

软件版本

1

192.192.103.125

obs1

4c、16G、300G+200G

Centos7.6

2

192.192.103.126

obs2

4c、16G、300G+200G

Centos7.6

3

192.192.103.127

obs3

4c、16G、300G+200G

Centos7.6

4

192.192.103.128

ocp

4c、20G、300G+200G

Centos7.6

ocp-all-in-one-4.2.2-20240315150922.el7.x86_64.tar.gz、obclient-2.2.3-1.el7.x86_64.rpm

Obclient需要访问数据库的节点自行安装,默认不安装。

一、服务器配置

1.1 配置参数(所有节点设置,设置完需要重启系统)

1/etc/security/limits.conf

root soft nofile 655350

root hard nofile 655350

* soft nofile 655350

* hard nofile 655350

* soft stack unlimited

* hard stack unlimited

* soft nproc 655360

* hard nproc 655360

* soft core unlimited

* hard core unlimited

2)nofile.conf

#echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf

3)/etc/security/limits.d/20-nproc.conf 

#limits.conf文件修改后不生效需要修改此文件,否则OCP安装预检失败!

*     soft    nproc    655360

4)/etc/sysctl.conf

#for oceanbase

#修改内核异步 I/O 限制

fs.aio-max-nr=1048576

#网络优化

net.core.somaxconn = 2048

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 = 3500 65535

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route = 0

net.ipv4.tcp_syncookies = 1

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_max_syn_backlog = 16384

net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_slow_start_after_idle=0

vm.swappiness = 0

vm.min_free_kbytes = 2097152

fs.file-max = 6573688

#修改进程可以拥有的虚拟内存区域数量

vm.max_map_count = 655360

#此处为 OceanBase 数据库的 data 目录

#kernel.core_pattern = /data/core-%e-%p-%t

1.2 配置NTP

1.2.1 OCP server

配置NTP server

  1. 安装ntp

#yum install –y ntp

2)修改ntp配置文件

#vi /etc/ntp.conf

添加以下参数

# Hosts on local network are less restricted.

restrict 192.192.0.0 mask 255.255.255.0 nomodify notrap

#server

server 127.127.1.0

fudge 127.127.1.0  stratum 10

注释掉server0、1、2、3行,如下

#server 0.centos.pool.ntp.org iburst

#server 1.centos.pool.ntp.org iburst

#server 2.centos.pool.ntp.org iburst

#server 3.centos.pool.ntp.org iburst

3)启动ntp server

#systemctl start ntpd

#systemctl enable ntpd

4)查看ntp服务状态

#ntpq –p

remote         refid      st t when poll reach   delay   offset  jitter

==================================================

*LOCAL(0)      .LOCL.     10 l   11   64    1    0.000    0.000   0.000

[root@ocp ocp]# ntpstat

synchronised to local net at stratum 11

   time correct to within 3948 ms

   polling server every 64 s

1.2.2 OCP Client(obs1、obs2、obs3)
  1. 安装ntp

#yum install –y ntp

  1. 修改ntp.conf配置文件

#vi /etc/ntp.conf,添加下面行

server 192.192.103.128 prefer

注释掉server0、1、2、3行,如下

#server 0.centos.pool.ntp.org iburst

#server 1.centos.pool.ntp.org iburst

#server 2.centos.pool.ntp.org iburst

#server 3.centos.pool.ntp.org iburst

  1. 手动同步时间

#时间同步很重要!!

[root@obs1 ~]# ntpdate 192.192.103.128

 1 Apr 15:06:17 ntpdate[16268]: step time server 192.192.103.128 offset 0.612050 sec

[root@obs2 ~]# ntpdate 192.192.103.128

 1 Apr 15:06:17 ntpdate[16268]: step time server 192.192.103.128 offset 0.612050 sec

[root@obs3 ~]# ntpdate 192.192.103.128

 1 Apr 15:06:17 ntpdate[16268]: step time server 192.192.103.128 offset 0.612050 sec

二、OCP安装配置

https://www.oceanbase.com/docs/common-ocp-1000000000585169

2.1 安装规划

当您选择使用图形化界面部署社区版 OCP 时,部署的用户需具有免密 sudo 权限。

2.1.1 创建用户

useradd -U admin -d /home/admin -s /bin/bash

mkdir -p /home/admin

sudo chown -R admin:admin /home/admin

2.1.2 为用户 admin 设置密码

passwd admin

2.1.3 为用户 admin 设置 sudo 权限

执行以下命令,打开 /etc/sudoers 文件。在 /etc/sudoers 文件末尾添加以下内容:

Same thing without a password

%wheel        ALL=(ALL)       NOPASSWD: ALL

admin       ALL=(ALL)       NOPASSWD: ALL

2.1.4 创建目录

mkdir -p /ocp

mkdir –p /data

2.1.5 目录赋权

chown -R admin:admin /ocp

chown -R admin:admin /data

chmod –R 775 /ocp

chmod –R 775 /data

#/ocp为ocp安装目录,/data为数据目录

2.1.6 端口规划

模块

部署单元

监听端口

协议类型

监听端口修改方式

备注

MetaDB & MonitorDB

OceanBase 数据库

2881

tcp

不支持修改

OBServer 节点 SQL 监听端口。

MetaDB & MonitorDB

OceanBase 数据库

2882

tcp

不支持修改

远程访问端口。

OCP

OCP-Server

8080

http

修改 OCP 系统参数 server.port ,重启生效。

OCP-Server web 服务监听端口,通常其它组件通过 SLB/DNS 地址访问 OCP-Server。

2.2 安装准备

下载软件:

ocp-all-in-one-4.2.2-20240315150922.el7.x86_64.tar.gz

下载地址:https://www.oceanbase.com/softwarecenter?_gl=1*cdn9mj*_ga*MTI4OTkzNzMzMy4xNzExMDc2ODA4*_ga_T35KTM57DZ*MTcxMjAzMjcxMS4yNi4xLjE3MTIwNDIzNTUuNjAuMC4w

2.3 使用图形安装OCP

本节介绍如何通过 OceanBase 安装部署工具(OceanBase Deployer,OBD)白屏化部署 OCP。

MetaDB 是 OCP 的重要组成部分,MetaDB 为 OCP 管理元信息及监控数据提供底层存储能力,OCP-Server 通过调用 MetaDB 数据为您提供 OceanBase 数据库全生命周期管理服务。您可选择以下任意一种 MetaDB 的配置方式来部署 OCP:

  • (推荐)创建全新的
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

king_harry

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值