Skip to main content
Version: Deploy 24.1

Multi-node Docker deployments

This document provides a sample approach to set up the database and other infrastructure for a multi-node Deploy deployment using Docker Compose.

note
  • For production deployments, it is recommended that you use Kubernetes to orchestrate the deployment of applications. Docker compose is not ideal for production. Proceed at your own risk.
  • For HA setup, mount a license file or provide an environment variable XL_LICENSE ontaining a base64-encoded license text for the Deploy instances.
  • The folders you mount needs to be owned by user 10001, for example, you can run sudo chown -R 10001 xl-deploy-master if you are mounting directories under $PWD/xl-deploy-master folder.

Setup​

The setup includes

  • Load balancer with HaProxy
  • RabbitMQ single node setup
  • PostgreSQL database (single node setup)
  • Deploy master nodes
  • Deploy worker nodes

Limitations​

  • The database setup is for demo purposes, use your own setup or use an external database
  • The MQ setup is for demo purposes, use your own setup or use an external MQ
  • The HAproxy setup is for demo purposes, use your own setup

Steps​

The production setup for Deploy as mentioned here can be performed using Docker compose as described in the steps below. Follow the steps to deploy the sample:

  1. Create a directory "xl-deploy-ha" and download the docker-compose-xld-ha.yaml and docker-compose-xld-ha-workers.yaml files.
  2. Create a directory rabbitmq in "xl-deploy-ha" directory and download the enabled_plugins.
  3. To set up using automated scripts, use the run_master.sh and run_worker.sh scripts. For manual setup, follow the steps described below. Note: Change the passwords as required whether you run automated scripts, or perform manual setup.
  4. To shut down and clean the Docker container, run the cleanup.sh script.
# Set passwords
export XLD_ADMIN_PASS=admin
export RABBITMQ_PASS=admin
export POSTGRES_PASS=admin

# Create Docker network
docker network create xld-network

# deploy master nodes, load balancer, mq and database.
docker-compose -f docker-compose-xld-ha.yaml up --scale xl-deploy-master=3 -d

# get the IP of master nodes, change the container names if you are not inside a folder named "xl-deploy-ha"
export XLD_MASTER_1=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' xl-deploy-ha_xl-deploy-master_1)
export XLD_MASTER_2=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' xl-deploy-ha_xl-deploy-master_2)
export XLD_MASTER_3=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' xl-deploy-ha_xl-deploy-master_3)
export XLD_LB=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' xl-deploy-lb)

# Deploy the worker nodes (if required, you can change the number of nodes here)
docker-compose -f docker-compose-xld-ha-workers.yaml up --scale xl-deploy-worker=3 -d

# Print the status
docker-compose -f docker-compose-xld-ha.yaml -f docker-compose-xld-ha-workers.yaml ps
  1. To view the logs of individual containers, run the docker logs <container_name> -f command.
  2. To access Deploy UI, go to http://localhost:8080.
  3. To shut down the setup, run:
# Shutdown deployments
docker-compose -f docker-compose-xld-ha.yaml -f docker-compose-xld-ha-workers.yaml down
# Remove network
docker network rm xld-network

Upgrading multi-node deployments​

For upgrade procedures, see Upgrading Multi-Node Docker Deployments