Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jay-johnson/fd1ca2260ef48631bd2b to your computer and use it in GitHub Desktop.
Save jay-johnson/fd1ca2260ef48631bd2b to your computer and use it in GitHub Desktop.
Using Docker Compose to deploy Spring XD 1.3 with a RabbitMQ Cluster

Using Docker Compose to deploy Spring XD 1.3 with a RabbitMQ Cluster

  1. Create a compose.env file with the contents:
XD_TRANSPORT=rabbit
HSQL_SERVER_HOST=hsqldb
SPRING_REDIS_HOST=redis1
SPRING_RABBITMQ_ADDRESSES=rabbit1:5672
ZK_CLIENT_CONNECT=zookeeper1:2181
  1. Create a docker-compose.yml file with the contents:
redis1:
  image: jayjohnson/redis
  container_name: "redis1"
  hostname: "redis1"
  ports:
    - "6379:6379"
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN

zookeeper1:
  image: jayjohnson/springxd-zookeeper
  container_name: "zookeeper1"
  hostname: "zookeeper1"
  working_dir: /opt/spring-xd/zookeeper/bin
  ports:
    - "2181:2181"
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN

hsqldb:
  image: jayjohnson/springxd-hsqldb
  container_name: "hsqldb"
  hostname: "hsqldb"
  user: springxd
  ports:
    - "9001:9101"
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN

rabbit1:
  image: jayjohnson/rabbitmq-clusterable
  container_name: "rabbit1"
  hostname: "rabbit1"
  ports:
    - "1883:1883"
    - "4369:4369"
    - "5672:5672"
    - "8883:8883"
    - "9100-9105:9100-9105"
    - "15672:15672"
    - "25672:25672"
  environment:
    - CLUSTERED=false
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN

rabbit2:
  image: jayjohnson/rabbitmq-clusterable
  container_name: "rabbit2"
  hostname: "rabbit2"
  ports:
    - "1884:1883"
    - "4370:4369"
    - "5673:5672"
    - "8884:8883"
    - "9110-9115:9100-9105"
    - "15673:15672"
    - "25673:25672"
  environment:
    - CLUSTERED=true
    - CLUSTER_WITH=rabbit1
    - RAM_NODE=false
  links:
    - rabbit1
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN

rabbit3:
  image: jayjohnson/rabbitmq-clusterable
  container_name: "rabbit3"
  hostname: "rabbit3"
  ports:
    - "1885:1883"
    - "4371:4369"
    - "5674:5672"
    - "8885:8883"
    - "9120-9125:9100-9105"
    - "15674:15672"
    - "25674:25672"
  environment:
    - CLUSTERED=true
    - CLUSTER_WITH=rabbit1
    - RAM_NODE=true
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN
  links:
    - "rabbit1"
    - "rabbit2"

admin1:
  image: jayjohnson/springxd-admin
  container_name: "admin1"
  hostname: "admin1"
  user: springxd
  ports:
    - "9393:9393"
  env_file: compose.env
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN
  links:
    - "hsqldb"
    - "zookeeper1"
    - "rabbit1"
    - "rabbit2"
    - "rabbit3"
    - "redis1"

container1:
  image: jayjohnson/springxd-container
  container_name: "container1"
  hostname: "container1"
  user: springxd
  ports:
    - "8080:8080"
    - "8081:8081"
  env_file: compose.env
  cap_add:
    - ALL
    - NET_ADMIN
    - SYS_ADMIN
  links:
    - "hsqldb"
    - "zookeeper1"
    - "admin1"
    - "rabbit1"
    - "rabbit2"
    - "rabbit3"
    - "redis1"
  1. Start up the Distributed Spring XD 1.3.0 Environment running across Docker Containers
docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment