doris on k8s 的安装部署

这篇具有很好参考价值的文章主要介绍了doris on k8s 的安装部署。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

官方已更新Operator部署方式,最新部署方式参考 官方文档

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

doris on k8s 的安装部署,k8s,kubernetes,容器,云原生,doris

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');

doris on k8s 的安装部署,k8s,kubernetes,容器,云原生,doris
doris on k8s 的安装部署,k8s,kubernetes,容器,云原生,doris文章来源地址https://www.toymoban.com/news/detail-612495.html

到了这里,关于doris on k8s 的安装部署的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【云原生、k8s】管理Kubernetes应用搭建与部署

    官方提供Kubernetes部署3种方式 (一)minikube Minikube是一个工具,可以在本地快速运行一个单点的Kubernetes,尝试Kubernetes或日常开发的用户使用。不能用于生产环境。 官方文档:https://kubernetes.io/docs/setup/minikube/ (二)二进制包 从官方下载发行版的二进制包,手动部署每个组件,

    2024年01月21日
    浏览(50)
  • 云原生Kubernetes:简化K8S应用部署工具Helm

    目录 一、理论 1.HELM ​编辑 2.部署HELM2 3.部署HELM3(2to3方式) 4.部署HELM3(单独安装) 二、实验 1.部署 HELM2 2.部署HELM3(2to3方式) 3.部署HELM3(单独安装) 三、问题 1.api版本过期 2.helm初始化报错 3.pod状态为ImagePullBackOff 4.helm 命令显示 no repositories to show 的错误 5.Helm安装报错

    2024年02月07日
    浏览(45)
  • 云原生Kubernetes: K8S 1.29版本 部署Jenkins

    目录  一、实验 1.环境 2.K8S 1.29版本 部署Jenkins 服务 3.jenkins安装Kubernetes插件 二、问题 1.创建pod失败 2.journalctl如何查看日志信息 2.容器内如何查询jenkins初始密码 3.jenkins离线安装中文包报错 4.jenkins插件报错 (1)主机 表1 主机 主机 架构 版本 IP 备注 master K8S master节点 1.29.0 1

    2024年04月25日
    浏览(41)
  • 云原生Kubernetes:Kubeadm部署K8S单Master架构

    目录 一、理论 1.kubeadm 2.Kubeadm部署K8S单Master架构 3.环境部署 4.所有节点安装docker 5.所有节点安装kubeadm,kubelet和kubectl 6.部署K8S集群 7.安装dashboard 8.安装Harbor私有仓库 9.内核参数优化方案 二、实验 1.Kubeadm部署K8S单Master架构 2. 部署流程  3.环境部署 4.所有节点安装docker 5.所有节

    2024年02月10日
    浏览(41)
  • 云上攻防-云原生篇&Kubernetes&K8s安全&API&Kubelet未授权访问&容器执行

    Kubernetes是一个开源的, 用于编排云平台中多个主机上的容器化的应用,目标是让部署容器化的应用能简单并且高效的使用, 提供了应用部署,规划,更新,维护的一种机制 。其核心的特点就是能够自主的管理容器来保证云平台中的容器按照用户的期望状态运行着,管理员可

    2024年02月08日
    浏览(58)
  • 这篇 DolphinScheduler on k8s 云原生部署实践,值得所有大数据人看!

    在当前快速发展的技术格局中,企业寻求创新解决方案来简化运营并提高效率成为一种趋势。 Apache DolphinScheduler作为一个强大的工具,允许跨分布式系统进行复杂的工作流任务调度。本文将深入探讨如何将Apache DolphinScheduler适配并整合进现代IT环境,提升其在云原生部署中的表

    2024年04月17日
    浏览(28)
  • 云原生Kubernetes:二进制部署K8S单Master架构(一)

    目录 一、理论 1.K8S单Master架构 2.  etcd 集群 3.CNI 4.Flannel网络 5.K8S单Master架构环境部署 6.部署 etcd 集群 7.部署 docker 引擎 8.flannel网络配置 二、实验 1.二进制部署K8S单Master架构 2. 环境部署 3.部署 etcd 集群 4.部署 docker 引擎 5.flannel网络配置 三、问题 1.etcd 报错 2.安装etcd问题 3.系

    2024年02月10日
    浏览(36)
  • 云原生Kubernetes:二进制部署K8S单Master架构(二)

    目录  一、理论 1.K8S单Master架构 2.部署 master 组件 3.部署 Woker Node 组件 4.在master1节点上操作 5.在 node01 节点上操作 6.在 master01 节点上操作  7.在 node01 节点上操作 8.node02 节点部署(方法一) 二、实验 1.环境  2.部署 master 组件 3.部署 Woker Node 组件 4.在master1节点上操作 5.在 nod

    2024年02月10日
    浏览(28)
  • 【云原生 | Kubernetes 系列】K8s 实战 如何给应用注入数据 II 将pod数据传递给容器

    在上一篇文章中,我们学习了针对容器设置启动时要执行的命令和参数、定义相互依赖的环境变量、为容器设置环境变量,三种设置方式,本篇文章,我们将继续学习数据的传递。 有两种方式可以将 Pod 和 Container 字段传递给运行中的容器: 环境变量 卷文件 这两种呈现 Pod

    2024年01月25日
    浏览(70)
  • 【云原生 | Kubernetes 系列】—K8S部署RocketMQ集群(双主双从+同步模式)

    rocketMQ高可用有很多种方式,比如:单机部署,多主集群,双主双从同步部署,双主双从异步部署,以及多主多从部署。部署集群可按照自己公司的实际情况进行部署。 单机部署:只启动一个rocketMQ实例就可以了,一般常用来本机测试使用。原因:一旦rocketMQ因某些原因挂掉,

    2024年02月04日
    浏览(40)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包