Skip to content
No description, website, or topics provided.
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

HA Docker Cluster with Swarm and Ceph

2020 Ondrej Sika <>

HW Requirements

  • 3 nodes
  • 2 hdd (one for system, one for ceph)

Software Requirements

  • Debian 10
  • Docker
  • Ceph (Nautilus)
  • Ceph Deploy

Install Docker

On all 3 nodes install Docker

curl -fsSL | sudo sh

Install Ceph Nautulus on Debian 10

Ceph does'n have official repositories for Debian 10 Buster yet (29-01-2020), we use Croit mirror. See their blog post

# Add repositories
curl > /etc/apt/trusted.gpg.d/croit-mirror.gpg
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/croit-mirror.gpg] buster main' > /etc/apt/sources.list.d/croit-ceph.list
printf 'Package: *\nPin: origin\nPin-Priority: 990\n' > /etc/apt/preferences.d/pin-mirror-croit-io
apt update

# Check Apt Pin
apt-cache policy ceph

# Install CEPH
apt install -y ceph

# Install NTP
apt install -y ntpsec

Install Ceph Deploy

Install ceph-deploy on first node

# Ensure Python 3
apt install -y python3 python3-pip

# Install Ceph Deploy
pip3 install ceph-deploy

Setup hostnames

Set fqdn hostname node{1,2,3} to every node (in /etc/hostname).

Setup /etc/hosts

Add those lines to /etc/hosts in every node node1 node2 node3

Setup Ceph Cluster

See more:

Create directory ceph-deploy and checkout there.

mkdir ~/ceph-deploy
cd ~/ceph-deploy
ceph-deploy new node1 node2 node3

Add Ceph network to ceph.conf

echo public network = >> ceph.conf

If you follow tutorial on Ceph, skip ceph-deploy install - we have ceph already installed and ceph-deploy install does't work on Debian 10 yet (29-01-2020).

Setup monitors

ceph-deploy mon create-initial

Setup admin nodes (you can manage ceph on those nodes)

ceph-deploy admin node1 node2 node3

Create OSDs

ceph-deploy osd create --data /dev/sdb node1
ceph-deploy osd create --data /dev/sdb node2
ceph-deploy osd create --data /dev/sdb node3

Check Ceph health

ceph health

Check Ceph status

ceph -s

Setup CephFS

See more:

Create metadata servers on each node

ceph-deploy mds create node1 node2 node3

Create Filesystem

ceph osd pool create cephfs_data 32
ceph osd pool create cephfs_meta 32
ceph fs new cephfs cephfs_meta cephfs_data

Mount CephFS

mount -t ceph :/ /cephfs -o name=admin

Setup Swarm

Init Swarm on first node

docker swarm init

Generate join token for manager

docker swarm join-token manager

Call docker swarm join ... with master token on other nodes.

Setup Traefik

Clone traefik-le repo

cd ~
git clone
cd traefik-le

HTTP only

If you have SSL termination before this cluster, you can use http only configuration of Traefik.

Run Traefik HTTP only

docker stack deploy -c docker-compose-swarm-http.yml traefik

HTTPS using Let's Encrypt

If you don't have proxy or dont want to terminate ssl on proxy, you can setup Traefik with SSL and automatic genetation of SSL certificates using Let's Encrypt.

Run Traefik with Let's Encrypt

docker stack deploy -c docker-compose-swarm.yml traefik

Deploy Example Project

Now, you can deploy demo site (from traefik-le examples). You have pointed DNS * to this cluster.

# Go Hello World Example docker stack deploy -c demo-sites/hello-world/docker-compose.yml hello

# Nginx Example docker stack deploy -c demo-sites/nginx/docker-compose.yml nginx

Check out and

You can’t perform that action at this time.