MachineOf= fleet parameter behaviour

38 views
Skip to first unread message

Arthur Clément

unread,
Jun 26, 2015, 6:48:06 AM6/26/15
to coreo...@googlegroups.com
Hi,

I'm starting to build units workflow/dependencies to handle static volumes for my services so it might not be the perfect practice, but here is my problem :

I created a path unit to detect the presence of a volume. 

[Unit] 
Description=Presence of Repl 3 LVM 
DefaultDependencies=false 

[Path] 
PathExists=/dev/mapper/vol_rs_repl3-rs_repl3 
Unit=data-mongodb-repl3.mount 

[Install] 
WantedBy=data-mongodb-repl3.mount 

[X-Fleet] 
Global=true



I created a mount unit to mount the volume

[Unit] 
Description=Mount third bo replica volume 
After=data-mongodb-repl3.path 
Requires=data-mongodb-repl3.path 


[Mount] 
What=/dev/mapper/vol_rs_repl3-rs_repl3 
Where=/data/mongodb/repl3 
Type=xfs 
Options=rw,relatime,attr2,inode64,noquota 
DirectoryMode=0755

It's working well with "[X-Fleet] Global=true", the volume is mounted on the nodes wich have one. 

As expected, I can see this failed units on the nodes without volume, it's not a big problem :
data-mongodb-repl3.path active          waiting
data-mongodb-repl3.mount inactive        dead


I tried to use MachineOf=data-mongodb-repl3.path on the mount unit (doc : "MachineOf Limit eligible machines to the one that hosts a specific unit") in order to deploy the mount unit only on the nodes with running path unit and to limit the number of failed units. 
But it does not work, the unit is deployed randomly on one node of the cluster (and only one node), without considering the unit state/presence in MachineOf .

What do I miss about this parameter ?


Arthur






Arthur Clement
DevOps

     

Stephan Z.

unread,
Jun 26, 2015, 6:52:23 AM6/26/15
to Arthur Clément, coreos-user
Global=true is about scheduling only, not the active state. And since you have not made your second unit also global, fleet will only create one which is intended to run on the same machine as any scheduled unit "data-mongodb-repl3.path" (of which you have a lot).

You could use fleet tags to mark the machines with the correct disks.

Regards
 Stephan

--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arthur Clément

unread,
Jun 26, 2015, 8:22:33 AM6/26/15
to Stephan Z., coreos-user
Ok, that make sense.

I started with two conditions

[X-Fleet] 
Global=true 
MachineOf=data-mongodb-repl3.path

but I hit "Error creating units: Global cannot be used with Peers". I understand the error, it's documented, but that's really the behaviour I want/need. 
I know I can use fleet metadatas but I find it too much static, I'd like to run my units as decoupled from my workers as possible. I'll find a way.

Thanks,


Arthur



Arthur Clement
DevOps

     


Reply all
Reply to author
Forward
0 new messages