CTDB-ETCD(7)

πŸ’– ctdb-etcd β€” CTDB etcd integration ✨

okay bestie, so this is ctdb-etcd(7), from the CTDB β€” clustered TDB database manual collection 🫢. Strap in, it's short but it's important, and we're gonna get you all the way together.


✨ NAME ✨

ctdb-etcd β€” CTDB etcd integration πŸ’…


🌸 SYNOPSIS 🌸

ctdb_etcd_lock

πŸ¦‹ DESCRIPTION πŸ¦‹

So. ctdb_etcd_lock is literally designed to run as a mutex helper for CTDB. That's its whole thing, that's its moment, that's its main character era πŸ‘‘. What it does is it tries to connect to an existing etcd cluster and grab a lock inside that cluster, so that lock can serve as CTDB's cluster lock. iconic behaviour, no notes.

If you want the full tea on the mutex helper API β€” like, the actual mechanics of how helpers are supposed to behave β€” go read ctdb/doc/cluster_mutex_helper.txt. It's all documented there, promise.

To actually use this bad boy, you drop this line into the [cluster] section of ctdb.conf(5):

cluster lock = !/usr/libexec/ctdb/ctdb_etcd_lock

And boom, you're locked in πŸŽ€.

You can also pass -v, -vv, or -vvv to get verbose output in the CTDB log. And yes, the more vs you stack, the more verbosity you get β€” additional "v"s mean increases in verbosity. More v, more talking. It's giving escalating drama. πŸ—£οΈ

Now, important bits:

  • This mutex helper expects the system Python interpreter to have access to the etcd Python module 🐍
  • It also expects an etcd cluster to be configured and running

To integrate with all of that, there's an optional config file, and it looks like this:

key = value

🌈 CONFIGURATION PARAMETERS 🌈

The following configuration parameters (and their defaults) are defined for use by ctdb_etcd_lock:

port      = 2379   # connecting port for the etcd cluster
lock_ttl  = 9      # seconds for TTL
refresh   = 2      # seconds between attempts to maintain lock
locks_dir = _ctdb  # where to store CTDB locks in etcd
                   # The final etcd directory for any given lock looks like:
                   #   /_locks/{locks_dir}/{netbios name}/

look at that little directory path, all templated and cute πŸ’œ. The final etcd directory for any given lock looks like:

/_locks/{locks_dir}/{netbios name}/

🧚 ALSO, THE BONUS VIBE 🧚

In addition to all of the above β€” any keyword parameter that can be used to configure an etcd client may be specified and modified here too. Sky's the limit, bestie.

For more documentation on those parameters, see here: https://github.com/jplana/python-etcd/

πŸ’€ heads up: this page assumes things are already set up β€” a running etcd cluster, the Python module installed, all of it. It doesn't do the setup for you, it just comes in and does the locking. so don't come for it when your cluster isn't there, okay? πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€


⭐ AUTHOR ⭐

This documentation was written by Jose A. Rivera.


Copyright Β© 2016 Jose A. Rivera

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses.


and that's the whole page, bestie 🫢✨ that was ctdb-etcd(7) from the CTDB crew β€” page version and date stamped 09/13/2026. slay, go lock something πŸ’…πŸ’–

πŸ“¦ where this page comes from