zoukankan      html  css  js  c++  java
  • docker安装solr集群5.3.1

    docker-compose.yml:

    version: '3'
    services:
      zookeeper-A:
        image: zookeeper:3.4.11 
        ports:
          - "12181:2181"
          - "2888"
          - "3888"
        container_name: zookeeper-A
        restart: always
        volumes:
          - ./zoo1/data:/data
          - ./zoo1/datalog:/datalog
        environment:
          TZ: Asia/Shanghai
          ZOO_MY_ID: 1
          ZOO_PORT: 2181
          ZOO_SERVERS: server.1=zookeeper-A:2888:3888 server.2=zookeeper-B:2888:3888 server.3=zookeeper-C:2888:3888
      zookeeper-B:
        image: zookeeper:3.4.11 
        ports:
          - "12182:2181"
          - "2888"
          - "3888"
        container_name: zookeeper-B
        restart: always
        volumes:
          - ./zoo2/data:/data
          - ./zoo2/datalog:/datalog
        environment:
          TZ: Asia/Shanghai
          ZOO_MY_ID: 2
          ZOO_PORT: 2181
          ZOO_SERVERS: server.1=zookeeper-A:2888:3888 server.2=zookeeper-B:2888:3888 server.3=zookeeper-C:2888:3888
      zookeeper-C:
        image: zookeeper:3.4.11 
        ports:
          - "12183:2181"
          - "2888"
          - "3888"
        container_name: zookeeper-C
        restart: always
        volumes:
          - ./zoo3/data:/data
          - ./zoo3/datalog:/datalog
        environment:
          TZ: Asia/Shanghai
          ZOO_MY_ID: 3
          ZOO_PORT: 2181
          ZOO_SERVERS: server.1=zookeeper-A:2888:3888 server.2=zookeeper-B:2888:3888 server.3=zookeeper-C:2888:3888
      solr-1:
        image: solr:5.3.1    
        ports:
          - "18983:8983"
        container_name: solr-1
        restart: always
        environment:
          ZK_HOST: zookeeper-A:2181,zookeeper-A:2181,zookeeper-A:2181
        depends_on:
          - zookeeper-A
          - zookeeper-B
          - zookeeper-C
      solr-2:
        image: solr:5.3.1    
        ports:
          - "18984:8983"
        container_name: solr-2
        restart: always
        environment:
          ZK_HOST: zookeeper-A:2181,zookeeper-A:2181,zookeeper-A:2181
        depends_on:
          - zookeeper-A
          - zookeeper-B
          - zookeeper-C
      solr-3:
        image: solr:5.3.1    
        ports:
          - "18985:8983"
        container_name: solr-3
        restart: always
        environment:
          ZK_HOST: zookeeper-A:2181,zookeeper-A:2181,zookeeper-A:2181
        depends_on:
          - zookeeper-A
          - zookeeper-B
          - zookeeper-C  
    

      

    No config set found to associate with the collection. 刚启动的没有默认的Solr配置

    手动执行命令:

    docker exec -it solr-1  /opt/solr/bin/solr create_collection  -c collection1 -shards 1 -replicationFactor 3 -p 8983 创建一个默认的collection,以后就可以用这个作为基础;
    

      -p 8983:端口号docker容器内运行的solr的端口号无需更改;

    http://www.dczou.com/viemall/824.html

  • 相关阅读:
    关键路径 图论 ——数据结构课程
    vue+flvjs实现flv格式视频流在线播放
    antdvue时间选择范围TimePicker 的使用,实现对应时间的禁用
    SVN(Subversion)中文站相关网址
    系统重启后ircdircu无法启动问题解决
    在Windows上安装Python+MySQL 的常见问题及解决方法
    windows 配置 pygraphviz
    C# 多线程操作TreeView
    ubuntu下解压rar文件乱码问题的解决
    将jar文件生成maven相关文件
  • 原文地址:https://www.cnblogs.com/jifeng/p/9402620.html
Copyright © 2011-2022 走看看