在kubernetes上使用ob-operator部署OceanBase-ce 3.1.3

环境:

系统:Ubuntu 20.04

内核:5.15

OceanBase版本:3.1.3-OceanBase CE

1、基础环境

安装kubernetes 1.25.2,containerd 1.6.8,并初始化一个三主(master)六从(slave)的集群

这处操作,略

2、拉取ob-operator代码

# git clone https://github.com/oceanbase/ob-operator.git

3、安装OceanBase的存储环境

因为obcluster.yaml中使用的路径是local-path

详情请看文档:https://github.com/oceanbase/ob-operator/issues/5

# kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.22/deploy/local-path-storage.yaml

# kubectl get sc

NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE

local-path rancher.io/local-path Delete WaitForFirstConsumer false 2m50s

4、配置节点label

# kubectl label nodes slave-1 topology.kubernetes.io/zone=zone1

# kubectl label nodes slave-2 topology.kubernetes.io/zone=zone1

# kubectl label nodes slave-3 topology.kubernetes.io/zone=zone2

# kubectl label nodes slave-4 topology.kubernetes.io/zone=zone2

# kubectl label nodes slave-5 topology.kubernetes.io/zone=zone3

# kubectl label nodes slave-6 topology.kubernetes.io/zone=zone3

5、创建obcluster的namespace(不知道为啥crd和operator里都没有)

kubectl create namespace obcluster

6、部署ob-operator

# cd ob-operator/deploy/

# kubectl apply -f crd.yaml

# kubectl apply -f operator.yaml

# kubectl apply -f obcluster.yaml

7、部署obproxy

# cd obproxy/

# kubectl apply -f deployment.yaml -f service.yaml

8、查看和连接集群

# kubectl -n oceanbase-system get pods -o wide # 查看ob-operator

# kubectl -n obcluster get pods -o wide

# kubectl -n obcluster get svc

# mysql -u root@sys -p -h 10.96.80.26 -A -c -P 2881

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 3222146325

Server version: 5.7.25 OceanBase 3.1.3 (r10100042022051821-a09d3134c10665f03fd56d7f8bdd413b2b771977) (Built May 18 2022 21:42:24)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

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

mysql> SELECT version();

+——————–+

| version() |

+——————–+

| 3.1.3-OceanBase CE |

+——————–+

1 row in set (0.01 sec)

mysql>

剩下的内容,去看官网吧,官网地址如下:

https://www.oceanbase.com/docs/community-tutorials-cn-10000000000012249

https://www.oceanbase.com/docs/community-observer-cn-10000000000449661

问题:

目前有一个大问题,如果删除‘sapp-ob-test-cn-zone*’的pod,那么该pod就会被反复重建,而且‘ob-operator-controller-manager’居然没有日志输出,居然没有日志输出,居然没有日志输出

留下评论

error: Content is protected !!