服务器问题

云服务器怎样部署Doris分析型数据库

一、环境准备

1. 系统配置

  1. bash
    # 系统参数优化
    cat >>/etc/sysctl.conf << EOF
    vm.swappiness =0
    vm.max_map_count =2000000
    net.core.somaxconn =65535
    EOF

    sysctl -p

    # 修改系统限制
    cat >>/etc/security/limits.conf << EOF
    * soft nofile 65535
    * hard nofile 65535
    * soft nproc 65535
    * hard nproc 65535
    EOF

2. 依赖安装

  1. bash
    # 安装必要依赖
    apt update
    apt install -y \
        mysql-client \
        gcc \
        cmake \
        byacc \
        flex \
        automake \
        libtool \
        binutils-dev \
        libiberty-dev \
        bison \
        python

二、Doris安装

1. 编译安装

  1. bash
    # 下载源码
    git clone https://github.com/apache/doris.git
    cd doris

    # 编译
    ./build.sh

2. 目录配置

  1. bash
    # 创建必要目录
    mkdir -/opt/doris/fe/meta
    mkdir -/opt/doris/be/storage
    mkdir -/opt/doris/fe/log
    mkdir -/opt/doris/be/log

    # 设置权限
    chown -R doris:doris /opt/doris

三、FE节点配置

1. FE配置文件

  1. properties
    # fe.conf
    JAVA_OPTS="-Xmx8192m -XX:+UseG1GC"
    meta_dir =/opt/doris/fe/meta
    http_port =8030
    rpc_port =9020
    query_port =9030
    edit_log_port =9010

2. 启动FE

  1. bash
    # 启动FE节点
    bin/start_fe.sh --daemon

    # 检查启动状态
    curl http://localhost:8030/api/bootstrap

四、BE节点配置

1. BE配置文件

  1. properties
    # be.conf
    PPROF_TMPDIR="/tmp"
    BE_LOG_DIR =/opt/doris/be/log
    storage_root_path =/opt/doris/be/storage
    default_rowset_type = BETA
    write_buffer_size =134217728
    max_tablet_num_per_shard =1024

2. BE节点部署

  1. bash
    # 启动BE节点
    bin/start_be.sh --daemon

    # 添加BE节点到集群
    mysql -127.0.0.1-9030-u root
    > ALTER SYSTEM ADD BACKEND "host:port";

五、集群管理

1. 节点管理

  1. sql
    --查看节点状态
    SHOW PROC '/backends';

    --下线BE节点
    ALTER SYSTEM DECOMMISSION BACKEND "host:port";

2. 表管理

  1. sql
    --创建数据库
    CREATE DATABASE example_db;

    --创建表
    CREATE TABLE example_tbl (
        id BIGINT,
        name VARCHAR(32),
        score DECIMAL(10,2)
    )
    DISTRIBUTED BY HASH(id) BUCKETS 10
    PROPERTIES (
    "replication_num"="3"
    );

六、性能优化

1. 内存配置

  1. properties
    # fe.conf内存优化
    heap_size =8192
    write_buffer_size =134217728

    # be.conf内存优化
    chunk_reserved_bytes_limit =2147483648
    max_compaction_concurrency =4

2. 查询优化

  1. sql
    --设置查询超时时间
    SET query_timeout =3600;

    --并行度设置
    SET parallel_fragment_exec_instance_num =8;

七、监控配置

1. 监控指标

  1. yaml
    # prometheus.yml
    scrape_configs:
    - job_name:'doris_fe'
        static_configs:
    - targets:['localhost:8030']
    - job_name:'doris_be'
        static_configs:
    - targets:['localhost:8040']

2. 告警配置

  1. yaml
    # alert.rules
    groups:
    - name: doris_alerts
      rules:
    - alert:DorisNodeDown
        expr: up ==0
    for:5m
        labels:
          severity: critical



免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:bkook@qq.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
上一篇:Nginx启动不了的原因及解决方法
下一篇:云服务器怎样搭建GitLab-CI持续集成环境
0

在线
客服

在线客服服务时间:9:00-18:00

客服
热线

19899115815
7*24小时客服服务热线

关注
微信

关注官方微信
顶部