故障自愈
NebulaGraph Operator 调用 悦数图数据库 集群提供的接口,动态地感知服务是否正常运行。当 悦数图数据库 集群中某一组件停止运行时,NebulaGraph Operator 会自动地进行容错处理。本文通过删除 悦数图数据库 集群中 1 个 Storage 服务 Pod,模拟集群故障为例,说明 Nebular Operator 如何进行故障自愈。
前提条件
操作步骤
-
创建 悦数图数据库 集群。具体步骤参考创建 悦数图数据库 集群。
-
待所有 Pods 都处于
Running状态时,模拟故障,删除名为<cluster_name>-storaged-2Pod。
kubectl delete pod <cluster-name>-storaged-2 --now
<cluster_name>为 悦数图数据库 集群的名称。
- NebulaGraph Operator 自动创建名为
<cluster-name>-storaged-2的 Pod,以修复故障。
执行kubectl get pods查看<cluster-name>-storaged-2Pod 的创建状态。
...
nebula-cluster-storaged-1 1/1 Running 0 5d23h
nebula-cluster-storaged-2 0/1 ContainerCreating 0 1s
...
...
nebula-cluster-storaged-1 1/1 Running 0 5d23h
nebula-cluster-storaged-2 1/1 Running 0 4m2s
...
当<cluster-name>-storaged-2的状态由ContainerCreating变为Running时,说明自愈成功。