doris on k8s 的安装部署

news2024/11/17 5:54:02

官方文档

1. 按照官网提供地址下载部署文件

在这里插入图片描述

2. 修改内核配置
sysctl -w vm.max_map_count=2000000
3. 根据服务器环境,修改doris_be.yml文件。
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

apiVersion: v1
kind: Service
metadata:
  name: doris-be-cluster1
  labels:
    app: doris-be-cluster1
spec:
  ports:
    - port: 9060
      name: be-port
    - port: 8040
      name: webserver-port
    - port: 9050
      name: heartbeat-port #This name should be fixed. Doris will get the port information through this name
    - port: 8060
      name: brpc-port
  clusterIP: None
  selector:
    app: doris-be-cluster1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: doris-be-cluster1
  labels:
    app: doris-be-cluster1
spec:
  selector:
    matchLabels:
      app: doris-be-cluster1
  serviceName: doris-be-cluster1
  replicas: 3
  template:
    metadata:
      name: doris-be-cluster1
      labels:
        app: doris-be-cluster1
    spec:
      containers:
        - name: doris-be-cluster1
          #Need to change to real mirror information
          #image: apache-doris-be:test
          # 修改点1: 镜像地址修改为真实doris镜像,可在https://hub.docker.com/r/apache/doris/tags找到需要的镜像版本
          image: apache/doris:2.0.0_alpha-be-x86_64
          imagePullPolicy: IfNotPresent
          env:
            #Specify the startup type as k8s to bypass some restrictions of the official image initialization script
            - name: BUILD_TYPE
              value: "k8s"
            # 修改点2: 增加环境变量,写明FE的IP与端口
            - name: FE_MASTER_IP
              value: "doris-follower-cluster1-0.doris-follower-cluster1.doris.svc.cluster.local"
            - name: FE_MASTER_PORT
              value: "9030"
          ports:
            - containerPort: 9060
              name: be-port
            - containerPort: 8040
              name: webserver-port
            - containerPort: 9050
              name: heartbeat-port
            - containerPort: 8060
              name: brpc-port
          volumeMounts:
              #Mount the configuration file in the way of configmap
            - name: conf
              mountPath: /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: sys
              mountPath: /etc/pki
              # 修改点3: 挂载存储
              subPath: pki
              readOnly: true
              # 同修改点3
            - name: sys
              mountPath: /opt/apache-doris/be/storage
              subPath: storage
      volumes:
        - name: conf
          configMap:
            name: be-conf
        - name: sys
        # 修改点4:不使用hostpath,注释掉
            #hostPath:
            #path: /etc/pki
  # 修改点5: 增加存储配置,此处使用longhorn
  volumeClaimTemplates:
  - metadata:
      name: sys
    spec:
      storageClassName: longhorn
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 50Gi 
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: be-conf
data:
  be.conf: |
    PPROF_TMPDIR="$DORIS_HOME/log/"
    sys_log_level = INFO

    be_port = 9060
    webserver_port = 8040
    heartbeat_service_port = 9050
    brpc_port = 8060

    # 修改点6: 修改网段为k8s使用网段,配置数据存储路径
    priority_networks = 10.42.0.0/16
    storage_root_path = /opt/apache-doris/be/storage
4. 根据服务器环境,修改doris_follower.yml文件
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

apiVersion: v1
kind: Service
metadata:
  name: doris-follower-cluster1
  labels:
    app: doris-follower-cluster1
spec:
  ports:
    - port: 8030
      name: http-port
    - port: 9020
      name: rpc-port
    - port: 9030
      name: query-port
    - port: 9010
      name: edit-log-port #This name should be fixed. Doris will get the port information through this name
  clusterIP: None
  selector:
    app: doris-follower-cluster1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: doris-follower-cluster1
  labels:
    app: doris-follower-cluster1
spec:
  selector:
    matchLabels:
      app: doris-follower-cluster1
  serviceName: doris-follower-cluster1
  # 修改点1: 修改fe副本为1
  replicas: 1
  template:
    metadata:
      name: doris-follower-cluster1
      labels:
        app: doris-follower-cluster1
    spec:
      containers:
        - name: doris-follower-cluster1
          #Need to change to real mirror information
          # 修改点2: 镜像地址修改为真实doris镜像,可在https://hub.docker.com/r/apache/doris/tags找到需要的镜像版本
          image: apache/doris:2.0.0_alpha-fe-x86_64
          imagePullPolicy: IfNotPresent
          env:
            # 修改点3: 增加了APP_NAMESPACE与FE_IPADDRESS环境变量
            - name: APP_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: FE_IPADDRESS
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            #Specify the startup type as k8s to bypass some restrictions of the official image initialization script
            - name: BUILD_TYPE
              value: "k8s"
            #Initialize the fe of three nodes
            - name: FE_INIT_NUMBER
            # 修改点4: 将数量改为1
              value: "1"
            #ServiceName of bakend_cn node,(if do not have bakend_cn node,do not configure this environment variable)
            # 修改点5: 不使用cn节点,注释变量CN_SERVICE  CN_STATEFULSET
            #- name: CN_SERVICE
            #  value: "doris-cn-cluster1"
            #StatefulSetName of bakend_cn node,(if do not have bakend_cn node,do not configure this environment variable)
            #- name: CN_STATEFULSET
            #  value: "doris-cn-cluster1"
            #ServiceName of bakend node,(if do not have bakend node,do not configure this environment variable)
            - name: BE_SERVICE
              value: "doris-be-cluster1"
            #StatefulSetName of bakend node,(if do not have bakend node,do not configure this environment variable)
            - name: BE_STATEFULSET
              value: "doris-be-cluster1"
            #ServiceName of follower node,(if do not have follower node,do not configure this environment variable)
            - name: FE_SERVICE
              value: "doris-follower-cluster1"
            ##StatefulSetName of follower node,(if do not have follower node,do not configure this environment variable)
            - name: FE_STATEFULSET
              value: "doris-follower-cluster1"
          ports:
            - containerPort: 8030
              name: http-port
            - containerPort: 9020
              name: rpc-port
            - containerPort: 9030
              name: query-port
            - containerPort: 9010
              name: edit-log-port
          volumeMounts:
            #Mount the configuration file in the way of configmap
            - name: conf
              mountPath: /opt/apache-doris/fe/conf
              #In order to call the api of k8s
            - name: kube
            # 使用本地配置则为/root/.kube/config
              mountPath: /root/.kube
              readOnly: true
            # 修改点6: 配置存储,用于元数据持久化
            - name: metadata
              mountPath: /opt/apache-doris/fe/doris-meta
      volumes:
        - name: conf
          configMap:
            name: follower-conf
        - name: kube
        # 修改点7: 修改为使用configMap(此处可以不修改,使用本地配置)
          #hostPath:
            #path: /root/.kube/config
          configMap:
            name: kube-conf
  # 修改点8: 增加存储配置,此处使用longhorn
  volumeClaimTemplates:
  - metadata:
      name: metadata
    spec:
      storageClassName: longhorn
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 10Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: follower-conf
data:
  fe.conf: |
    # 修改点9: 修改网段为k8s使用网段
    priority_networks = 10.42.0.0/16
    #It can automatically maintain node information by getting the number of replicas of StatefulSet, similar to alter system add/drop back
    enable_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 = true
    LOG_DIR = ${DORIS_HOME}/log
    sys_log_level = INFO
    http_port = 8030
    rpc_port = 9020
    query_port = 9030
    edit_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 location
    custom_config_dir = /opt/apache-doris/
    #when set to false, the backend will not be dropped and remaining in DECOMMISSION state
    drop_backend_after_decommission = false
    # 修改点10: 增加元数据、java等配置
    mysql_service_nio_enabled = true
    JAVA_OPTS = "-Xmx8192m -XX:+UseMembar -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=7 -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -Xloggc:$DORIS_HOME/log/fe.gc.log.$DATE"
    JAVA_OPTS_FOR_JDK_9 = "-Xmx8192m -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=7 -XX:+CMSClassUnloadingEnabled -XX:-CMSParalle=80 -XX:SoftRefLRUPolicyMSPerMB=0 -Xlog:gc*:$DORIS_HOME/log/fe.gc.log.$DATE:time"
    meta_dir = /opt/apache-doris/fe/doris-meta
    #metadata_failure_recovery = true
---
# 修改点11: 增加kube config的configmap(此处可不修改,直接使用本地节点配置)
apiVersion: v1
kind: ConfigMap
metadata:
  name: kube-conf
data:
  config: |
    # 此处内容复制配置文件内容,如果server地址指向的为127.0.0.1,注意修改为实际节点IP
    # 一般为 /root/.kube/config 内容, rancher安装的rke2环境默认为/etc/rancher/rke2/rke2.yaml
5. 创建服务用于外部连接doris-svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: doris-svc
  namespace: doris
spec:
  type: NodePort
  ports:
    - port: 8030
      nodePort: 30803
      name: "p8030"
    - port: 9030
      nodePort: 30903
      name: "p9030"
  selector:
    app: doris-follower-cluster1
6. 部署
kubectl create ns doris
kubectl apply -f doris_be.yml -n doris
kubectl apply -f doris_follower.yml -n doris
kubectl apply -f doris-svc.yaml -n doris
7. 访问及使用, 默认账号为root,无密码
# web端访问地址
http://[节点IP]:30803/login

# 使用mysql client连接地址
host: [节点IP]
port: 30903
user: root
pass: 

# 使用mysql client连接后可修改root密码
SET PASSWORD FOR 'root' = PASSWORD('your_password');

在这里插入图片描述
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/696317.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

深度学习编译器对比:The Deep Learning Compiler A Comprehensive Survey

参考:The Deep Learning Compiler: A Comprehensive Survey 记录几种深度学习编译器的功能和性能的对比; TVM在CPU和GPU的表现最好; MobileNet:TVM在conv、linear、expand表现最好;XLA在dewise的表现最好;

赛效:如何在线做图表

1:打开并登录图表秀,点击“我的模板”菜单里的“新建图表”。 2:根据自己的需要,在右侧的模板里选择一个。图表编辑区域里,会自动出现刚才点击的图表。 3:我们可以直接在右侧区域里编辑图标属性&#xff0c…

用户实操 | GBase 8a MPP Cluster慢SQL分析排查和优化方法

本期供稿 | 中国农业银行研发中心 蔡鹍鹏 01 排查和优化方法 SQL任务历史性能对比分析: 通过开启GBase 8a的audit_log审计日志,可以连续收集周期性任务的执行时间,通过对比相同SQL任务历史执行时长可以判定相同任务SQL长周期内的执行耗时趋…

【Java】如何在 Java 中连接字符串

本文仅供学习参考! 字符串连接可以定义为将两个或多个字符串连接在一起以形成新字符串的过程。大多数编程语言至少提供一种连接字符串的方法。Java 为您提供了多种选择,包括: ****运算符**String.concat()**方法StringBuilder类StringBuffer…

LeetCode·每日一题·1186. 删除一次得到子数组最大和·动态规划

作者:小迅 链接:https://leetcode.cn/problems/maximum-subarray-sum-with-one-deletion/solutions/2321919/dong-tai-gui-hua-zhu-shi-chao-ji-xiang-x-cwvs/ 来源:力扣(LeetCode) 著作权归作者所有。商业转载请联系作…

XILINX 7系列FPGA Dedicated Configuration Bank功能详解

🏡《Xilinx FPGA开发指南》 目录 1,概述2,功能详解2.1,DXP_0与DXN_02.2,VCCBATT_02.3,INIT_B_02.4,M0_0,M1_0,M2_02.5,TDI,TDO,TMS,TCK2.6, VCCAD…

【Unity开发小技巧】UnityWebGL打包本地浏览器运行查看

目录 一.前言: 二.WebGL打包 三.配置web.config(重要) 四.部署IIS 五.测试 一.前言: 正常打包WebGL后在浏览器直接运行会报以下这个错: It seems your browser does not support running Unity WebGL content fr…

【效率工具】Windows 10 终端自动补全、智能提示

1. 安装PSReadLine 2.1.0 Install-Module PSReadLine -RequiredVersion 2.1.02. 检查是否存在配置文件 Test-path $profile创建配置文件(不存在的话) New-item –type file –force $profile3. 编辑配置文件 notepad $profile4. 运行该指令后退出终端…

rancher-import-k8s集群

一、 二、 三、 四、 到k8s 节点服务器上执行: 其实在:https://192.168.31.105:8443/v3/import/fgmt2r88wn4xvkm9n88gnshhhb8l976n6rpdvgz79r6rsfhlljnsxn_c-m-kq6c2fvn.yaml 里面下载了镜像 我们可以先下载镜像: docker pull rancher/ranc…

CSDN-AI小组2023-半年-研发总结

目录 1.丐版「大模型」,Proof of concept2. LLM和AIGC的各种综述3. 基于Embedding的应用,问答,AI编程4. 评论区的AI助手5. 结合AIGC的各种数据自动计算6. 个性化推荐的系统重构7. 基于AIGC的个性化博客创作鼓励8. 博客质量分V5: 可解释性计算…

java基础之super

当父类拥有一个带参的构造方法时,子类要有一个带有相同类型参数的构造方法,并且第一行使用super(参数)来接受,否则会报错 上图是一个类 Two,拥有一个带String类型参数的构造方法。 上图是一个类One&#x…

Java数字图像处理教程

地址 Java DIP - GrayScale转换为了将彩色图像转换为灰度图像,您需要使用File和ImageIO对象读取图像的像素或数据,并将图像存储在BufferedImage对象中。其语法如下: File input new File("digital_image_processing.jpg"); Buffe…

PHP --- 登录界面构建与mysql交互

登录界面构建与mysql交互 环境准备 win2003server phpstudy2016 vscode &#xff08;1&#xff09;login.html 利用input表单就可构建简单登录界面<fieldset>标签&#xff1a;框住标签内容<legend>标签&#xff1a;为filedset标签添加标题<label>标签&am…

UE5.1.1 C++从0开始(15.作业4个人作业分享)

教程链接&#xff1a;https://www.bilibili.com/video/BV1nU4y1X7iQ 好吧这个作业应该是之前写的&#xff0c;但是我发现我没写&#xff0c;后面我又回去自己写了一遍再看代码&#xff0c;感觉上大差不差&#xff0c;各位可以看着我的和老师的还有自己的对比下。 SBTService_…

display:flex的用法

flex: 元素以弹性布局方式显示&#xff0c;可以通过设置父元素的 display: flex 属性来实现子元素的弹性布局。常用于实现响应式布局和灵活的元素排列。 当使用 display: flex; 将元素容器设置为弹性布局时&#xff0c;子元素会自动填充容器&#xff0c;并根据容器的宽度进行调…

python实现磨皮效果

主要是借鉴了这个文章&#xff0c;写的非常棒&#xff0c;会比直接使用保边滤波好很多&#xff0c;能够高保真&#xff0c;不会糊掉。 我使用python简单的实现了一下&#xff0c;看起来还不错 import time import numpy as np import cv2def mopi(src):high_pass src.copy()…

【Docker】Docker运行时间长,空间不足no space left on device: unknown

空间不足no space left on device: unknown问题解决 1.执行出错2.解决方法3.dump文件是否可以删除 1.执行出错 在运行 docker restart 容器Id查看磁盘空间占用 df -h2.解决方法 这个问题是由与 /run 的空间使用完了&#xff0c;清理/run的空间,经过查找使用最大的是 /run/u…

Linux 情景分析

系列文章目录 Linux 内核设计与实现 深入理解 Linux 内核 Linux 设备驱动程序 Linux设备驱动开发详解 深入理解Linux虚拟内存管理 Linux 情景分析 文章目录 系列文章目录一、存储管理1、外部设备存储空间的地址映射&#xff08;1&#xff09;ioremap&#xff08;2&#xff09;g…

力扣 513. 找树左下角的值

题目来源&#xff1a;https://leetcode.cn/problems/find-bottom-left-tree-value/description/ C题解1&#xff1a;是寻找最底层最左边的节点&#xff0c;不是最底层的左子树节点&#xff01; &#xff01; 使用层序遍历&#xff0c;判断左右子树是不是叶子节点&#xff0c;进…

snmp_exporter监控交换机网络流量

一.背景与需求 最近收到机房账单多出了将近70M下行带宽&#xff0c;多交了8K多的费用&#xff0c;很是蛋疼。IDC机房使用每月保底带宽模式, 例如保底100M带宽/月&#xff0c;如果利用955计费方式&#xff0c;没超出100M则只收机柜和保底带宽的费用&#xff0c;如果超出1M则按照…