ONNODE(1)

πŸ’– ONNODE(1) β€” CTDB Β· clustered TDB database πŸ’–

okay bestie, welcome to onnode, the little utility in the CTDB (clustered TDB database) family. this page is about running commands on cluster nodes. buckle up, it's giving sysadmin main character energy πŸ¦‹


✨ NAME ✨

onnode β€” run commands on CTDB cluster nodes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

onnode [OPTION...] {NODES} {COMMAND}

🌸 DESCRIPTION 🌸

so like. onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes. no cap. πŸ‘‘

NODES tells it which node(s) to run a command on. the details live in the NODES SPECIFICATION section down below, don't skip it πŸ™ˆ

COMMAND can be any shell command, periodt. the onnode utility uses ssh or rsh to connect to the remote nodes and run the command. it's literally just that. πŸ”₯


✨ OPTIONS ✨

  • -c β€” Execute COMMAND in the current working directory on the specified nodes.
  • -f FILENAME β€” Specify an alternative nodes FILENAME to use instead of the default. see the discussion of /etc/ctdb/nodes in the FILES section for more details. 🫢
  • -i β€” Keep standard input open, allowing data to be piped to onnode. normally onnode closes stdin to avoid surprises when scripting. πŸ‘€ note: this option is ignored when using -p or if ONNODE_SSH is set to anything other than "ssh".
  • -n β€” Allow nodes to be specified by name rather than node numbers. these nodes don't need to be listed in the nodes file. you can avoid the nodes file entirely by combining this with -f /dev/null. iconic. πŸ’«
  • -p β€” Run COMMAND in parallel on the specified nodes. the default is to run COMMAND sequentially on each node.
  • -P β€” Push files to nodes. names of files to push are specified rather than the usual command. ⚠️ quoting is fragile/broken β€” filenames with whitespace in them are not supported.
  • -q β€” Do not print node addresses. normally, onnode prints informational node addresses if more than one node is specified. this overrides -v.
  • -v β€” Print node addresses even if only one node is specified. normally, onnode prints informational node addresses when more than one node is specified.
  • -h, --help β€” Show a short usage guide. πŸŽ€

πŸ¦‹ NODES SPECIFICATION πŸ¦‹

Nodes can be specified via numeric node numbers (from 0 to N-1) or mnemonics. multiple nodes are specified using lists of nodes, separated by commas, and ranges of numeric node numbers, separated by dashes. if nodes are specified multiple times then the command will be executed multiple times on those nodes. πŸ“’ the order of nodes is significant. no like fr fr, it matters.

the following mnemonics are available:

  • all β€” All nodes. 🌈
  • any β€” A node where ctdbd is running. this semi-random but there is a bias towards choosing a low numbered node. 🎲
  • ok | healthy β€” All nodes that are not disconnected, banned, disabled or unhealthy.
  • con | connected β€” All nodes that are not disconnected.

πŸ’… EXAMPLES πŸ’…

the following command would show the process ID of ctdbd on all nodes:

onnode all ctdb getpid

the following command would show the last 5 lines of log on each node, preceded by the node's hostname:

onnode all "hostname; tail -5 /var/log/ctdb/log.ctdb"

the following command would restart the ctdb service on all nodes, in parallel:

onnode -p all service ctdb restart

the following command would run ./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4:

onnode -c -p 0,2-4 ./foo

πŸ“ FILES πŸ“

  • /etc/ctdb/nodes β€” Default file containing a list of each node's IP address or hostname.
    • as above, a file specified via the -f is given precedence. if a relative path is specified and no corresponding file exists relative to the current directory then the file is also searched for in the CTDB configuration directory.
    • otherwise the default is /etc/ctdb/nodes.
  • /etc/ctdb/onnode.conf β€” If this file exists it is sourced by onnode. the main purpose is to allow the administrator to set ONNODE_SSH to something other than "ssh". in this case the -t option is ignored. πŸ™ˆ

πŸ’œ SEE ALSO πŸ’œ

ctdb(7), http://ctdb.samba.org/


πŸ‘‘ AUTHOR πŸ‘‘

this documentation was written by Andrew Tridgell, Martin Schwenke. absolute legends, honestly. 🫢


Copyright Β© 2007 Andrew Tridgell, Ronnie Sahlberg Copyright Β© 2008 Martin Schwenke

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 🧚 this was written for the ctdb collection, dated 09/13/2026 β€” onnode(1), and yes that's the same date as the manual header, we're consistent like that. slay πŸ’–βœ¨

πŸ“¦ where this page comes from