BCLinux8U6系统部署oceanbase分布式数据库社区版之二、数据库服务器准备

本文是在完成步骤一、准备 OBD 中控机后的第二步,准备3台oceanbase分布式数据库服务器。

前序步骤:BCLinux8U6系统部署oceanbase分布式数据库社区版之一、准备 OBD 中控机

一、服务器配置

1、服务器硬件配置

本例采用vmware虚拟机来构建测试平台,共3台虚拟机,16核CPU、32GB内存,1T数据盘

2、服务器操作系统

采用BCLinux8U6

[root@localhost ~]# cat /etc/os-release 
NAME="BigCloud Enterprise Linux"
VERSION="8.6 (Core)"
ID="bclinux"
ID_LIKE="rhel fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:an8"
PRETTY_NAME="BigCloud Enterprise Linux 8.6 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:bclinux:bclinux:8"
HOME_URL="https://mirrors.bclinux.org/"
BUG_REPORT_URL="https://bugs.bclinux.org/"BCLINUX_BUGZILLA_PRODUCT="BigCloud Enterprise Linux 8 (Core)"
BCLINUX_BUGZILLA_PRODUCT_VERSION=8.6
BCLINUX_SUPPORT_PRODUCT="BigCloud Enterprise Linux 8 (Core)"
BCLINUX_SUPPORT_PRODUCT_VERSION=8.6
3、系统内核,操作系统内核为5.10
[root@localhost ~]# uname -r
5.10.134-12.2.el8.bclinux.x86_64
[root@localhost ~]# free -gtotal        used        free      shared  buff/cache   available
Mem:             31           0          30           0           0          30
Swap:             1           0           1

二、服务器系统环境初始化(每台服务器需完成相同设置)

1、准备数据盘分区
[root@localhost ~]# fdisk -l |grep /dev/sdb
Disk /dev/sdb:1000 GiB,1073741824000 字节,2097152000 个扇区
[root@localhost ~]# fdisk /dev/sdb欢迎使用 fdisk (util-linux 2.32.1)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。设备不包含可识别的分区表。
创建了一个磁盘标识符为 0x9febb181 的新 DOS 磁盘标签。命令(输入 m 获取帮助):n
分区类型p   主分区 (0个主分区,0个扩展分区,4空闲)e   扩展分区 (逻辑分区容器)
选择 (默认 p):p
分区号 (1-4, 默认  1): 
第一个扇区 (2048-2097151999, 默认 2048): 
上个扇区,+sectors 或 +size{K,M,G,T,P} (2048-2097151999, 默认 2097151999): 创建了一个新分区 1,类型为“Linux”,大小为 1000 GiB。命令(输入 m 获取帮助):w
分区表已调整。
将调用 ioctl() 来重新读分区表。
正在同步磁盘。[root@localhost ~]# fdisk -l |grep /dev/sdb
Disk /dev/sdb:1000 GiB,1073741824000 字节,2097152000 个扇区
/dev/sdb1        2048 2097151999 2097149952 1000G 83 Linux
[root@localhost ~]# pvcreate /dev/sdb1Physical volume "/dev/sdb1" successfully created.
[root@localhost ~]# vgcreate appvg /dev/sdb1Volume group "appvg" successfully created
[root@localhost ~]# lvcreate -n applv -l 100%vg /dev/appvgLogical volume "applv" created.
[root@localhost ~]# lvs |grep applvapplv appvg -wi-a----- <1000.00g                                                    
[root@localhost ~]# mkfs.xfs -m bigtime=1 /dev/appvg/applv
meta-data=/dev/appvg/applv       isize=512    agcount=4, agsize=65535744 blks=                       sectsz=512   attr=2, projid32bit=1=                       crc=1        finobt=1, sparse=1, rmapbt=0=                       reflink=1    bigtime=1 inobtcount=0
data     =                       bsize=4096   blocks=262142976, imaxpct=25=                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=127999, version=2=                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@localhost ~]# vi /etc/fstab
[root@localhost ~]# grep applv /etc/fstab
/dev/appvg/applv        /app                    xfs     defaults        0 0
[root@localhost ~]# mkdir /app
[root@localhost ~]# mount -a
[root@localhost ~]# df -hT |grep applv
/dev/mapper/appvg-applv xfs      1000G  7.1G  993G    1% /app
2、检查时间同步

因是分布式环境,时间同步非常重要,否则可能会出现各种意想不到的问题

[root@localhost ~]# chronyc sources -v.-- Source mode  '^' = server, '=' = peer, '#' = local clock./ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| /             'x' = may be in error, '~' = too variable, '?' = unusable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 192.168.2.33                  2   6   377    51  -1808us[ -325us] +/-   27ms
^+ 192.168.2.34                  2   6   377    53  +1443us[+2925us] +/-   42ms
^+ 192.168.2.35                  2   6   377    50    +15ms[  +15ms] +/-   50ms
3、系统限制参数设置
[root@localhost ~]# vi /etc/security/limits.conf 
[root@localhost ~]# egrep -v "^#|^$" /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
4、系统控制参数配置
[root@localhost ~]# vi /etc/sysctl.conf
[root@localhost ~]# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1# 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 = 16777216net.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=0vm.swappiness = 0
vm.min_free_kbytes = 2097152
fs.file-max = 6573688# 修改进程可以拥有的虚拟内存区域数量
vm.max_map_count = 655360# 此处为 OceanBase 数据库的 data 目录
kernel.core_pattern = /app/core-%e-%p-%t
[root@localhost ~]# sysctl -p
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
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
sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: 没有那个文件或目录
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
kernel.core_pattern = /app/core-%e-%p-%t
[root@localhost ~]#
5、停用selinux服务
[root@localhost ~]# getenforce
Disabled
[root@localhost ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
6、创建admin管理用户并初始化密码
[root@localhost ~]# useradd -U admin -d /home/admin -s /bin/bash -m
[root@localhost ~]# ll /home
总用量 8
drwx------. 2 AAAA  AAAA  4096 4月  10 09:40 AAAA
drwx------  2 admin admin 4096 4月  15 16:08 admin
[root@localhost ~]# ll /home |grep admin
drwx------  2 admin admin 4096 4月  15 16:08 admin
[root@localhost ~]# passwd admin
更改用户 admin 的密码 。
新的 密码:
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
7、admin用户sudo免密设置及加入wheel组

配置admin用户的sudo免密设置,为避免其它安全策略影响,建议加到/etc/sudoers文件的最后面;同时将admin用户加入wheel组。

[root@localhost ~]# vim /etc/sudoers
[root@localhost ~]# grep ^admin /etc/sudoers
admin   ALL=(ALL)       NOPASSWD:ALL
[root@localhost ~]# vi /etc/group
[root@localhost ~]# grep wheel /etc/group
wheel:x:10:admin
8、准备数据库的数据目录和日志目录,有条件的话,可以按部署建议进行分盘部署
[root@localhost ~]# mkdir -p /app/oceanbase/data /app/oceanbase/redo
[root@localhost ~]# chown -R admin:admin /app
[root@localhost ~]# tree /app          
/app
└── oceanbase├── data└── redo3 directories, 0 files
[root@localhost ~]# 

三、中控机ssh免密操作

以下皆在中控机上操作

1、生成admin用户的公钥文件
[root@localhost ~]# su - admin
上一次登录:一 4月 15 16:45:26 CST 2024pts/1 上
[admin@localhost ~]$ ls ~/.ssh/id_rsa.pub
ls: 无法访问'/home/admin/.ssh/id_rsa.pub': 没有那个文件或目录
[admin@localhost ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/admin/.ssh/id_rsa): 
Created directory '/home/admin/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/admin/.ssh/id_rsa
Your public key has been saved in /home/admin/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:dioymcUobYwt9nUpt5OWuqhCiS+KQ7sVpzUIKHhBEuQ admin@localhost.localdomain
The key's randomart image is:
+---[RSA 3072]----+
|++o              |
|+. .             |
|+E.              |
|...=.o   .       |
|. *o*+= S .      |
|.= ===.= *       |
|o..o* . B        |
|=.o  + + .       |
|+=o.. o.         |
+----[SHA256]-----+
2、分发公钥文件到各数据库服务器
[admin@localhost ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub -p4422 admin@192.168.2.161 
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/admin/.ssh/id_rsa.pub"
The authenticity of host '[192.168.2.161]:4422 ([192.168.2.161]:4422)' can't be established.
ED25519 key fingerprint is SHA256:wySYs++V/r0GwbmVUSZpvBNFej8nrE2ptlPWLPzyVEk.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Authorized users only. All activities may be monitored and reported.
admin@192.168.2.161's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh -p 4422 'admin@192.168.2.161'"
and check to make sure that only the key(s) you wanted were added.[admin@localhost ~]$
3、免密登录各数据库服务器测试
[admin@localhost ~]$ ssh -p 4422 'admin@192.168.2.161'
Authorized users only. All activities may be monitored and reported.
Authorized users only. All activities may be monitored and reported.
[admin@localhost ~]$ sudo su____  _        ____ _                 _
| __ )(_) __ _ / ___| | ___  _   _  __| |
|  _ \| |/ _` | |   | |/ _ \| | | |/ _` |
| |_) | | (_| | |___| | (_) | |_| | (_| |
|____/|_|\__, |\____|_|\___/ \__,_|\__,_||___/_____       _                       _            _     _
| ____|_ __ | |_ ___ _ __ _ __  _ __(_)___  ___  | |   (_)_ __  _   ___  __
|  _| | '_ \| __/ _ \ '__| '_ \| '__| / __|/ _ \ | |   | | '_ \| | | \ \/ /
| |___| | | | ||  __/ |  | |_) | |  | \__ \  __/ | |___| | | | | |_| |>  <
|_____|_| |_|\__\___|_|  | .__/|_|  |_|___/\___| |_____|_|_| |_|\__,_/_/\_\|_|___( _ )/ _ \
| (_) |\___/Welcome to BigCloud Enterprise Linux 8 (GNU/Linux 5.10.134-12.2.el8.bclinux.x86_64 x86_64)System information as of 2024年 04月 15日 星期一 16:55:05 CST* System CPU load:    0.00 0.00 0.00        * System   uptime:         16:55:05 up  1:18  * Active sessions:    2                     * Memory    usage:         32185 / 32819 MB* Processes count:    306* Contact US   :MAIL : support@bclinux.org / TEL : 4001-10086-5[root@localhost admin]# exit
exit
[admin@localhost ~]$ exit
注销
Connection to 192.168.2.161 closed.
[admin@localhost ~]$ 

至此,完成各台数据库服务器的环境准备及中控机免密ssh配置。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/819990.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Python高质量函数编写指南

The Ultimate Guide to Writing Functions 1.视频 https://www.youtube.com/watch?vyatgY4NpZXE 2.代码 https://github.com/ArjanCodes/2022-funcguide Python高质量函数编写指南 1. 一次做好一件事 from dataclasses import dataclass from datetime import datetimedatacl…

latex论文写作学习

首先无论是什么文章&#xff0c;最基础的格式都是这个&#xff1a; 如何修改字体呢&#xff1f;&#xff1a; 这样一来就可以在写完之后统一改掉了&#xff0c;用来做标记 最后记得\par 插图&#xff1a; 命令后面的中括号一般就是option

uniapp微信小程序分包

一、创建分包文件夹subPack 二、将页面文件放入分包文件夹中 启动页面和导航tabBar页面不要放入分包文件夹中 三、配置pages.json 四、效果

腾讯EdgeOne产品测评体验—腾讯云Edgeone为我的网站保驾护航

前言 众所周知&#xff0c;网站如果没有安全防护&#xff0c;极易遭受恶意攻击&#xff0c;导致运行受阻甚至瘫痪。为保障网站的安全稳定运行&#xff0c;必须采取诸如CDN加速与DDoS防护等措施&#xff0c;为用户提供安全、可靠的服务。 本文将基于腾讯云边缘安全加速平台&am…

CGKRK-PEG-DSPE 细胞穿透肽CGKRK修饰脂质体纳米粒

CGKRK-PEG-DSPE 细胞穿透肽CGKRK修饰脂质体纳米粒 【中文名称】细胞穿透肽CGKRK-聚乙二醇-磷脂 【英文名称】DSPE-PEG-CGKRK 【结 构】 【品 牌】碳水科技&#xff08;Tanshtech&#xff09; 【纯 度】95%以上 【保 存】-20 【规 格】50mg,100mg,500mg,1g …

RocketMQ 09 SpringBoot 整合

RocketMQ 09 SpringBoot 整合 目前还没有官方的starter pom.xml <dependency><groupId>org.apache.rocketmq</groupId><artifactId>rocketmq-common</artifactId><version>4.6.1</version></dependency><!-- https://mvn…

小红书2020校招算法笔试题卷一 编程题no.2 笔记精选

题目 薯队长写了n篇笔记&#xff0c;编号从1~n,每篇笔记都获得了不少点赞数。 薯队长想从中选出一些笔记&#xff0c;作一个精选集合。挑选的时候有两个规则&#xff1a; 1.不能出现连续编号的笔记。 2.总点赞总数最多 如果满足1&#xff0c;2条件有多种方案&#xff0c;…

视频怎么用二维码来分享?手机扫码看视频更方便

怎么把制作的视频快速以二维码的形式分享给其他人呢&#xff1f;视频是很多内容重要的一种展示方式&#xff0c;为了能够让其他人更加方便的查看视频内容&#xff0c;现在很多人会选择视频转二维码的方式来提供预览。将视频存储到云端然后通过扫码来调取&#xff0c;不仅减少了…

DHCP小实验

实验要求&#xff1a; 看拓扑有两个网段则我们首先需要对200.1.1.0/26进行子网划分&#xff0c;划分为两个子网&#xff0c;为200.1.1.0/27和200.1.1.32/27 我门就可以一边一个网段了&#xff0c;左边为200.1.1.0/27&#xff0c;右边为200.1.1.32/27 1、配置PC1&#xff0c;2…

2024蓝桥杯——宝石问题

先展示题目 声明 以下代码仅是我的个人看法&#xff0c;在自己考试过程中的优化版&#xff0c;本人考试就踩了很多坑&#xff0c;我会—一列举出来。代码可能很多&#xff0c;但是总体时间复杂度不高只有0(N) 函数里面的动态数组我没有写开辟判断和free&#xff0c;这里我忽略…

LinuxShell编程中source和export命令

目录 1.source命令1.1.POSIX模式1.1.1.验证POSIX模式执行情况 1.2.source命令表示形式的历史由来1.3.source命令解读1.3.1.在当前的shell环境中1.3.2.source命令的常用用途1.3.3.从文件名中读取并执行命令 2.export命令2.1.显示当前终端已经导出的函数和环境变量2.2.验证变量和…

Python异常处理机制详解及示例

Python异常处理机制详解及示例 在编程过程中&#xff0c;异常处理是一项至关重要的技能。Python作为一种功能强大的编程语言&#xff0c;提供了一套完善的异常处理机制&#xff0c;使得程序在遇到错误或异常情况时能够优雅地处理&#xff0c;而不是直接崩溃。本文将详细介绍Py…

MySQL——基础

SQL 全称 Structured Query Language&#xff0c;结构化查询语言。操作关系型数据库的编程语言&#xff0c;定义了一套操作关系型数据库统一标准 。 SQL 通用语法 SQL语句可以单行或多行书写&#xff0c;以分号结尾。SQL语句可以使用空格/缩进来增强语句的可读性。MySQL数据库…

一文速览铁威马TOS 6全新“文件管理”

TOS 6 Beta已经上线一段时间了&#xff0c;各位铁粉用着怎么样呢&#xff1f;今天就和大家分享&#xff0c;TOS 6全新文件管理。 为了向用户提供更流畅、更便捷的文件管理体验&#xff0c;铁威马的研发团队积极借鉴了Windows OS和Mac OS在文件管理方面的优点&#xff0c;投入巨…

【LeetCode刷题记录】41.缺失的第一个正数

41 缺失的第一个正数 给你一个未排序的整数数组 nums &#xff0c;请你找出其中没有出现的最小的正整数。 请你实现时间复杂度为 O(n) 并且只使用常数级别额外空间的解决方案。 示例 1&#xff1a; 输入&#xff1a;nums [1,2,0] 输出&#xff1a;3 解释&#xff1a;范围 [1…

设置coredump存储路径

设置coredump存储路径需要配置/proc/sys/kernel/core_pattern中的路径&#xff0c;一般情况下如下操作&#xff1a; echo /home/core-%e-%p >/proc/sys/kernel/core_pattern 但是这种方法在有的系统中会设置失败。例如ubuntu中。 因为ubuntu中默认开启了系统错误诊断&#x…

Redis实现持久化和集群的搭建

一、Redis的持久化方案 1&#xff09;RDB持久化 RDB&#xff08;Redis Database Backup file&#xff09;&#xff0c;Redsi数据备份文件或Redis数据快照。 把内存中的所有快照文件称为RDB文件&#xff0c;默认是保存在当前运行目录。 RDB持久化在四种情况下会执行&#xff…

[gvim] 操作

1. 删除操作 behaviorcode删除高亮内容:%s//g删除高亮内容所在行:g//d只删除匹配内容:%s/<pattern>//删除匹配内容所在的行:g/<pattern>/d只保留匹配内容的行:v/<pattern>/d 2. 替换操作 behaviorcode全局替换:%s/src_word/tgt_word/g替换n-m行关键字:n,m…

【echarts】echarts入门教程,学会如何编写echarts代码

echarts模板 使用&#xff01;为html来创建一个模板。 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><titl…

Open3D (C++) 点云投影至主成分空间

目录 一、算法原理二、代码实现三、结果展示四、相关连接Open3D (C++) 点云投影至主成分空间由CSDN点云侠原创,爬虫自重。如果你不是在点云侠的博客中看到该文章,那么此处便是不要脸的爬虫。 一、算法原理 p r o j