docker-compose启动StartRocks

services:
  minio:
    container_name: minio
    environment:
      MINIO_ROOT_USER: miniouser
      MINIO_ROOT_PASSWORD: miniopassword
    image: minio/minio:latest
    ports:
      - "9001:9001"
      - "9000:9000"
    entrypoint: sh
    command: '-c ''mkdir -p /minio_data/starrocks && minio server /minio_data --console-address ":9001"'''
    healthcheck:
      test: ["CMD", "mc", "ready", "local"]
      interval: 5s
      timeout: 5s
      retries: 5

  minio_mc:
    # This service is short lived, it does this:
    # - starts up
    # - checks to see if the MinIO service `minio` is ready
    # - creates a MinIO Access Key that the StarRocks services will use
    # - exits
    image: minio/mc:latest
    entrypoint:
      - sh
      - -c
      - |
        until mc ls minio > /dev/null 2>&1; do
          sleep 0.5
        done

        mc alias set myminio http://minio:9000 miniouser miniopassword
        mc admin user svcacct add --access-key AAAAAAAAAAAAAAAAAAAA \
        --secret-key BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB \
        myminio \
        miniouser
    depends_on:
        minio:
          condition: service_healthy

  starrocks-fe:
    image: starrocks/fe-ubuntu:3.3-latest
    hostname: starrocks-fe
    container_name: starrocks-fe
    user: root
    command:
      - /bin/bash
      - -c
      - |
        echo "# enable shared data, set storage type, set endpoint" >> /opt/starrocks/fe/conf/fe.conf
        echo "run_mode = shared_data" >> /opt/starrocks/fe/conf/fe.conf
        echo "cloud_native_storage_type = S3" >> /opt/starrocks/fe/conf/fe.conf
        echo "aws_s3_endpoint = minio:9000" >> /opt/starrocks/fe/conf/fe.conf

        echo "# set the path in MinIO" >> /opt/starrocks/fe/conf/fe.conf
        echo "aws_s3_path = starrocks" >> /opt/starrocks/fe/conf/fe.conf

        echo "# credentials for MinIO object read/write" >> /opt/starrocks/fe/conf/fe.conf
        echo "aws_s3_access_key = AAAAAAAAAAAAAAAAAAAA" >> /opt/starrocks/fe/conf/fe.conf
        echo "aws_s3_secret_key = BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" >> /opt/starrocks/fe/conf/fe.conf
        echo "aws_s3_use_instance_profile = false" >> /opt/starrocks/fe/conf/fe.conf
        echo "aws_s3_use_aws_sdk_default_behavior = false" >> /opt/starrocks/fe/conf/fe.conf

        echo "# Set this to false if you do not want default" >> /opt/starrocks/fe/conf/fe.conf
        echo "# storage created in the object storage using" >> /opt/starrocks/fe/conf/fe.conf
        echo "# the details provided above" >> /opt/starrocks/fe/conf/fe.conf
        echo "enable_load_volume_from_conf = true" >> /opt/starrocks/fe/conf/fe.conf

        /opt/starrocks/fe/bin/start_fe.sh --host_type FQDN
    ports:
      - 8030:8030
      - 9020:9020
      - 9030:9030
      - 9010:9010
      - 6090:6090
    healthcheck:
      test: 'mysql -u root -h starrocks-fe -P 9030 -e "show frontends\G" |grep "Alive: true"'
      interval: 10s
      timeout: 5s
      retries: 3
    depends_on:
        minio:
            condition: service_healthy

  starrocks-cn:
    image: starrocks/cn-ubuntu:3.3-latest
    command:
      - /bin/bash
      - -c
      - |
        sleep 15s;
        ulimit -u 65535;
        ulimit -n 65535;
        mysql --connect-timeout 2 -h starrocks-fe -P9030 -uroot -e "ALTER SYSTEM ADD COMPUTE NODE \"starrocks-cn:9050\";"
        /opt/starrocks/cn/bin/start_cn.sh
    environment:
      - HOST_TYPE=FQDN
    ports:
      - 9060:9060
      - 8040:8040
      - 9050:9050
      - 8060:8060
      - 9070:9070
    hostname: starrocks-cn
    container_name: starrocks-cn
    user: root
    depends_on:
      starrocks-fe:
        condition: service_healthy
        restart: true
      minio:
        condition: service_healthy
    healthcheck:
      test: 'mysql -u root -h starrocks-fe -P 9030 -e "SHOW COMPUTE NODES\G" |grep "Alive: true"'
      interval: 10s
      timeout: 5s
      retries: 3
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值