Jump to content

Hello there!

I recently update my homelab by build a server as a network storage device.
Actually, I run 3 nodes with Docker Swarm running on it, but as you might know, when you run a container with a persistant volume, it will be stored on the server where the container run for the first time. 
Also, some software require config file, that can be only store on the master node (For exemple, I configure my traefik using toml config file). 

I would like to host all those file on a network drive and allow docker to mount volume or mount config file from a network share, but I can't find any solution about it.

Did some person here already experienced an issue like this and found a solution ?

Thanks

Network and System Administrator from France

Currently own 3 self-built server running on Rocky Linux 9 with a Docker Swarm cluster running on it.

Link to comment
https://linustechtips.com/topic/1461886-docker-volume-on-centralized-storage-server/
Share on other sites

Link to post
Share on other sites

I don't think that's doable with docker swarm. Instead, I'd looking into migrating your stuff over to k8s.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to post
Share on other sites

10 minutes ago, igormp said:

I don't think that's doable with docker swarm. Instead, I'd looking into migrating your stuff over to k8s.

I never used k8s, but doesn't it have the same issue with data stored on local persistant volume ?

Network and System Administrator from France

Currently own 3 self-built server running on Rocky Linux 9 with a Docker Swarm cluster running on it.

Link to post
Share on other sites

14 minutes ago, jpyg said:

I never used k8s, but doesn't it have the same issue with data stored on local persistant volume ?

No, you can attach a nfs volume easily, see: https://kubernetes.io/docs/concepts/storage/volumes/#nfs

 

However, now that I gave a look at it, it also seems possible with docker-swarm: https://gist.github.com/ruanbekker/4a9c0d250bce9f84482f2a788ce92131

 

Another option would be to have something like minio action and an object storage abstraction.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to post
Share on other sites

2 minutes ago, igormp said:

No, you can attach a nfs volume easily, see: https://kubernetes.io/docs/concepts/storage/volumes/#nfs

 

However, now that I gave a look at it, it also seems possible with docker-swarm: https://gist.github.com/ruanbekker/4a9c0d250bce9f84482f2a788ce92131

 

Another option would be to have something like minio action and an object storage abstraction.

AFAIK but maybe I'm wrong, but isn't there some issue while trying to host database on an NFS volume ?

I'll take a look, maybe Minio could resolve my issue

Network and System Administrator from France

Currently own 3 self-built server running on Rocky Linux 9 with a Docker Swarm cluster running on it.

Link to post
Share on other sites

2 hours ago, jpyg said:

AFAIK but maybe I'm wrong, but isn't there some issue while trying to host database on an NFS volume ?

I'll take a look, maybe Minio could resolve my issue

The issues are mostly related to performance and latency, but since you're running that stuff locally it shouldn't be a problem.

 

You'd still face similar issues with minio since that's an object storage, not block storage, and also over the network.

 

Also, if you're running a database on your cluster, why not have it set to run in a specific node? This way your persistent storage in a single node wouldn't be a problem.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to post
Share on other sites

21 minutes ago, igormp said:

The issues are mostly related to performance and latency, but since you're running that stuff locally it shouldn't be a problem.

 

You'd still face similar issues with minio since that's an object storage, not block storage, and also over the network.

 

Also, if you're running a database on your cluster, why not have it set to run in a specific node? This way your persistent storage in a single node wouldn't be a problem.

I'm actually using my lab to test possible case on an infrastructure, but actually, the only thing i'm blocked with is that if the node where the database is hosted down for some reason, I have no solution to reup the database with data on another node

Network and System Administrator from France

Currently own 3 self-built server running on Rocky Linux 9 with a Docker Swarm cluster running on it.

Link to post
Share on other sites

4 minutes ago, jpyg said:

I'm actually using my lab to test possible case on an infrastructure, but actually, the only thing i'm blocked with is that if the node where the database is hosted down for some reason, I have no solution to reup the database with data on another node

Well, what would happen if your note containing the actual data went down? Even if you were to spin up another instance of your database, it wouldn't be able to access the data in any way.

 

Still, if you're going for an actual production environment, I'd go with k8s instead, it has way better community support when compared to docker swarm.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×