OceanBase 数据库搭建

打印 上一主题 下一主题

主题 1718|帖子 1718|积分 5154

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
参考官网
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 下令的先容,参见 快速部署下令。



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

正序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

何小豆儿在此

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表