8

基于Ansible实现Apache Doris快速部署运维指南 - 张家锋

 2 years ago
source link: https://www.cnblogs.com/hf200012/p/16171216.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Doris Ansible 使用指南

Apache Doris 介绍

Apache Doris是一个现代化的MPP分析型数据库产品。仅需亚秒级响应时间即可获得查询结果,有效地支持实时数据分析。Apache Doris的分布式架构非常简洁,易于运维,并且可以支持10PB以上的超大数据集。

Apache Doris可以满足多种数据分析需求,例如固定历史报表,实时数据分析,交互式数据分析和探索式数据分析等。令您的数据分析工作更加简单高效!

Doris Ansible简介

​ Doris_ansible是基于ansible构建的Doris高可用集群轻量化自动运维工具,它能够在本地方便快捷的一键拉起Doris高可用集群,并且集群的启停、升降级、扩缩容都可以通过一条简单的命令来实现,使用户可以将注意力专注于Doris强大的分析能力,而不用在运维上面耗费心力。后续将会增加更多使用者关注的自动化功能。如监控、运维巡检等一系列功能。

Doris Ansible使用步骤

1. 安装ansible

yum install -y ansible

2. 下载Doris_Ansible

git clone https://github.com/mklzl/doris_ansible

3. 集群规划(无需配置,仅作参考)

# fe
master : 192.168.1.241
follower1: 192.168.1.239
follower2: 192.168.2.243

# be
backend1: 192.168.1.239
backend2: 192.168.1.241
backend3: 192.168.1.243

# broker
broker1: 192.168.1.239
broker2: 192.168.1.241
broker3: 192.168.1.243

# 安装版本及软件包所在位置
/home/doris_ansible/PALO-0.15.1-rc09-binary.tar.gz

# 安装目录
/home/doris_ansible

# 升降级软件包所在路径
/home/doris_ansible/PALO-0.15.3-
release-binary.tar.gz

1. 配置集群初始化配置

  • 分配集群角色hosts

    vi /etc/ansible/hosts(cluster1为对应Doris集群的集群id,这里可以部署多个不同的集群配置,启动时,指定对应的集群ID即可操作对应的集群)

      ## 集群cluster1中参与的机器ip
      [cluster1.doris_hosts]
      192.168.1.239
      192.168.1.241
      192.168.1.243
    
      ##集群cluster1中fe所在机器的ip
      [cluster1.frontends]
      192.168.1.239
      192.168.1.241
      192.168.1.243
    
      ##集群cluster1中master节点所在的ip
      [cluster1.master]
      192.168.1.241
    
      ##集群cluster1中follower所在节点的ip
      [cluster1.follower]
      192.168.1.239
      192.168.1.243
    
      ##集群cluster1中be所在节点的ip
      [cluster1.backends]
      192.168.1.239
      192.168.1.241
      192.168.1.243
      
      ## 要进行扩缩容的fe所在的ip
      [cluster1.scale_fe]
      192.168.1.239
    
      ## 要进行扩缩容的be所在的ip
      [cluster1.scale_be]
      192.168.1.239
       
      ## 要进行扩缩容的broker所在的ip
      [cluster1.scale_broker]
      192.168.1.239
    
      ##集群cluster1中broker节点所在的ip
      [cluster1.brokers]
      192.168.1.239
      192.168.1.241
      192.168.1.243
    
  • 配置初始化文件

    vi ./conf/cluster1.yml(这里配置集群cluster1的对应ip组)
    
    ---
    follower: [192.168.1.239,192.168.1.243]
    backends: [192.168.1.239,192.168.1.241,192.168.1.243]
    brokers: [192.168.1.239,192.168.1.241,192.168.1.243]
    master: 192.168.1.241
    
    vi ./conf/setup_vars.yml
    ---
    # 生产环境的fe.conf所在路径。
    # 如果没有特殊配置,建议使用安装包内的fe.conf,请根据机器情况酌情配置priority_networks
    fe_conf_path: /home/doris_ansible/fe.conf
    
    #生产环境的be.conf所在路径。
    # 如果没有特殊配置,建议使用安装包内的be.conf,请根据机器情况酌情配置priority_networks
    be_conf_path: /home/doris_ansible/be.conf
    
    # heartbeat_service_port,请和be.conf中的heartbeat_service_port配置保持一致
    heartbeat_service_port: 9050
    
    
    # edit_log_port,请和fe.conf中的edit_log_port配置保持一致
    edit_log_port: 9010
    
    # query_port,请和fe.conf中的query_port配置保持一致
    query_port: 9030
    
    # broker_ipc_port,请和apache_hdfs_broker.conf中的broker_ipc_port保持一致
    broker_ipc_port: 8000
    
    # 待安装的doris压缩包所在路径,请写绝对路径
    doris_filepath: /home/doris_ansible/PALO-0.15.1-rc09-binary.tar.gz
    
    # doris压缩包要解压安装的位置
    dest_filepath: /home/doris_ansible
    
    #解压后,doris的安装目录
    doris_home: /home/doris_ansible/PALO-0.15.1-rc09-binary
    
    # 机器java_home所在路径,请确保所有机器保持一致
    java_home: /usr/java/jdk1.8.0_131
    
    
    

2. 初始化集群

#cluster=cluster1 是指定的对对应集群的操作
ansible-playbook -e "cluster=cluster1" ./core/setup.yml 

3. 添加角色

ansible-playbook -e "cluster=cluster1" ./core/add_roles.yml

4. 启停集群

#一键停止对应集群
ansible-playbook -e "cluster=cluster1" ./core/stop_all.yml

#一键启动对应集群
ansible-playbook -e "cluster=cluster1" ./core/start_all.yml

5. 集群升降级

  • 配置集群升降级配置

    vi ./conf/upgrade_vars.yml
    ---
    #需要回滚或者升级的压缩包所在路径
    newdoris_filepath: /home/doris_ansible/PALO-0.15.3-release-binary.tar.gz
    
    #压缩包解压路径
    newdoris_destpath: /home/doris_ansible
    
    #解压后的doirs_home
    newdoris_home: /home/doris_ansible/PALO-0.15.3-release-binary
    
    #java_home所在路径
    java_home: /usr/java/jdk1.8.0_131
    
  • 进行升降级操作

    ansible-playbook -e "cluster=cluster1" ./core/upgrade.yml
    

6. 集群扩缩容

  1. 配置集群扩缩容配置
vi /etc/ansible/hosts  (配置要进行扩缩容的角色的hosts,可以配置多个hosts)
## 要进行扩缩容的fe所在的ip
  [cluster1.scale_fe]
  192.168.1.239

  ## 要进行扩缩容的be所在的ip
  [cluster1.scale_be]
  192.168.1.239
   
  ## 要进行扩缩容的broker所在的ip
  [cluster1.scale_broker]
  192.168.1.239
  1. FE 扩缩容
  vi ./conf/scale_fe_vars.yml
  ---
  ## 要进行扩缩容的fe
  frontends: 192.168.1.239
  
  ##(多个ip使用数组的方式)
  frontends: [192.168.1.239,192.168.1.241]
  1. BE 扩缩容
 vi ./conf/scale_be_vars.yml
 ---
  ## 要进行扩缩容的be
  backends: 192.168.1.239
  
  ##(多个ip使用数组的方式)
  backends: [192.168.1.239,192.168.1.241]
  1. Broker 扩缩容
  vi ./conf/scale_broker_vars.yml
  ---
  ## 要进行扩缩容的broker
  brokers: 192.168.1.239
  
  ##(多个ip使用数组的方式)
  brokers: [192.168.1.239,192.168.1.241]
  1. 执行扩缩容
# 扩容
  # 扩容broker
  	ansible-playbook -e "cluster=cluster1 action=out" ./core/scale_broker.yml
  # 扩容be
  	ansible-playbook -e "cluster=cluster1 action=out" ./core/scale_be.yml
  # 扩容fe
  	ansible-playbook -e "cluster=cluster1 action=out" ./core/scale_fe.yml
# 缩容
  #缩容broker
    ansible-playbook -e "cluster=cluster1 action=out" ./core/scale_broker.yml
  #缩容be
    ansible-playbook -e "cluster=cluster1 action=out" ./core/scale_be.yml
  #缩容fe
    ansible-playbook -e "cluster=cluster1 action=out" ./core/scale_fe.yml

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK