docker 搭建iotdb集群2版本的

1、如果之前存在network网络需要清理一下

复制代码
docker-compose down -v --remove-orphans

2、新建目录

复制代码
mkdir -p /home/iotdb/confignode/data
mkdir -p /home/iotdb/confignode/logs
mkdir -p /home/iotdb/datanode/data
mkdir -p /home/iotdb/datanode/logs

3、三台机器分别建立docker-compose-standalone.yml文件

3.1 第一台

复制代码
version: "3"
services:
    iotdb-confignode:
        image: apache/iotdb:2.0.6-confignode  
        container_name: iotdb-confignode
        command: ["bash", "-c", "entrypoint.sh confignode"]
        restart: always
        environment:
            - cn_internal_address=10.1.19.191 
            - cn_internal_port=10710
            - cn_consensus_port=10720
            - cn_seed_config_node=10.1.19.191:10710   
            - schema_replication_factor=3         
            - data_replication_factor=2          
        privileged: true
        volumes:
            - /home/iotdb/confignode/data:/iotdb/data
            - /home/iotdb/confignode/logs:/iotdb/logs
        network_mode: "host" 

    iotdb-datanode:
        image: apache/iotdb:2.0.6-datanode
        container_name: iotdb-datanode
        command: ["bash", "-c", "entrypoint.sh datanode"]
        restart: always
        ports:
          - "6667:6667"
        privileged: true
        environment:
          - dn_rpc_address=10.1.19.191 
          - dn_internal_address=10.1.19.191 
          - dn_seed_config_node=10.1.19.191:10710      
          - dn_rpc_port=6667
          - dn_internal_port=10730
          - dn_mpp_data_exchange_port=10740
          - dn_schema_region_consensus_port=10750
          - dn_data_region_consensus_port=10760
          - schema_replication_factor=3        
          - data_replication_factor=2           
        volumes:
          - /home/iotdb/datanode/data:/iotdb/data
          - /home/iotdb/datanode/logs:/iotdb/logs
        network_mode: "host"  

3.2 第二台

复制代码
version: "3"
services:
  iotdb-confignode:
    image: apache/iotdb:2.0.6-confignode  
    container_name: iotdb-confignode
    command: ["bash", "-c", "entrypoint.sh confignode"]
    restart: always
    environment:
      - cn_internal_address=10.1.19.192 
      - cn_internal_port=10710
      - cn_consensus_port=10720
      - cn_seed_config_node=10.1.19.191:10710   
      - schema_replication_factor=3         
      - data_replication_factor=2          
    privileged: true
    volumes:
      - /home/iotdb/confignode/data:/iotdb/data
      - /home/iotdb/confignode/logs:/iotdb/logs
    network_mode: "host"  

  iotdb-datanode:
    image: apache/iotdb:2.0.6-datanode
    container_name: iotdb-datanode
    command: ["bash", "-c", "entrypoint.sh datanode"]
    restart: always
    ports:
      - "6667:6667"
    privileged: true
    environment:
      - dn_rpc_address=10.1.19.192 
      - dn_internal_address=10.1.19.192 
      - dn_seed_config_node=10.1.19.191:10710      
      - dn_rpc_port=6667
      - dn_internal_port=10731
      - dn_mpp_data_exchange_port=10741
      - dn_schema_region_consensus_port=10751
      - dn_data_region_consensus_port=10761
      - schema_replication_factor=3        
      - data_replication_factor=2           
    volumes:
      - /home/iotdb/datanode/data:/iotdb/data
      - /home/iotdb/datanode/logs:/iotdb/logs
    network_mode: "host" 

3.3 第三台

复制代码
version: "3"
services:
  iotdb-confignode:
    image: apache/iotdb:2.0.6-confignode  
    container_name: iotdb-confignode
    command: ["bash", "-c", "entrypoint.sh confignode"]
    restart: always
    environment:
      - cn_internal_address=10.1.19.193 
      - cn_internal_port=10710
      - cn_consensus_port=10720
      - cn_seed_config_node=10.1.19.191:10710   
      - schema_replication_factor=3         
      - data_replication_factor=2          
    privileged: true
    volumes:
      - /home/iotdb/confignode/data:/iotdb/data
      - /home/iotdb/confignode/logs:/iotdb/logs
    network_mode: "host"  

  iotdb-datanode:
    image: apache/iotdb:2.0.6-datanode
    container_name: iotdb-datanode
    command: ["bash", "-c", "entrypoint.sh datanode"]
    restart: always
    ports:
      - "6667:6667"
    privileged: true
    environment:
      - dn_rpc_address=10.1.19.193 
      - dn_internal_address=10.1.19.193 
      - dn_seed_config_node=10.1.19.191:10710      
      - dn_rpc_port=6667
      # 注意 下方配置不同虚机的端口需要不一样的
      - dn_internal_port=10732
      - dn_mpp_data_exchange_port=10742
      - dn_schema_region_consensus_port=10752
      - dn_data_region_consensus_port=10762
      - schema_replication_factor=3        
      - data_replication_factor=2           
    volumes:
      - /home/iotdb/datanode/data:/iotdb/data
      - /home/iotdb/datanode/logs:/iotdb/logs
    network_mode: "host"  

4、然后启动

复制代码
version: "3"
services:
  iotdb-confignode:
    image: apache/iotdb:2.0.6-confignode  
    container_name: iotdb-confignode
    command: ["bash", "-c", "entrypoint.sh confignode"]
    restart: always
    environment:
      - cn_internal_address=10.1.19.193 
      - cn_internal_port=10710
      - cn_consensus_port=10720
      - cn_seed_config_node=10.1.19.191:10710   
      - schema_replication_factor=3         
      - data_replication_factor=2          
    privileged: true
    volumes:
      - /home/iotdb/confignode/data:/iotdb/data
      - /home/iotdb/confignode/logs:/iotdb/logs
    network_mode: "host"  

  iotdb-datanode:
    image: apache/iotdb:2.0.6-datanode
    container_name: iotdb-datanode
    command: ["bash", "-c", "entrypoint.sh datanode"]
    restart: always
    ports:
      - "6667:6667"
    privileged: true
    environment:
      - dn_rpc_address=10.1.19.193 
      - dn_internal_address=10.1.19.193 
      - dn_seed_config_node=10.1.19.191:10710      
      - dn_rpc_port=6667
      # 注意 下方配置不同虚机的端口需要不一样的
      - dn_internal_port=10732
      - dn_mpp_data_exchange_port=10742
      - dn_schema_region_consensus_port=10752
      - dn_data_region_consensus_port=10762
      - schema_replication_factor=3        
      - data_replication_factor=2           
    volumes:
      - /home/iotdb/datanode/data:/iotdb/data
      - /home/iotdb/datanode/logs:/iotdb/logs
    network_mode: "host"  

5、注意不同虚机下的- dn_internal_port=10732

  • dn_mpp_data_exchange_port=10742

  • dn_schema_region_consensus_port=10752

  • dn_data_region_consensus_port=10762几个端口号需要不同才行

相关推荐
姜鱼问生4 小时前
网页一片白?Docker 跑 Nginx 读不到文件,403 Forbidden 排查实录
nginx·docker·容器
\光辉岁月/5 小时前
2.spring5-IOC
java·容器·ioc·注解
ms72wx5 小时前
Docker 命令学习笔记:从入门到进阶的实战指南
笔记·学习·docker
java_logo5 小时前
Docker 部署 Excalidraw:轻松搭建手绘风格白板
运维·docker·容器·excalidraw·白板·轩辕镜像
海的透彻7 小时前
如何让docker容器启动时用自定义的用户
java·docker·dubbo
程序员清风8 小时前
LibreChat 实战:用 Docker 搭建可扩展的多模型对话平台
运维·docker·容器
Web3&Basketball9 小时前
从0到1落地AI Agent沙箱隔离Docker实战:踩坑全记录
运维·docker·容器·agent·容器安全·沙箱隔离
bluebonnet2710 小时前
【docker】使用regctl免安装docker下载镜像
运维·docker·容器
Java开发追求者1 天前
windows快速安装docker
windows·docker·安装·1024程序员节
骑着蜗牛撵大象3271 天前
飞牛fnOS部署Damselfly:Compose编排、照片目录与7100固定访问
java·docker·rpc·dubbo·fnos·照片管理·damselfly