参考官网

OceanBase分布式数据库-海量数据 笔笔算数

步骤 1:下载并安装 all-in-one package

从 V4.0.0 开始,OceanBase 提供统一的安装包 all-in-one package。您可以通过这个统一的安装包一次性完成 OBD、OceanBase 数据库、 OBProxy、obagent、Grafana 和 Prometheus 的安装;您可以根据实际需求选择部分组件安装或者指定组件的版本。 all-in-one package 提供了两种安装方式:

在线安装 all-in-one package

执行以下命令,可以在线下载并安装 all-in-one package

bash -c "$(curl -s https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/download-center/opensource/oceanbase-all-in-one/installer.sh)"

离线安装 all-in-one package

从 OceanBase 社区下载中心 下载最新的 all-in-one package 安装包,oceanbase-all-in-one.4.0.0.0-beta-100120221102135736.el7.x86_64.tar.gz。

执行以下命令解压安装包并进入安装目录。

tar -xzf oceanbase-all-in-one.4.0.0.0-beta-100120221102135736.el7.x86_64.tar.gz

cd oceanbase-all-in-one/bin/

执行安装脚本

[root@**** bin]#  ./install.sh

name: grafana

version: 7.5.17

release:1

arch: x86_64

md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6

add /home/admin/oceanbase-all-in-one/rpms/grafana-7.5.17-1.el7.x86_64.rpm to local mirror

name: obagent

version: 1.2.0

release:4.el7

arch: x86_64

md5: 0e8f5ee68c337ea28514c9f3f820ea546227fa7e

add /home/admin/oceanbase-all-in-one/rpms/obagent-1.2.0-4.el7.x86_64.rpm to local mirror

name: obproxy-ce

version: 4.0.0

release:5.el7

arch: x86_64

md5: de53232a951184fad75b15884458d85e31d2f6c3

add /home/admin/oceanbase-all-in-one/rpms/obproxy-ce-4.0.0-5.el7.x86_64.rpm to local mirror

name: oceanbase-ce

version: 4.0.0.0

release:100000272022110114.el7

arch: x86_64

md5: 42611dc51ca9bb28f36e60e4406ceea4a74914c7

add /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-4.0.0.0-100000272022110114.el7.x86_64.rpm to local mirror

name: oceanbase-ce-libs

version: 4.0.0.0

release:100000272022110114.el7

arch: x86_64

md5: 188919f8128394bf9b62e3989220ded05f1d14da

add /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.0.0.0-100000272022110114.el7.x86_64.rpm to local mirror

name: prometheus

version: 2.37.1

release:10000102022110211.el7

arch: x86_64

md5: 58913c7606f05feb01bc1c6410346e5fc31cf263

add /home/admin/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror

Disable remote ok

安装后设置和验证

安装脚本会尝试自动设置好环境变量,对于特定的系统如果环境变量未生效,可以根据提示,执行设置环境变量的脚本,如果需要设置为每次登陆都生效,需要根据用户使用的 terminal 环境,写到对应的 profile 文件中,一般为 ~/.bash_profile

  

  Install Finished

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

  Setup Environment:     source ~/.oceanbase-all-in-one/bin/env.sh

  Quick Start:           obd demo

  More Details:          obd -h

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

注意

安装完成后需执行 source ~/.oceanbase-all-in-one/bin/env.sh 否则直接执行 which obd 会失败

执行 which obd 和 which obclient 检测是否安装成功,如果可以找到 oceanbase-all-in-one 下的 obd 和 obclient 路径,则表示安装成功。

  [root@test .obd]# which obd

  /root/.oceanbase-all-in-one/obd/usr/bin/obd

  [root@test .obd]# which obclient

  /root/.oceanbase-all-in-one/obclient/u01/obclient/bin/obclient

步骤 2:使用 obd demo 快速部署单机体验环境

使用该命令可在不传入配置文件的情况下直接在本机部署并启动指定的组件。固定部署名为 demo。部署完成后,可以通过命令 obd cluster list 查看该集群,也可以通过其他的集群命令进行管理,比如 obd cluster display demo 等。

执行 obd demo 前您需要确认以下信息:

2881 和 2882 端口没有被占用。

机器可用内存不低于 6 G

机器 CPU 数目不低于 2

机器可用磁盘空间不小于 54 G

打开的文件句柄数量不小于 20000

obd demo 部署方式采用最小规格部署,部署的组件版本默认为最新版本,默认部署的组件包含 oceanbase-ce、obproxy-ce、obagent、grafana、prometheus。

注意

obd demo 部署仅适用于快速上手体验,不适用于生产环境。

# 部署并启动 OceanBase 数据库

[root@****]# obd demo

+---------------------------------------------+

|                   observer                  |

+-----------+---------+------+-------+--------+

| ip        | version | port | zone  | status |

+-----------+---------+------+-------+--------+

| 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE |

+-----------+---------+------+-------+--------+

obclient -h127.0.0.1 -P2881 -uroot -Doceanbase

+---------------------------------------------+

|                   obproxy                   |

+-----------+------+-----------------+--------+

| ip        | port | prometheus_port | status |

+-----------+------+-----------------+--------+

| 127.0.0.1 | 2883 | 2884            | active |

+-----------+------+-----------------+--------+

obclient -h127.0.0.1 -P2883 -uroot -Doceanbase

+----------------------------------------------------+

|                      obagent                       |

+----------------+-------------+------------+--------+

| ip             | server_port | pprof_port | status |

+----------------+-------------+------------+--------+

| 172.30.135.208 | 8088        | 8089       | active |

+----------------+-------------+------------+--------+

+-------------------------------------------------------+

|                       prometheus                      |

+----------------------------+------+----------+--------+

| url                        | user | password | status |

+----------------------------+------+----------+--------+

| http://192.168.1.1:9090    |      |          | active |

+----------------------------+------+----------+--------+

+---------------------------------------------------------------------+

|                               grafana                               |

+----------------------------------------+-------+-----------+--------+

| url                                    | user  | password  | status |

+----------------------------------------+-------+-----------+--------+

| http://192.168.1.1:3000/d/oceanbase    | admin | oceanbase | active |

+----------------------------------------+-------+-----------+--------+

demo running

# 使用 OBClient 客户端连接到 OceanBase 数据库

[root@****]# obclient -h127.0.0.1 -uroot -P2881

Welcome to the OceanBase.  Commands end with ; or \g.

Your OceanBase connection id is 5751

Server version: 5.6.25 OceanBase 4.0.0 (r10100032022041510-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built Oct 15 2022 02:16:22)

Copyright (c) 2000, 2022, OceanBase and/or its affiliates. All  rights reserved.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

obclient [(none)]>

您也可以通过参数控制部署的组件、组件的版本、配置以及部署的目录。更多关于 obd demo 命令的介绍,参见 快速部署命令

Logo

了解最新的技术洞察和前沿趋势,参与 OceanBase 定期举办的线下活动,与行业开发者互动交流

更多推荐