Skip to main content

Quick start

This topic describes how to deploy ob-operator and an OceanBase cluster and use ob-operator to manage OceanBase Database.

Prerequisites

Before you start the deployment, make sure that the following conditions are met:

  • You have an available Kubernetes cluster, which has at least 2 CPU cores, 10 GB of memory, and 100 GB of storage space.
  • You have installed cert-manager. For more information about how to install cert-manager, see the installation document.
  • You have installed local-path-provisioner and confirmed that the specified destination has sufficient storage space. For more information about how to install local-path-provisioner, see the documentation on GitHub.

Deploy ob-operator

Run the following command to deploy ob-operator in the Kubernetes cluster:

  • Deploy the stable version of ob-operator

    kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.1_release/deploy/operator.yaml
  • Deploy the developing version of ob-operator

    kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/master/deploy/operator.yaml

Run the following command to verify that ob-operator is deployed:

kubectl get pod -n oceanbase-system

The expected output is as follows:

NAME                                            READY   STATUS    RESTARTS   AGE
oceanbase-controller-manager-86cfc8f7bf-4hfnj 2/2 Running 0 1m

Deploy an OceanBase cluster

Perform the following steps to deploy an OceanBase cluster in the Kubernetes cluster:

  1. Create secrets Before you create an OceanBase cluster, you must create secrets required for specific users. Run the following commands to create secrets:

    kubectl create secret generic root-password --from-literal=password='root_password'
    kubectl create secret generic proxyro-password --from-literal=password='proxyro_password'
    kubectl create secret generic monitor-password --from-literal=password='monitor_password'
    kubectl create secret generic operator-password --from-literal=password='operator_password'
  2. Deploy an OceanBase cluster Run the following command to deploy an OceanBase cluster in the Kubernetes cluster:

    kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.1_release/example/quickstart/obcluster.yaml

    In general, it takes about 2 minutes to create a cluster. Run the following command to check the cluster status:

    kubectl get obclusters.oceanbase.oceanbase.com test

    The expected output is as follows:

    NAME   STATUS    AGE
    test running 6m2s
  3. Connect to the OceanBase cluster Perform the following steps to connect to the created OceanBase cluster:

    # Run the following command to obtain the IP address and name of the pod for the server where the OceanBase cluster is deployed.
    # The pod name is in the {cluster_name}-{cluster_id}-{zone}-uuid format.
    kubectl get pods -o wide
    # Run the following command to connect to the cluster.
    mysql -h{POD_IP} -P2881 -uroot -p'root_password' oceanbase -A -c

If you have any questions or need help, contact OceanBase Technical Support.

What to do next

This topic describes how to deploy ob-operator and an OceanBase cluster. You can use the method to quickly set up the environment. For more information about the deployment and O&M of clusters in a production environment, see Manage clusters.

After you create a cluster, you need to create a business tenant. For more information about tenant management, see Manage OceanBase Database tenants.