阿里龙蜥OS 8.6离线安装单机版OceanBase 4.3(社区版)

一、下载安装包

提前或者找一台能连外网的电脑先去官网下载安装包
官方下载地址https://www.oceanbase.com/softwarecenter

推荐下载OceanBase All in One版本

二、拷贝至服务器上

下载完成后拷贝至服务器上。

三、运行安装命令

1.解压包

bash 复制代码
#提前切入到存放压缩文件的路径下,依次执行下面的命令
tar -xzf oceanbase-all-in-one-4.4.1_20251020.el7.x86_64.tar.gz
cd oceanbase-all-in-one/bin/
./install.sh
source ~/.oceanbase-all-in-one/bin/env.sh

2.修改配置文件

bash 复制代码
#进入配置文件目录下
cd ~/.oceanbase-all-in-one/obd/usr/obd/example
#查看官方提供的配置文件清单
ls

能看到大概有这些配置文件

官方对于配置文件的用途做了如下说明:

小规格开发模式,适用于个人设备(内存不低于 8 GB)

本地单机部署配置样例:mini-local-example.yaml

单机部署配置样例:mini-single-example.yaml

单机部署 + ODP 配置样例:mini-single-with-obproxy-example.yaml

分布式部署 + ODP 配置样例:mini-distributed-with-obproxy-example.yaml

分布式部署 + ODP + OCP Express 配置样例:default-components-min.yaml

分布式部署全部组件:all-components-min.yaml

专业开发模式,适用于高配置 ECS 或物理服务器(可用资源不低于 16 核 64 GB)

本地单机部署配置样例:local-example.yaml

单机部署配置样例:single-example.yaml

单机部署 + ODP 配置样例:single-with-obproxy-example.yaml

分布式部署 + ODP 配置样例:distributed-with-obproxy-example.yaml

分布式部署 + ODP + OCP Express 配置样例:default-components.yaml

分布式部署全部组件:all-components.yaml
具体配置项说明 可点击https://www.oceanbase.com/docs/community-obd-cn-1000000001881971

bash 复制代码
#这里我们选择本地部署的小型配置文件 适合8G内存以上的配置的服务器
vi mini-local-example.yaml
bash 复制代码
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: /root/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
    # Starting from observer version 4.2, the network selection for the observer is based on the 'local_ip' parameter, and the 'devname' parameter is no longer mandatory.
    # If the 'local_ip' parameter is set, the observer will first use this parameter for the configuration, regardless of the 'devname' parameter.
    # If only the 'devname' parameter is set, the observer will use the 'devname' parameter for the configuration.
    # If neither the 'devname' nor the 'local_ip' parameters are set, the 'local_ip' parameter will be automatically assigned the IP address configured above.
    # devname: eth0
    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.
    obshell_port: 2886 # Operation and maintenance port for Oceanbase Database. The default value is 2886. This parameter is valid only when the version of oceanbase-ce is 4.2.2.0 or later.
    zone: zone1
    cluster_id: 1
    # please set memory limit to a suitable value which is matching resource.
    memory_limit: 6G # The maximum running memory for an observer
    system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
    datafile_size: 2G # Size of the data file.
    datafile_next: 2G # the auto extend step. Please enter an capacity, such as 2G
    datafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20G
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: /root/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
    # Starting from observer version 4.2, the network selection for the observer is based on the 'local_ip' parameter, and the 'devname' parameter 
is no longer mandatory.
    # If the 'local_ip' parameter is set, the observer will first use this parameter for the configuration, regardless of the 'devname' parameter.
    # If only the 'devname' parameter is set, the observer will use the 'devname' parameter for the configuration.
    # If neither the 'devname' nor the 'local_ip' parameters are set, the 'local_ip' parameter will be automatically assigned the IP address configured above.
    # devname: eth0
    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.
    obshell_port: 2886 # Operation and maintenance port for Oceanbase Database. The default value is 2886. This parameter is valid only when the version of oceanbase-ce is 4.2.2.0 or later.
    zone: zone1
    cluster_id: 1
    # please set memory limit to a suitable value which is matching resource.
    memory_limit: 6G # The maximum running memory for an observer
    system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
    datafile_size: 2G # Size of the data file.
    datafile_next: 2G # the auto extend step. Please enter an capacity, such as 2G
    datafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20G
    log_disk_size: 14G # The size of disk space used by the clog files.
    cpu_count: 4
    production_mode: false
    enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true.
    max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.
    
    #***************************上面根据自己机器配置设置*********
    #***************************下面的推荐设置***************
    #修改登录密码
    root_password: a12345678. # root user password, can be empty
    #修改数据库实例名
    appname: myoceanbase
    #设置开机自启动
    enable_auto_start: true

如果后面修改过配置需要执行

bash 复制代码
obd cluster reload myoceanbase

如果数据库服务没启动可以

bash 复制代码
obd cluster start myoceanbase

PS:如果启动报错

bash 复制代码
[ERROR] OBD-1007: (127.0.0.1) The value of the ulimit parameter "open files" must not be less than 20000 (Current value: 1024), Please execute `echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf` as root in 127.0.0.1. if it dosen't work, please check whether UsePAM is yes in /etc/ssh/sshd_config.

执行命令

bash 复制代码
#修改配置文件
echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf
#重启sshd
systemctl restart sshd
#再启动oceanbase数据库
obd cluster start myoceanbase

四、链接测试

我使用的是navicat,选择mysql链接方式,测试连接通过。

相关推荐
无心水4 小时前
【分布式利器:分布式ID】7、分布式数据库方案:TiDB/OceanBase全局ID实战
数据库·分布式·tidb·oceanbase·分库分表·分布式id·分布式利器
风123456789~6 天前
【OceanBase专栏】OB背景知识
数据库·笔记·oceanbase
风123456789~7 天前
【OceanBase专栏】SECURE_FILE_PRIV 设置报错解决
oceanbase
风123456789~8 天前
【OceanBase专栏】OB租户-创建实验
数据库·笔记·oceanbase
风123456789~10 天前
【OceanBase专栏】OceanBase 外部表实验
数据库·笔记·oceanbase
owCode11 天前
OceanBase训练营miniob提测踩坑
数据库·oceanbase·数据库开发
老纪的技术唠嗑局11 天前
OceanBase Session ID 之谜
oceanbase
Hello.Reader12 天前
Flink CDC 用 OceanBase CDC 实时同步数据到 Elasticsearch
elasticsearch·flink·oceanbase
沟通QQ:2769988513 天前
卡尔曼滤波估算车辆质量——Matlab Simulink仿真模型探索
oceanbase