基于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)

大家都在看

  • 基础算法题

    Problem 3或5的倍数 2: 偶斐波那契数 4:最大回文乘积 5 窗口移动 11:方向数组 13大整数加法 、 14最长考拉兹序列 15:网格路径 25:1000位斐波那契数…

    Linux 2023年6月7日
    0129
  • 用go把博客园博客下载到本地Hexo目录下

    找到cookie 直接浏览器F12 巴拉巴拉 直接上代码 用hexo建静态博客的话,go文件在 \source\_posts目录下,run之后将会在此目录下生成cnblogs文件夹…

    Linux 2023年6月7日
    095
  • PowerShell yarn : 无法加载文件 C:UsersAdminAppDataRoamingnpmyarn.ps1,因为在此系统因为在此系统上禁止运行脚本。

    1、搜索powershell,右键以管理员身份运行 2、若要在本地计算机上运行您编写的未签名脚本和来自其他用户的签名脚本,请使用以下命令将计算机上的 执行策略更改为 RemoteS…

    Linux 2023年5月28日
    0115
  • 【原创】Linux虚拟化KVM-Qemu分析(五)之内存虚拟化

    背景 Read the fucking source code! –By 鲁迅 A picture is worth a thousand words. –…

    Linux 2023年6月8日
    081
  • ssl证书的选型,你知道多少?

    介绍 目前互联网常用的HTTP协议是非常不安全的明文传输协议。而SSL协议及其继任者TLS协议,是一种实现网络通信加密的安全协议,可在客户端(浏览器)和服务器端(网站)之间建立一条…

    Linux 2023年6月6日
    082
  • 解决某些情况下 ECharts 饼图多行标签重叠问题

    解决某些情况下 ECharts 饼图多行标签重叠问题 对于多行标签的重叠问题,其实一直没有一个完美的解决方案。 我能在网上查到的比较全面的解决方法就是这个:https://zhua…

    Linux 2023年6月7日
    097
  • Linux显示IP和主机名

    (1) ifconfig:Linux ifconfig命令用于显示或设置网络设备。 语法: ifconfig [网络设备][down up -allmulti -arp -prom…

    Linux 2023年6月8日
    0109
  • Java常见知识点总结

    1 重载 && 重写 重载: 发生在同一个类中, 方法名必须相同,参数类型不同、个数不同、顺序不同,方法返回值和访问修饰符可以不同,发生在编译时。 重写: 发生在父…

    Linux 2023年6月7日
    0101
  • RAID磁盘阵列

    RAID磁盘阵列 *本章重点:了解各RAID级别的原理优缺点及常用级别实现,企业中厂商大多提供了硬RAID方案。 1、什么是RAID? “RAID”一词是由…

    Linux 2023年6月7日
    095
  • 其他

    1、【剑指Offer学习】【面试题01:实现赋值运算符函数】 2、【剑指Offer学习】【面试题02:实现Singleton 模式——七种实现方式】 5、【剑指Offer学习】【面…

    Linux 2023年6月13日
    084
  • Centos8.x yum 源配置 解决 yum 不可用

    [root@iZ2ze1e3u7m7oe426pyndaa ~]# cd /etc/yum.repos.d/ [root@iZ2ze1e3u7m7oe426pyndaa yum.r…

    Linux 2023年6月7日
    0127
  • 保姆教程系列三、Nacos Config–服务配置

    前言: 请各大网友尊重本人原创知识分享,谨记本人博客:南国以南i 上篇我们介绍到 保姆教程系列二、Nacos实现注册中心 配置中心原理 一、 服务配置中心介绍 首先我们来看一下,微…

    Linux 2023年6月14日
    099
  • Tomcat性能优化方案

    你使用过tomcat的话,简单的说就是”内存溢出”. 通常情况下,这种问题出现在实际的生产环境中.产生这种问题的原因是tomcat使用较少的内存给进程,通过…

    Linux 2023年6月14日
    0112
  • Redis 位图BitMap

    应用场景: 用户签到 用户在线状态 统计活跃用户 各种状态值 自定义布隆过滤器 点赞功能 说明: 用string类型作为底层数据结构实现的一种统计状态的数据类型。 位图本质是数组,…

    Linux 2023年5月28日
    0108
  • phpcms如何在前台文章列表显示来源

    phpcms的文章来源分为两种,一种是在后台来源中添加完成的,这种”来源”的相关数据存放于数据库的copyfrom表中,通过id和news_data表相关联…

    Linux 2023年6月13日
    088
  • QString转char *

    故事背景:最近用到阿里云的OSS,里面用到了好多char *,但是我QT里面都是QString,我尝试用QString::fromstdstring(“”)…

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