当前位置: 首页 > news >正文

K8s安装doris踩坑记录

K8s安装Doris

官方文档: https://doris.apache.org/zh-CN/docs/install/k8s-deploy/

整体流程:配置yml文件,k8s执行apply命令

以官方文档为基础,进行修改。官方文档镜像拉取存在问题,直接拉取test会出现拉取异常。

以下是一个fe节点和一个be节点的配置文件参考:

doris_follower.yml:

apiVersion: v1
kind: Service
metadata:name: doris-follower-cluster1labels:app: doris-follower-cluster1
spec:ports:- port: 8030name: http-port- port: 9020name: rpc-port- port: 9030name: query-port- port: 9010name: edit-log-port #This name should be fixed. Doris will get the port information through this nameclusterIP: Noneselector:app: doris-follower-cluster1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:name: doris-follower-cluster1labels:app: doris-follower-cluster1
spec:selector:matchLabels:app: doris-follower-cluster1serviceName: doris-follower-cluster1# 修改创建副本数量为1replicas: 1template:metadata:name: doris-follower-cluster1labels:app: doris-follower-cluster1spec:## 给当前pod加入host#hostAliases:#- ip: "x"#  hostnames:#  - "apiserver.cluster.local"containers:- name: doris-follower-cluster1#修改镜像 依据https://hub.docker.com/r/apache/doris/tags获取image: apache/doris:2.0.0_alpha-fe-x86_64imagePullPolicy: IfNotPresentenv:# 增加APP_NAMESPACE与FE_IPADDRESS环境变量 - name: APP_NAMESPACEvalueFrom:fieldRef:fieldPath: metadata.namespace- name: FE_IPADDRESSvalueFrom:fieldRef:fieldPath: status.podIP#Specify the startup type as k8s to bypass some restrictions of the official image initialization script- name: BUILD_TYPEvalue: "k8s"#Initialize the fe of three nodes- name: FE_INIT_NUMBER# fe创建数量改为1value: "1"#ServiceName of bakend_cn node,(if do not have bakend_cn node,do not configure this environment variable)- name: CN_SERVICEvalue: "doris-cn-cluster1"#StatefulSetName of bakend_cn node,(if do not have bakend_cn node,do not configure this environment variable)- name: CN_STATEFULSETvalue: "doris-cn-cluster1"#ServiceName of bakend node,(if do not have bakend node,do not configure this environment variable)- name: BE_SERVICEvalue: "doris-be-cluster1"#StatefulSetName of bakend node,(if do not have bakend node,do not configure this environment variable)- name: BE_STATEFULSETvalue: "doris-be-cluster1"#ServiceName of follower node,(if do not have follower node,do not configure this environment variable)- name: FE_SERVICEvalue: "doris-follower-cluster1"##StatefulSetName of follower node,(if do not have follower node,do not configure this environment variable)- name: FE_STATEFULSETvalue: "doris-follower-cluster1"ports:- containerPort: 8030name: http-port- containerPort: 9020name: rpc-port- containerPort: 9030name: query-port- containerPort: 9010name: edit-log-portvolumeMounts:#Mount the configuration file in the way of configmap- name: confmountPath: /opt/apache-doris/fe/conf#In order to call the api of k8s- name: kubemountPath: /root/.kube/configreadOnly: truevolumes:- name: confconfigMap:name: follower-conf- name: kubehostPath:path: /root/.kube/config
---
apiVersion: v1
kind: ConfigMap
metadata:name: follower-conf
data:fe.conf: |# 更改为对应的k8s网络地址priority_networks = 172.16.0.0/24#It can automatically maintain node information by getting the number of replicas of StatefulSet, similar to alter system add/drop backenable_deploy_manager = k8s#Automatically adjust the IP of the node according to the domain name (for example, after the pod is restarted, the domain name is still doris-be-cluster1-0-doris-be-cluster1.default.svc.cluster.local, but the IP may change from 172.16.0.9 to 172.16.0.10)enable_fqdn_mode = trueLOG_DIR = ${DORIS_HOME}/logsys_log_level = INFOhttp_port = 8030rpc_port = 9020query_port = 9030edit_log_port = 9010#Doris needs to generate the log4j configuration file according to the fe.yml configuration information, which is written in the same directory as fe.yml by default, but the config we mount is readonly, so specify this configuration to write the log4j file to another locationcustom_config_dir = /opt/apache-doris/#when set to false, the backend will not be dropped and remaining in DECOMMISSION statedrop_backend_after_decommission = false

k8s对应的网络地址请修改为使用命令获取pod的CIDR参数–cluster-cidr

ps -ef | grep kube-controller-manager

如果您没有直接访问控制平面节点的权限,可以使用 kubectl 命令:

kubectl -n kube-system get pods -l component=kube-controller-manager -o yaml

使用命令启动fe

kubectl create -f doris_follower.yml

可能出现异常和问题处理:

  • Failed to pull image “apache-doris-fe:test”: rpc error: code = Unknown desc = failed to pull and unpack image
    检查镜像是否填写正常
  • io.fabric8.kubernetes.client.KubernetesClientException: Operation: [get] for kind: [StatefulSet] with name: [doris-follower-cluster1] in namespace: [default] failed.
    • 首先检查命名空间是否正确,如果设定了命名空间但是sts还是去default获取,检查APP_NAMESPACE是否增加
    • 如果已经获取到对应命名空间,但是sts还是报错,请为当前namespace添加role权限
    • 如果出现 Caused by: java.net.UnknownHostException: apiserver.cluster.local: Name or service not known 请检查/root/.kube/config 是否写了 server: https://apiserver.cluster.local:6443 地址,并且检查/etc/hosts 对应地址,将它加入hostAliases中
  • current node is not added to the group. please add it first
    检查网络地址priority_networks是否正确

doris_be.yml:

apiVersion: v1
kind: Service
metadata:name: doris-be-cluster1labels:app: doris-be-cluster1
spec:ports:- port: 9060name: be-port- port: 8040name: webserver-port- port: 9050name: heartbeat-port #This name should be fixed. Doris will get the port information through this name- port: 8060name: brpc-portclusterIP: Noneselector:app: doris-be-cluster1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:name: doris-be-cluster1labels:app: doris-be-cluster1
spec:selector:matchLabels:app: doris-be-cluster1serviceName: doris-be-cluster1# 修改创建副本数量replicas: 1template:metadata:name: doris-be-cluster1labels:app: doris-be-cluster1spec:containers:- name: doris-be-cluster1# 修改镜像地址image: apache/doris:2.0.0_alpha-be-x86_64imagePullPolicy: IfNotPresentenv:#Specify the startup type as k8s to bypass some restrictions of the official image initialization script- name: BUILD_TYPEvalue: "k8s"# 写明FE的IP与端口 (FQDN)- name: FE_MASTER_IPvalue: "doris-follower-cluster1-0.doris-follower-cluster1.default.svc.cluster.local"- name: FE_MASTER_PORTvalue: "9030"ports:- containerPort: 9060name: be-port- containerPort: 8040name: webserver-port- containerPort: 9050name: heartbeat-port- containerPort: 8060name: brpc-portvolumeMounts:#Mount the configuration file in the way of configmap- name: confmountPath: /opt/apache-doris/be/conf#Ifnot mounted, when enable_profile, error will be reported when querying the data from jdbc catalog#Error message: error setting certificate verify locations: CAfile:/etc/pki/tls/certs/ca-bundle.crt CApath: none- name: sysmountPath: /etc/pkireadOnly: truevolumes:- name: confconfigMap:name: be-conf- name: syshostPath:path: /etc/pki
---
apiVersion: v1
kind: ConfigMap
metadata:name: be-conf
data:be.conf: |PPROF_TMPDIR="$DORIS_HOME/log/"sys_log_level = INFObe_port = 9060webserver_port = 8040heartbeat_service_port = 9050brpc_port = 8060# 修改为k8s网络priority_networks = 172.16.0.0/24

使用命令启动be

kubectl create -f doris_be.yml

可能出现异常和问题处理:

  • be找不到fe
    检查服务的完全限定域名 (FQDN) 是否配置错误

doris-svc.yaml
对外暴露端口提供访问

apiVersion: v1
kind: Service
metadata:name: doris-svcnamespace: udm
spec:type: NodePortports:- port: 8030nodePort: 8030name: "p8030"- port: 9030nodePort: 9030name: "p9030"- port: 8040nodePort: 8040name: "p8040"selector:app: doris-follower-cluster1

kubectl apply -f doris-svc.yaml

相关文章:

  • git 简单入门
  • 阿里云OSS和腾讯云COS对象存储介绍和简单使用
  • 高并发场景下,如何设计订单库存架构,一共9个关键性问题
  • 了解防抖和节流:提升前端交互体验的实用策略
  • 【JAVA学习笔记】 68 - 网络——TCP编程、UDP编程
  • FFmpeg获取视频关键帧并保存成jpg图像
  • Centos, RockyLinux 常用软件安装汇总
  • 使用数据泵的注意事项
  • k8s自定义Endpoint实现内部pod访问外部应用
  • 307.区域和检索
  • Idea 编译SpringBoot项目Kotlin报错/Idea重新编译
  • YOLOv8-Seg改进:卷积变体系列篇 | DCNv3可形变卷积基于DCNv2优化 | CVPR2023
  • 2001-2022年全国平均气温数据,逐月数据均有
  • 鼎捷PLM:引领国产替代,创造极致体验,探索数字化研发可行之路
  • 【图论实战】 Boost学习 03:dijkstra_shortest_paths
  • Android Studio:GIT提交项目到远程仓库
  • exif信息对照
  • HomeBrew常规使用教程
  • java B2B2C 源码多租户电子商城系统-Kafka基本使用介绍
  • Linux gpio口使用方法
  • Magento 1.x 中文订单打印乱码
  • miaov-React 最佳入门
  • mysql_config not found
  • TiDB 源码阅读系列文章(十)Chunk 和执行框架简介
  • Vultr 教程目录
  • 阿里云ubuntu14.04 Nginx反向代理Nodejs
  • 持续集成与持续部署宝典Part 2:创建持续集成流水线
  • 普通函数和构造函数的区别
  • 如何在 Tornado 中实现 Middleware
  • 深入 Nginx 之配置篇
  • 《码出高效》学习笔记与书中错误记录
  • 东超科技获得千万级Pre-A轮融资,投资方为中科创星 ...
  • ​比特币大跌的 2 个原因
  • #android不同版本废弃api,新api。
  • #绘制圆心_R语言——绘制一个诚意满满的圆 祝你2021圆圆满满
  • (1)常见O(n^2)排序算法解析
  • (2022版)一套教程搞定k8s安装到实战 | RBAC
  • (Mac上)使用Python进行matplotlib 画图时,中文显示不出来
  • (webRTC、RecordRTC):navigator.mediaDevices undefined
  • (十)T检验-第一部分
  • (十二)springboot实战——SSE服务推送事件案例实现
  • (转) RFS+AutoItLibrary测试web对话框
  • ***利用Ms05002溢出找“肉鸡
  • .gitignore文件—git忽略文件
  • .NET 中创建支持集合初始化器的类型
  • .NET/C# 编译期能确定的字符串会在字符串暂存池中不会被 GC 垃圾回收掉
  • .NETCORE 开发登录接口MFA谷歌多因子身份验证
  • .Net下C#针对Excel开发控件汇总(ClosedXML,EPPlus,NPOI)
  • .set 数据导入matlab,设置变量导入选项 - MATLAB setvaropts - MathWorks 中国
  • @cacheable 是否缓存成功_Spring Cache缓存注解
  • [20170728]oracle保留字.txt
  • [AIGC] SQL中的数据添加和操作:数据类型介绍
  • [ASP.NET MVC]Ajax与CustomErrors的尴尬
  • [BZOJ2281][SDOI2011]黑白棋(K-Nim博弈)
  • [C#]DataTable常用操作总结【转】