Files
oceanbase/docs/docs-cn/2.quickstart/2.deploy-an-oceanbase-database-by-using-docker.md
2022-02-10 14:51:49 +08:00

1.9 KiB

在 CentOS7 镜像上部署 OceanBase 数据库

OceanBase 数据库支持在 CentOS7 上运行。本文介绍如何在 CentOS7 的 Docker 镜像上部署 OceanBase 数据库。

前提条件

在 CentOS7 的 Docker 镜像上部署 OceanBase 数据库之前,您需要确认以下信息:

  • 您已经安装了 Docker 和 Git。

    Docker 安装详情,参考 Docker 文档

    Git 安装详情,参考 Git 文档

  • 您已经启动了 Docker。

操作步骤

按照以下步骤下载 CentOS7 镜像并部署 OceanBase 数据库。

  1. 拉取 CentOS7 镜像。

    docker pull centos:7
    docker run -d -i -t centos:7 /bin/bash
    docker exec -it <CONTAINER ID> /bin/bash
    

    注意

    您必须将 CONTAINER ID 替换为您的 centos:7 容器 ID。

  2. 使用 OBD 部署 OceanBase 数据库。

    yum install -y yum-utils
    yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
    yum install -y ob-deploy
    source /etc/profile.d/obd.sh
    git clone https://github.com/oceanbase/obdeploy.git
    cd obdeploy
    obd cluster deploy c1 -c ./example/mini-local-example.yaml
    

    详细信息,参考 快速上手

  3. 增加 Docker 内存至 8G。

    详细信息,Mac 用户参考 Docker 桌面版 Mac 用户手册,Window 用户参考 Docker 桌面版 Windows 用户手册

  4. 连接 OceanBase 数据库。

    yum install -y obclient
    obd cluster start c1
    obclient -h127.0.0.1 -P2881 -uroot
    

    详细信息,参考 快速上手