Preparing docker swarm

Installation requirements

Technical requirements

A technical architecture suited to the deployment must have been defined. More information here.

Machine configuration

  • Machines can be physical, virtual or in the cloud

  • Machines must communicate with each other over the network, using fixed IP addressing

  • The IP address must be assigned to a network interface available to the host operating system

  • Open the following ports between machines (for Docker):

    • TCP port 2377 for cluster management communications

    • TCP and UDP port 7946 for inter-node communications

    • UDP port 4789 for docker overlay network traffic

  • Allow IP protocol 50 (ESP) for overlay network encryption

System and software requirements

The operating system used in this document is Ubuntu 22 LTS. The application is validated on Debian/ubuntu environments, and is functional on any recent Linux system, with the prerequisites installed.

As a matter of good Linux practice, we recommend distinguishing between system data volumes, docker (the /var/lib/docker directory can become very large), and datachain directories.

Requirements Version Comments and Installation

Docker

20 minimum (current version 27.0.0)

https://docs.docker.com/engine/install/ubuntu

Cluster Swarm

This section briefly describes how to set up a multi-node Swarm cluster.

Note that this procedure is also valid for setting up a single-node cluster.

Cluster creation

Cluster initialization

This command initiates the cluster and creates the first manager node.

To be executed once only on the host manager

$ docker swarm init [--advertise-addr <MANAGER-IP>]

Example:

$ docker swarm init --advertise-addr 192.168.99.100
Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a
manager.
To add a worker to this swarm, run the following command:
docker swarm join \
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
192.168.99.100:2377
To add a manager to this swarm, run 'docker swarm join-token manager'
and follow the instructions.

You can test the correct instantiation of the cluster:

$ docker info
Containers: 2
Running: 0
Paused: 0
Stopped: 2
...snip...
Swarm: active
NodeID: dxn1zf6l61qsb1josjja83ngz
Is Manager: *true*
Managers: 1
Nodes: 1
...snip...

This shows that Swarm mode has been activated on the host manager and the cluster is ready for use.

For single node mode, the procedure ends here. To proceed to add additional nodes, see next section.

Add nodes to the Swarm cluster

Run on each machine you wish to add as a node

$ docker swarm join --token <MANAGER-TOKEN> <MANAGER-IP>:2377

Example:

$ docker swarm join \
--token
SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
192.168.99.100:2377
This node joined a swarm as a worker.

To retrieve the token again from the manager:

$ docker swarm join-token worker

You can test the node addition by running the following command on the manager - several nodes are now referenced:

$ docker node ls

Node configuration for deployment

In a multi-node swarm cluster, several methods can be used to deploy services on the chosen nodes. Deployment can be based on the host name, in which case no additional configuration is required.

Services can also be deployed according to a tag, by specifying that a given service will be deployed on one or more of the nodes carrying the tag "mon_tag".

Tags are assigned with the following command, assuming that a node of the cluster is named "mon_worker".

docker node update --label-add deploy=mon_tag mon_worker

Additional machine preparation

User accounts

Datachain services run with unprivileged accounts. Currently, we have users with ids 38330 and 38331, which belong to a group with id 38330. This is particularly important for the docker volumes used by the services. In the case of bind-mounted docker volumes (more information), the volume must first be created, and the rights must be assigned to the user.

To avoid working with ids, we suggest creating these users on the machines. (Debian/Ubuntu commands)

groupadd -g 38330 datachain
useradd -g datachain -ms /bin/bash -u 38330 dc && usermod -aG datachain dc
useradd -g maestro -ms /bin/bash -u 38331 dc && usermod -aG datachain maestro
sudo chown -R dc:datachain /opt/adobis
sudo chmod -r 770 /opt/adobis

To maintain the correct rights on directories, we recommend assigning the default group "datachain" to the user who performs the installation, with the appropriate mask, so that new directories belong to this group. However, it is also possible to create the directories with another user, then assign group ownership afterwards.

Directories

The directories used by the application, particularly in the case of bind-mounted volumes (more information), must be created before the application is started. More information on these volumes here.

Datachain installation

Prerequisites

Sufficient resources to run the services, as described in the requirements chapter.

A valid deployment key to log into the Adobis docker registry, in order to retrieve the DataChain © docker images.

Deployment

The application is deployed using a docker-compose file, which allows you to configure the modules to be deployed and their parameters.

In the following chapters, we provide deployment examples, enabling you to deploy the solution in the configuration best suited to your needs.

Dernière mise à jour le 2 novembre 2026 à 15:16