基于CentOS系统安装OceanBase数据库

一、OceanBase介绍

OceanBase是由蚂蚁集团完全自主研发的金融级分布式关系数据库,始创于2010年。OceanBase具有数据强一致、高可用、高性能、在线扩展、高度兼容SQL标准和主流关系数据库、低成本等特点。

OceanBase 社区版是一款开源分布式 HTAP(Hybrid Transactional/Analytical Processing)数据库管理系统,具有原生分布式架构,支持金融级高可用、透明水平扩展、分布式事务、多租户和语法兼容等企业级特性。OceanBase 内核通过大规模商用场景的考验,已服务众多行业客户,现面向未来持续构建内核技术竞争力。

二、OceanBase安装操作

本实验基于CentOS 7.9系统进行演示操作

[root@oceanbase ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

安装前期准备

本实验采用单机模式 的部署方式,在同一台机器上安装服务端和客户端进行测试。
需要内存大小8GB 以上;(本实验内存大小 10 GB)
磁盘空间大小65GB以上;(本实验磁盘大小 95 GB)

执行以下三种命令。

yum install -y yum-utils
yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
yum install -y ob-deploy
[root@obd ~]# yum install -y yum-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version
Nothing to do
[root@obd ~]# 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
[root@obd ~]# yum install -y ob-deploy
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package ob-deploy-1.2.1-9.el7.x86_64 already installed and latest version
Nothing to do
[root@obd ~]#
离线安装 OBD
1. 下载 OBD 离线 RPM 安装包。
2. 运行以下命令安装 OBD。
yum install -y ob-deploy-1.0.0-1.el7.x86_64.rpm
source /etc/profile.d/obd.sh

从 Github 上下载对应的配置文件模板。本实验采用的是mini-local-example.yaml 配置文件

Gitee下载链接:

example/mini-local-example.yaml · OceanBase/obdeploy – Gitee.com

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: /xyb/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

运行以下命令部署集群

obd cluster deploy <deploy_name> -c <deploy_config_file> -A
</deploy_config_file></deploy_name>
[root@obs ~]# obd cluster deploy xybobs -c mini-local-example.yaml
Update OceanBase-community-stable-el7 ok
Update OceanBase-development-kit-el7 ok
Download oceanbase-ce-3.1.2-10000392021123010.el7.x86_64.rpm (46.45 M): 100% [##############] Time: 0:00:08   5.74 MB/s
Package oceanbase-ce-3.1.2 is available.

install oceanbase-ce-3.1.2 for local ok
+-------------------------------------------------------------------------------------------+
|                                          Packages                                         |
+--------------+---------+-----------------------+------------------------------------------+
| Repository   | Version | Release               | Md5                                      |
+--------------+---------+-----------------------+------------------------------------------+
| oceanbase-ce | 3.1.2   | 10000392021123010.el7 | 7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed |
+--------------+---------+-----------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Remote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository install ok
Remote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository lib check !!

[WARN] 127.0.0.1 oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed require: libmariadb.so.3

Try to get lib-repository
Download oceanbase-ce-libs-3.1.2-10000392021123010.el7.x86_64.rpm (155.22 K): 100% [########] Time: 0:00:00   6.76 MB/s
Package oceanbase-ce-libs-3.1.2 is available.

install oceanbase-ce-libs-3.1.2 for local ok
Use oceanbase-ce-libs-3.1.2-94fff0ab31de053051dba66039e3185fa390cad5 for oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed
Remote oceanbase-ce-libs-3.1.2-94fff0ab31de053051dba66039e3185fa390cad5 repository install ok
Remote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository lib check ok
Cluster status check ok
Initializes observer work home ok
xybobs deployed
[root@obs ~]#
[root@obs ~]# obd cluster start xybobs
Get local repositories and plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[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.2   | 2881 | zone1 | active |
+-----------+---------+------+-------+--------+

xybobs running
[root@obs ~]#

安装OceanBase数据库客户端 OBClient

yum install -y obclient

`
[root@obs ~]# yum install -y obclient
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
–> Running transaction check
–> 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 | 40 MB 00:00:06

Original: https://www.cnblogs.com/helong-123/p/16115644.html
Author: 萌褚
Title: 基于CentOS系统安装OceanBase数据库

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/523868/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • shell升级

    对/sbin/nologin的理解 系统账号的shell使用 /sbin/nologin ,此时无法登陆系统,即使给了密码也不行。 所谓”无法登陆”指的仅是…

    Linux 2023年5月28日
    0100
  • 经典算法学习-计算汉明权重 SWAR(SIMD within a register)

    计算汉明权重算法 SWAR(SIMD within a register) 参考文章: [1] 简书:计算汉明权重的SWAR(SIMD within a Register)算法ht…

    Linux 2023年6月6日
    071
  • 十、进程管理

    什么是进程?进程(Process)是一个程序在其自身的虚拟地址空间的一次执行活动。之所以要创建进程,就是为了使多个程序可以并发的执行,从而提高系统的资源利用率和吞吐量。简单来说进程…

    Linux 2023年6月7日
    0132
  • JavaScript事件处理(三)

    上机三 JavaScript事件处理 目的: 熟练掌握JavaScript事件处理机制 重点理解面向对象编程思想,并构建程序。 要求: 定义一个按钮,动态生成DIV,可以生成多个D…

    Linux 2023年6月13日
    085
  • AOP实现系统告警

    工作群里的消息怕过于安静,又怕过于频繁 一、业务背景 在开发的过程中会遇到各种各样的开发问题,服务器宕机、网络抖动、代码本身的bug等等。针对代码的bug,我们可以提前预支,通过发…

    Linux 2023年6月13日
    082
  • 学生管理系统(初级)

    #include #include #include #define Size sizeof(struct Student) struct Student *p = NULL; t…

    Linux 2023年6月7日
    093
  • 超好用的UnixLinux 命令技巧 大神为你详细解读

    1、删除一个大文件 我在生产服务器上有一个很大的200GB的日志文件需要删除。我的rm和ls命令已经崩溃,我担心这是由于巨大的磁盘IO造成的,要删除这个大文件,输入: > /…

    Linux 2023年6月14日
    090
  • sublime text里面中文字体显示异常解决方案

    sublime text下载之后一开始转成中文之后,会出现中文显示异常的问题,比如下图中”门”字显示异常 通过如下的设置可以解决该问题: 首选项&#8211…

    Linux 2023年6月13日
    0187
  • ELK 脚本自动化删除索引

    kibana有自带接口,可通过自带的API接口 通过传参来达到删除索引的目的。 删除15天前的索引 curl -XDELETE "http://10.228.81.161…

    Linux 2023年6月8日
    071
  • 分布式中灰度方案实践

    让请求在导航的服务节上点执行; 一、背景简介 分布式系统中会存在这样的开发场景,不同需求可能涉及到对同一个服务的开发,那么该服务在研发期间就会存在多个版本并行的状态,为了保持不同版…

    Linux 2023年6月14日
    0106
  • shell ${val:0:3)含义

    ${file:0:5}:提取最左边的5个字节:/dir1${file:5:5}:提取第5个字节右边的连续5个字节:/dir2 例子: pval=12345678 r=${pval:…

    Linux 2023年5月28日
    062
  • MSSQL·FOR XML PATH语法转义尖括号解决方案

    阅文时长 | 0.14分钟字数统计 | 225.6字符主要内容 | 1、引言&背景 2、示例及解决方案 3、声明与参考资料『MSSQL·FOR XML PATH语法转义尖括…

    Linux 2023年6月14日
    076
  • cobbler的部署

    cobbler部署 //配置yum源 [root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://m…

    Linux 2023年6月13日
    082
  • 【Python】【Flask】【字符串索引】计算人民币与美元的相互计算

    简介 Python Code 导包 设置首页 计算的接口 问题0:设置请求方式 问题1:关于接收数据可能存在的问题 问题2:返回结果 启动 完整代码 HTML Code 问题分析 …

    Linux 2023年6月14日
    089
  • 磁盘和文件系统

    fdisk -l [磁盘设备] //非交互式查看磁盘分区 fdisk [磁盘设备] //交互式查看和管理磁盘分区 非交互式查看磁盘分区 [root@localhost ~]# ll…

    Linux 2023年6月6日
    0114
  • 面试题:Java中为什么只有值传递?

    作者:小牛呼噜噜 | https://xiaoniuhululu.com计算机内功、JAVA底层、面试相关资料等更多精彩文章在公众号「小牛呼噜噜 」 经典的问题 形参&实参…

    Linux 2023年6月6日
    0119
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球