Skip to content

Creating a cluster in docker swarm #152

Closed
@nafajardo

Description

@nafajardo

Hi all,

I am trying to make a cluster in docker swarm, but am having no headway and cant seem to wrap my head around why my methods are not working.

I have a two node cluster, and am trying to use the following dockercompose:

networks:
  casnet:
    driver: overlay
services:
  cassandra-masters:
    image: cassandra:latest
    environment:
      - CASSANDRA_BROADCAST_ADDRESS = cassandra-masters
    deploy:
      mode: replicated
      replicas: 2
    networks:
      - casnet
  cassandra-slaves:
    image: cassandra:latest
    environment:
      - CASSANDRA_SEEDS = cassandra-masters
      - CASSANDRA_BROADCAST_ADDRESS = cassandra-slaves
    deploy:
      mode: replicated
      replicas: 3
    depends_on:
      - cassandra-masters
    networks:
      - casnet

The environment variables used to be static IPs of the nodes, but after switching to an overlay network it needs to grab the node IP dynamically. I would appreciate help, or a working dockercompose file ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions