暂无图片
暂无图片
3
暂无图片
暂无图片
暂无图片

🚀 OceanBase 4.0 All In One 快速体验

原创 诸岳 2022-11-02
1437

2022 云栖大会上,OceanBase 社区版 4.0 Beta(公测)正式亮相,是业内首个兼容 MySQL 的单机分布式一体化数据库。通过配套的 OceanBase All In One 全家桶,2 分钟内即可完成快速部署。对于想快速尝鲜的同学来说,无疑是一大亮点。

介绍

  • OceanBase All In One 是为了方便用户能够一键安装 OceanBase 相关组件推出的一站式离线安装包,从 4.0 社区版开始对外推出,目前包含以下 8 个组件:
    • oceanbase-ce
    • oceanbase-ce-libs
    • obproxy-ce
    • obagent
    • obclient
    • obd
    • prometheus
    • grafana

快速体验

OceanBase All In One 目前仅支持 Linux 系统,为了方便演示,以下使用 Docker 进行操作。

安装并配置 Docker

    • CPU 数目不少于 2 个。
    • 可用内存不低于 8G。
    • 可用磁盘空间不少于 54G。

  • Docker 的资源配置如下:

启动容器

  • 拉取 Centos 7.x 的镜像:

$ docker pull centos:7

  • 新建一个名为 centos-oceanbase-all-in-one 的 CentOS 7 容器并进入,需要映射好以下端口:
    • 2881: OBServer SQL 端口
    • 2883: OBProxy 访问端口
    • 9090: Prometheus 访问端口
    • 3000: Grafana 访问端口

$ docker run -p 2881:2881 -p 2883:2883 -p 9090:9090 -p 3000:3000 -itd --name centos-oceanbase-all-in-one centos:7

$ docker attach centos-oceanbase-all-in-one

在线安装

  • 执行以下命令,可以在线下载并安装 OceanBase All In One:

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

离线安装

  • 官网 下载 OceanBase All In One 安装包:

  • 下载到本地后,将其复制到刚刚创建的 docker 容器中:

$ docker cp Downloads/oceanbase-all-in-one.4.0.0.0-beta-100120221102135736.el7.x86_64.tar.gz centos-oceanbase-all-in-one:/

  • 解压后执行 install.sh脚本,主要做了两件事:
    • 安装 obd 和 obclient
    • 将其他组件的 RPM 包加载到本地源,这样 obd 直接拉取本地的 RPM 进行安装

# 解压
$ tar xvf oceanbase-all-in-one.4.0.0.0-beta-100120221102135736.el7.x86_64.tar.gz

# 将各个组件的 RPM 包加载到本地源,便于后续通过 OBD 安装
$ oceanbase-all-in-one/bin/install.sh

  • 使用 obd 在本机部署并启动相关的组件,有两种方式,效果相同、任选其一:

# 方式一
$ obd demo

# 方式二
$ obd cluster playground -c oceanbase-ce,obproxy-ce,obagent,prometheus,grafana

  • 各个组件安装并启动成功:

验证组件

oceanbase/oceanbase-ce-libs/obclient

  • 在容器内使用 obclient 直连 OceanBase:

  • 在宿主机上使用 MySQL 客户端直连 OceanBase:

obproxy-ce

  • 在容器内使用 obclient 通过 OBProxy 连接 OceanBase:

  • 在宿主机上使用 MySQL 客户端通过 OBProxy 连接 OceanBase:

prometheus/obagent

  • 内置 OceanBase 常用的告警规则:

grafana

  • 默认账密: admin/oceanbase

  • Grafana 默认对接内置的 Prometheus 服务:

  • 内置 OceanBase 常用的监控指标:

参考

最后修改时间:2022-11-03 21:21:15
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论