1.2.3.3.2 部署 FoundationDB¶
FDB 是 Apple 公司开发的分布式强一致性存储结构化数据的数据库。 Doris 存算分离模式使用 FDB 作为元数据存储,通过 meta-service 组件来管理 FDB 中的元数据。 Kubernetes 上部署存算分离集群需要提前部署 FDB 服务,推荐两种部署方式:在虚机(包括物理机)上直接部署;使用 fdb-kubernetes-operator 部署 FDB 。虚机部署请参考 Doris 存算分离官方文档部署前准备部分搭建 FDB 集群。部署前请确保 FDB 有被 Doris 部署的 Kubernetes 集群访问的能力,即 Kubernetes 的 Node 与 FDB 部署的机器在同一个子网。 FDB 官方提供 Kubernetes 上部署运维管理服务 fdb-kubernetes-operator 。
以下简述使用 fdb-kubernetes-operator 最新版本部署 FDB 使用样例。
1 部署 FDB 相关资源定义¶
| Bash | |
|---|---|
1 2 3 | |
预期结果:
| Bash | |
|---|---|
1 2 3 4 5 6 | |
2 部署 fdb-kubernetes-operator 服务¶
fdb-kubernetes-operator 仓库提供了以 IP 模式部署 FDB 集群的部署样例。在 doris-operator 仓库中提供了以 FQDN 模式部署的 FDB 集群样例,可以按需下载。
-
下载部署样例:
-
从
fdb-kubernetes-operator官方仓库下载:fdb-kuberentes-operator默认情况下使用IP模式部署FDB Cluster,可以下载fdb-kubernetes-operator默认部署yaml。如果使用FQDN部署模式,请按照官方文档使用DNS部分进行定制化使用域名模式。Bash 1wget -O fdb-operator.yaml https://raw.githubusercontent.com/foundationdb/fdb-kubernetes-operator/main/config/samples/deployment.yaml -
从
doris-operator仓库下载:doris-operator仓库中制定化了以fdb-kuberentes-operator 1.46.0版本为基础的部署示例,可直接使用部署FDB cluster。Bash 1wget https://raw.githubusercontent.com/apache/doris-operator/master/config/operator/fdb-operator.yaml
-
-
部署
fdb-kubernetes-operator服务:定制化
fdb-kubernetes-operator的部署yaml后,使用如下命令部署fdb-kubernetes-operator:Bash 1kubectl apply -f fdb-operator.yaml预期结果:
Bash 1 2 3 4 5 6
serviceaccount/fdb-kubernetes-operator-controller-manager created clusterrole.rbac.authorization.k8s.io/fdb-kubernetes-operator-manager-clusterrole created clusterrole.rbac.authorization.k8s.io/fdb-kubernetes-operator-manager-role created rolebinding.rbac.authorization.k8s.io/fdb-kubernetes-operator-manager-rolebinding created clusterrolebinding.rbac.authorization.k8s.io/fdb-kubernetes-operator-manager-clusterrolebinding created deployment.apps/fdb-kubernetes-operator-controller-manager created
3 部署 FDB 集群¶
在 fdb-kubernetes-operator 仓库中提供了部署 FDB 的部署样例,通过如下命令直接下载使用
-
下载部署样例:
从
FDB官方下载IP模式部署样例:Bash 1wget https://raw.githubusercontent.com/foundationdb/fdb-kubernetes-operator/main/config/samples/cluster.yaml -
定制化部署样例:
-
环境可访问
dockerhub根据官网提供的用户手册定制化部署终态。如果使用
FQDN部署,请将routing.useDNSInClusterFile字段设置为true,配置如下:doris-operator的官方仓库中提供了使用FQDN部署FDB的部署样例可直接下载使用。Bash 1 2 3
spec: routing: useDNSInClusterFile: true -
私网环境
在私网环境下,如果不能直接访问
dockerhub可从FDB的官方仓库中将需要的镜像下载,并推到私有仓库中。fdb-kubernetes-operator依赖foundationdb/fdb-kubernetes-operator,foundationdb/foundationdb-kubernetes-sidecar。部署
FDB依赖的镜像包括:foundationdb/foundationdb,foundationdb/foundationdb-kubernetes-sidecar。推到私有仓库后,按照
fdb-kubernetes-operator官方文档定制化镜像配置说明进行配置。可参考如下配置添加私有仓库镜像配置:
Bash 1 2 3 4 5 6 7 8 9 10
spec: mainContainer: imageConfigs: - baseImage: foundationdb/foundationdb tag: 7.1.38 sidecarContainer: imageConfigs: - baseImage: foundationdb/foundationdb-kubernetes-sidecar tag: 7.1.36-1 version: 7.1.38
-
Tip
-
私有环境下,
FDB推到私有仓库时,tag必须与官方保持一致,比如:7.1.38。 -
部署
FDB时,FoundationDBCluster资源,.spec.version必须配置。 -
FDB基于fdb-kubernetes-operator部署,至少需要三个宿主机才可满足生产环境高可用要求。
4 确认 FDB 状态¶
FDB 基于 fdb-kubernetes-operator 部署,可以通过如下命令查看 FDB 集群状态:
| Bash | |
|---|---|
1 | |
预期结果如下,若 AVAILABLE 为 true 则代表集群可用:
| Bash | |
|---|---|
1 2 | |