Skip to content

Instantly share code, notes, and snippets.

@huezo
Last active August 15, 2018 20:37
Show Gist options
  • Save huezo/12b8477cb773a9f7f53d0ff219579ce3 to your computer and use it in GitHub Desktop.
Save huezo/12b8477cb773a9f7f53d0ff219579ce3 to your computer and use it in GitHub Desktop.
docker-compose.yml
# Servicios con restart: always
# Con Puertos Expuestos
# Puerto Nodo 1 : Puerto 19042
# Puerto Nodo 2 : Puerto 29042
# Puerto Nodo 3 : Puerto 39042
# Please note we are using Docker Compose version 3
version: '3'
services:
# Configuration for our seed cassandra node. The node is call DC1N1
# .i.e Node 1 in Data center 1.
DC1N1:
restart: always
# from the docker store.
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
# Network for the nodes to communicate
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- ./n1data:/var/lib/cassandra
ports:
- "19042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME=dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Exposing ports for inter cluste communication
expose:
- 7000
- 7001
- 7199
- 9042
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# This is configuration for our non seed cassandra node. The node is call
# DC1N1 .i.e Node 2 in Data center 1.
DC1N2:
restart: always
# Cassandra image for Cassandra version 3.1.0. This is pulled
# from the docker store.
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
#
# Network for the nodes to communicate
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- ./n2data:/var/lib/cassandra
ports:
- "29042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME=dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Since DC1N1 is the seed node
depends_on:
- DC1N1
# Exposing ports for inter cluste communication. Note this is already
# done by the docker file. Just being explict about it.
expose:
# Intra-node communication
- 7000
# TLS intra-node communication
- 7001
# JMX
- 7199
# CQL
- 9042
# Thrift service
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# This is configuration for our non seed cassandra node. The node is call
# DC1N3 .i.e Node 3 in Data center 1.
DC1N3:
restart: always
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
# Network for the nodes to communicate. This is pulled from docker hub.
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- ./n3data:/var/lib/cassandra
ports:
- "39042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME= dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Since DC1N1 is the seed node
depends_on:
- DC1N1
# Exposing ports for inter cluste communication. Note this is already
# done by the docker file. Just being explict about it.
expose:
# Intra-node communication
- 7000
# TLS intra-node communication
- 7001
# JMX
- 7199
# CQL
- 9042
# Thrift service
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# A web based interface for managing your docker containers.
portainer:
restart: always
image: portainer/portainer
command: --templates http://templates/templates.json
networks:
- dc1ring
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./portainer-data:/data
# Enable you to access potainers web interface from your host machine
# using http://localhost:10001
ports:
- "10001:9000"
networks:
dc1ring:
# Servicios con restart: always
# Con Puertos Expuestos
# Puerto Nodo 1 : Puerto 19042
# Puerto Nodo 2 : Puerto 29042
# Puerto Nodo 3 : Puerto 39042
# Please note we are using Docker Compose version 3
version: '3'
services:
# Configuration for our seed cassandra node. The node is call DC1N1
# .i.e Node 1 in Data center 1.
DC1N1:
restart: always
# from the docker store.
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
# Network for the nodes to communicate
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- ./n1data:/var/lib/cassandra
ports:
- "19042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME=dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Exposing ports for inter cluste communication
expose:
- 7000
- 7001
- 7199
- 9042
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# This is configuration for our non seed cassandra node. The node is call
# DC1N1 .i.e Node 2 in Data center 1.
DC1N2:
restart: always
# Cassandra image for Cassandra version 3.1.0. This is pulled
# from the docker store.
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
#
# Network for the nodes to communicate
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- ./n2data:/var/lib/cassandra
ports:
- "29042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME=dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Since DC1N1 is the seed node
depends_on:
- DC1N1
# Exposing ports for inter cluste communication. Note this is already
# done by the docker file. Just being explict about it.
expose:
# Intra-node communication
- 7000
# TLS intra-node communication
- 7001
# JMX
- 7199
# CQL
- 9042
# Thrift service
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# This is configuration for our non seed cassandra node. The node is call
# DC1N3 .i.e Node 3 in Data center 1.
DC1N3:
restart: always
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
# Network for the nodes to communicate. This is pulled from docker hub.
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- ./n3data:/var/lib/cassandra
ports:
- "39042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME= dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Since DC1N1 is the seed node
depends_on:
- DC1N1
# Exposing ports for inter cluste communication. Note this is already
# done by the docker file. Just being explict about it.
expose:
# Intra-node communication
- 7000
# TLS intra-node communication
- 7001
# JMX
- 7199
# CQL
- 9042
# Thrift service
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# A web based interface for managing your docker containers.
portainer:
restart: always
image: portainer/portainer
command: --templates http://templates/templates.json
networks:
- dc1ring
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./portainer-data:/data
# Enable you to access potainers web interface from your host machine
# using http://localhost:10001
ports:
- "10001:9000"
networks:
dc1ring:
# Servicios con restart: always
# Con Puertos Expuestos
# Puerto Nodo 1 : Puerto 19042
# Puerto Nodo 2 : Puerto 29042
# Puerto Nodo 3 : Puerto 39042
# Please note we are using Docker Compose version 3
version: '3'
services:
# Configuration for our seed cassandra node. The node is call DC1N1
# .i.e Node 1 in Data center 1.
DC1N1:
restart: always
# from the docker store.
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
# Network for the nodes to communicate
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- n1data:/var/lib/cassandra
ports:
- "19042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME=dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Exposing ports for inter cluste communication
expose:
- 7000
- 7001
- 7199
- 9042
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# This is configuration for our non seed cassandra node. The node is call
# DC1N1 .i.e Node 2 in Data center 1.
DC1N2:
restart: always
# Cassandra image for Cassandra version 3.1.0. This is pulled
# from the docker store.
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
#
# Network for the nodes to communicate
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- n2data:/var/lib/cassandra
ports:
- "29042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME=dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Since DC1N1 is the seed node
depends_on:
- DC1N1
# Exposing ports for inter cluste communication. Note this is already
# done by the docker file. Just being explict about it.
expose:
# Intra-node communication
- 7000
# TLS intra-node communication
- 7001
# JMX
- 7199
# CQL
- 9042
# Thrift service
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
# This is configuration for our non seed cassandra node. The node is call
# DC1N3 .i.e Node 3 in Data center 1.
DC1N3:
restart: always
image: huezohuezo1990/cassandra-oraclelinux:7.4
# In case this is the first time starting up cassandra we need to ensure
# that all nodes do not start up at the same time. Cassandra has a
# 2 minute rule i.e. 2 minutes between each node boot up. Booting up
# nodes simultaneously is a mistake. This only needs to happen the firt
# time we bootup. Configuration below assumes if the Cassandra data
# directory is empty it means that we are starting up for the first
# time.
# Network for the nodes to communicate. This is pulled from docker hub.
networks:
- dc1ring
# Maps cassandra data to a local folder. This preserves data across
# container restarts. Note a folder n1data get created locally
volumes:
- n3data:/var/lib/cassandra
ports:
- "39042:9042"
# Docker constainer environment variable. We are using the
# CASSANDRA_CLUSTER_NAME to name the cluster. This needs to be the same
# across clusters. We are also declaring that DC1N1 is a seed node.
environment:
- CASSANDRA_CLUSTER_NAME= dev_cluster
- CASSANDRA_SEEDS=DC1N1
# Since DC1N1 is the seed node
depends_on:
- DC1N1
# Exposing ports for inter cluste communication. Note this is already
# done by the docker file. Just being explict about it.
expose:
# Intra-node communication
- 7000
# TLS intra-node communication
- 7001
# JMX
- 7199
# CQL
- 9042
# Thrift service
- 9160
# Cassandra ulimt recommended settings
ulimits:
memlock: -1
nproc: 32768
nofile: 100000
networks:
dc1ring:
volumes:
n1data:
n2data:
n3data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment