Skip to content

Instantly share code, notes, and snippets.

@brigaldies
Created October 3, 2018 13:30
Show Gist options
  • Save brigaldies/b98655ccfe740f2ff14e7b0914960208 to your computer and use it in GitHub Desktop.
Save brigaldies/b98655ccfe740f2ff14e7b0914960208 to your computer and use it in GitHub Desktop.
Docker compose file for a 3-Zoo Keeper ensemble and 3 SolrCloud nodes, with config and data persistence for both the ZK and Solr nodes.
version: '3.1'
services:
zoo1:
image: zookeeper:3.4.13
restart: always
hostname: zoo1
ports:
- 2181:2181
volumes:
- ./zoo-1/conf:/conf
- ./zoo-1/data:/data
- ./zoo-1/datalog:/datalog
- ./zoo-1/logs:/logs
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
networks:
- solrcloud
zoo2:
image: zookeeper:3.4.13
restart: always
hostname: zoo2
ports:
- 2182:2181
volumes:
- ./zoo-2/conf:/conf
- ./zoo-2/data:/data
- ./zoo-2/datalog:/datalog
- ./zoo-2/logs:/logs
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zoo3:2888:3888
networks:
- solrcloud
zoo3:
image: zookeeper:3.4.13
restart: always
hostname: zoo3
ports:
- 2183:2181
volumes:
- ./zoo-3/conf:/conf
- ./zoo-3/data:/data
- ./zoo-3/datalog:/datalog
- ./zoo-3/logs:/logs
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=0.0.0.0:2888:3888
networks:
- solrcloud
solr1:
image: solr:7.5.0
restart: always
ports:
- 8983:8983
volumes:
- ./solr-1:/opt/mysolrhome
environment:
ZK_HOST: zoo1:2181,zoo2:2181,zoo3:2181
SOLR_HOST: solr1
SOLR_HOME: /opt/mysolrhome
INIT_SOLR_HOME: "yes"
depends_on:
- zoo1
- zoo2
- zoo3
networks:
- solrcloud
solr2:
image: solr:7.5.0
restart: always
ports:
- 8984:8983
volumes:
- ./solr-2:/opt/mysolrhome
environment:
ZK_HOST: zoo1:2181,zoo2:2181,zoo3:2181
SOLR_HOST: solr2
SOLR_HOME: /opt/mysolrhome
INIT_SOLR_HOME: "yes"
depends_on:
- zoo1
- zoo2
- zoo3
networks:
- solrcloud
solr3:
image: solr:7.5.0
restart: always
ports:
- 8985:8983
volumes:
- ./solr-3:/opt/mysolrhome
environment:
ZK_HOST: zoo1:2181,zoo2:2181,zoo3:2181
SOLR_HOST: solr3
SOLR_HOME: /opt/mysolrhome
INIT_SOLR_HOME: "yes"
depends_on:
- zoo1
- zoo2
- zoo3
networks:
- solrcloud
# Docker dashboard
portainer:
image: portainer/portainer
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- solrcloud_portainer_data:/data
ports:
- 9001:9000
depends_on:
- zoo1
- zoo2
- zoo3
- solr1
- solr2
- solr3
networks:
- solrcloud
volumes:
solrcloud_portainer_data:
networks:
solrcloud:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment