Closed tmm360 closed 10 months ago
Drive-by comment.. Also, a disclaimer: I've never actually used Swarm.
My understanding is that a given volume isn't shared across Swarm nodes by default. It just gets mounted on the node where the container runs. So for instance, when you start the borgmatic container initially, the cache volumes gets mounted onto one particular node's local filesystem. But then when you recreate the container on another node, it doesn't have access to any of the first node's cache files. Or.. are you using a different volume driver that actually distributes volume data across Swarm nodes?
But in any case, this cache issue shouldn't be a huge problem.. Worst case, it should just be inefficient as cache data gets recreated each time borgmatic spins up on a different node. See this FAQ entry for more information.
I can see all of them, the olds and eventually also the new if created, but borgmatic is only able to list archives created with this same container.
I think this is your problem:
archive_name_format: '{hostname}-{now:%Y-%m-%d-%H%M%S}'
You see the {hostname}
there? That means every archive gets created with the current Swarm node's hostname within the archive name. Then, due to borgmatic's automatic archive filtering, those archives get filtered out of your list
results when you run borgmatic on a different node with a different hostname! You can fix that by removing {hostname}
from your archive_name_format
and using something else that doesn't change per-host.
Not sure what to do about your cache issue though...
Thank you very much! Issue was with hostname filtering. Adding an explicit hostname on docker config solves the problem. :)
Glad to hear that did it!
I'm using Docker Swarm to maintain a borgmatic instance. I'm still experimenting with it, but I'm having some issues understanding how cache is managed.
This is an extract of my docker swarm document:
my config.yaml file:
Backup works without problems, I can list, extract, etc.
Problems come when I decide to stop for test the container. Docker swarm creates another, but accessing into the new one if I execute
borgmatic list
I only receive an empty list of archives (even if the repository is recognized).What is strange is that running
borg list ssh://<myUserId>@<myUserId>.repo.borgbase.com/./repo
I can see all of them, the olds and eventually also the new if created, but borgmatic is only able to list archives created with this same container. Am I missing something? How can I recreate locally the cache of borgmatic to recover also listing of missing archives?