LEIL-URAFT-HELPER(8)
π NAME π
leil-uraft-helper β the LeilFS HA suite helper, bestie. It's the little sidekick that does the actual hands-on work. π«Ά
β¨ SYNOPSIS β¨
leil-uraft-helper COMMAND [ARGUMENTS]
π DESCRIPTION π
Okay so real talk: leil-uraft-helper is a helper script, and it's used internally by leil-uraft to manage nodes. Like it's not out here trying to be the main character, it's the support system. π
Here's the whole vibe: the uRaft daemon does the leader election thing, and then it calls this helper to actually execute the backend-specific actions β promote/demote, floating IP assignment, health checks. And that split? Totally intentional, no cap:
leil-uraftimplements the election logic. That's its whole job.leil-uraft-helperimplements the platform and LeilFS-specific operations. The real ones.
In production, it is important that helper commands are:
- Fast (bounded runtime, no unbounded retries). No going off on a little side quest, okay? β±οΈ
- Deterministic and idempotent where possible. Run it twice, same result, we love consistency.
- Strict about machine-readable output for commands used in voting. The daemon is parsing that, it cannot be reading your diary.
Except for isalive and metadata-version (which can be useful for debugging, ngl they're lowkey handy), this script is intended to be called by leil-uraft. You're a guest in its house, respectfully. π
π COMMANDS π
The following commands are used by leil-uraft. Let's get into it.
πΈ isalive
Checks whether the local metadata service is responsive. Vibe check on the metadata service, basically.
This command must print exactly one of the following strings, without extra text. No emoji, no commentary, no "hi bestie" β the daemon is reading this:
alive(exit status 0) πdead(exit status non-zero) π
The daemon uses this result to gate leader promotion (see blocked_promote in the uRaft status endpoint). So like⦠it matters. A lot.
Note π In the current implementation the helper wrapsleil-master -o ha-cluster-managed isalive. Ifleil-masteris wedged or slow to connect,leil-uraftmay time out and log(checkNodeStatus): Isalive timeout reported after X ms., whereXis the value ofURAFT_GETVERSION_TIMEOUT. This timeout is used for helper commands expected to be fast, such asleil-uraft-helper metadata-versionandleil-uraft-helper isalive.
π metadata-version [HOST PORT]
Returns the local metadata version as an unsigned integer. Just a number. That's it. That's the tweet.
The daemon uses this to avoid electing a node with stale metadata. The command must print an integer (decimal) and nothing else β no units, no vibes, no garnish. π’
If the metadata service is unhealthy, returning 0 is a safe choice because it prevents the node from being elected Leader. Like, taking yourself out of the running? Strategic. Iconic.
π₯ promote
Promotes the local node to active master. Glow up time. π
Typical responsibilities include:
- Switching
leil-masterpersonality tomaster. - Ensuring metadata is consistent.
- Assigning the floating IP (VIP) to the configured interface.
On success the command should return exit status 0. Slay.
π¦ demote
Demotes the local node from active master to shadow. The come-down. Still serving, just quieter. π
Typical responsibilities include:
- Dropping the floating IP (VIP).
- Restarting
leil-masterwithinitial-personality=shadow.
This command is the cleanest way to ensure a former Leader re-joins as a shadow after failover. Fr fr, it's the tidy option.
π dead
Handles the situation where the local metadata server is considered dead. Yeah. That situation.
The default helper implementation drops the floating IP only. In some environments, you may also want to stop/restart leil-master or force a demotion to shadow; if you customize dead, keep it idempotent and fast. Please. π
π assign-ip
Assigns the configured floating IP to the configured network interface. Putting the IP where it belongs. π
π drop-ip
Drops the configured floating IP from the configured network interface. Evicting it, gently. β¨
π§ is-floating-ip-alive
Reports whether the floating IP is present on the local interface.
This is useful for debugging and for VIP watchdog behavior. Little detective work, iykyk. π
Other helper commands may exist (for example quick-stop and cleanup) and can be used by operators or by additional recovery logic. So if you spot a stray command, that's why. π
β FILES β
The helper script reads configuration from:
@ETC_PATH@/leil-uraft.cfg@ETC_PATH@/leil-master.cfg
It may also read metadata state from:
DATA_PATHconfigured inleil-master.cfg
That's the reading list. π
π EXIT STATUS π
The exact semantics depend on the command, but the general contract is:
- Exit status
0indicates success. π - Non-zero exit status indicates failure. π
For commands that are parsed by the daemon (isalive, metadata-version), stdout must remain machine-readable even on error. Yes, even when everything is on fire. Especially then. π₯
π REPORTING BUGS π
Report bugs to the GitHub repository https://github.com/leil-io/leilfs as an issue. Drop the link, file the issue, we'll love you for it. π«Ά
π COPYRIGHT π
Copyright 2008-2009 Gemius SA
Copyright 2013-2019 Skytechnology sp. z o.o.
Copyright 2023 Leil Storage OΓ
LeilFS 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, version 3.
LeilFS 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 LeilFS. If not, see http://www.gnu.org/licenses/.
π SEE ALSO π
leil-uraft(8), leil-uraft.cfg(5)
That's the whole page, bestie β go be fast, deterministic, and machine-readable out there. π¦
Signed off from the LEIL-URAFT-HELPER(8) manual, dated 1980-01-01 β yes that date is real, we don't question the classics. πβ¨
π¦ where this page comes from
- nixpkgs unstable: saunafs 5.12.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms