NODESET(1)
β¨ nodeset(1) β¨
ClusterShell User Manual β ok bestie, this is nodeset, the manual page for the nodeset command from ClusterShell. It's giving cluster-admin main character energy and honestly? iconic. Let's get into it π
πΈ NAME πΈ
nodeset β compute advanced nodeset operations
π¦ SYNOPSIS π¦
nodeset [OPTIONS] [COMMAND] [nodeset1 [OPERATION] nodeset2|...]
π DESCRIPTION π
Quick note bestie:nodesetandclusetare the same command. Same girl, different name. Periodt.
nodeset is a utility command that ships with the ClusterShell library, and it implements some of the features of ClusterShell's NodeSet and RangeSet Python classes. Basically it makes manipulating 1D or nD-indexed cluster nodes and node groups easy peasy. β¨
Also β and this is the part that eats β nodeset is automatically bound to the library's node group resolution mechanism. So it's especially useful for leveling up your cluster-aware administration shell scripts. No cap. π«Ά
π OPTIONS π
--versionβ show the program's version number and dip out-h,--helpβ show this help message and dip out-s GROUPSOURCE,--groupsource=GROUPSOURCEβ optionalgroups.conf(5)group source to use--groupsconf=FILEβ use an alternate config file forgroups.conf(5)
Commands:
-c,--countβ show the number of nodes in the nodeset(s)-e,--expandβ expand the nodeset(s) into separate nodes (peep-S SEPARATORtoo)-f,--foldβ fold the nodeset(s) (or separate nodes) into one nodeset-l,--listβ list node groups; list node groups and nodes (-ll); or list node groups, nodes and node count (-lll). When you give it no argument at all, it lists every node group name found in the selected group source (see also-s GROUPSOURCE). If you pass any nodesets as arguments, it'll find the node groups those nodes belong to (individually). Optionally, for each group it can show the fraction of those nodes that are members of the group (with-ll), and also member count / total group node count (with-lll). And if you give a single hyphen-minus (-) as a nodeset, it gets read from standard input. π-L,--list-allβ list node groups from all group sources (-LLshows nodes,-LLLadds node count). Just like-l, if any nodesets are passed as arguments, it'll find the node groups those nodes belong to (individually).-r,--regroupβ fold nodes using node groups (see-s GROUPSOURCE)--index=NODEβ output the index ofNODEin the nodeset (this is the reverse of-I/--slice)--list-sources,--groupsourcesβ list all active group sources (seegroups.conf(5))
Operations:
-x SUB_NODES,--exclude=SUB_NODESβ exclude the specified nodeset-i AND_NODES,--intersection=AND_NODESβ calculate the nodesets intersection-X XOR_NODES,--xor=XOR_NODESβ calculate the symmetric difference between nodesets
Options:
-a,--allβ call external node groups support to display all nodes--autostep=AUTOSTEPβ enable a-b/step style syntax when folding nodesets. The value is the min node count threshold (an integer like4, a percentage like50%, orauto). If you don't specify it, auto step is disabled (which is best for compatibility with other cluster tools). Example:autostep=4,"node2 node4 node6"folds intonode[2,4,6], butautostep=3,"node2 node4 node6"folds intonode[2-6/2].-d,--debugβ output more messages for debugging purposes-q,--quietβ be quiet, print essential output only π€«-R,--rangesetβ switch toRangeSetinstead ofNodeSet. Super useful when you're working on numerical cluster ranges, like1,5,18-31-G,--groupbaseβ do not display the group source prefix (always@groupname)-S SEPARATOR,--separator=SEPARATORβ the separator string to use when expanding nodesets (default:' ')-O FORMAT,--output-format=FORMATβ output format (default:'%s')-I SLICE_RANGESET,--slice=SLICE_RANGESETβ return the sliced-off result. Examples ofSLICE_RANGESETare"0"for simple index selection, or"1-9/2,16"for complex rangeset selection--split=MAXSPLITβ split the result into a number of subsets--contiguousβ split the result into contiguous subsets (i.e. for nodeset, the subsets will contain nodes with the same pattern name and a contiguous range of indexes, likefoobar[1-100]; for rangeset, the subsets consist of contiguous index ranges)--axis=RANGESETβ for nD nodesets, fold along the provided axis only. Axes are indexed from1tonand can be specified here either using rangeset syntax, e.g.'1','1-2','1,3', or by a single negative number meaning the index is counted from the end. Because some nodesets may have several different dimensions, axis indices are silently truncated to fall in the allowed range.--pick=Nβ pickNnode(s) at random in the nodeset π²
For a short explanation of these options, see -h, --help.
If a single hyphen-minus (-) is given as a nodeset, it will be read from standard input.
π EXTENDED PATTERNS π
The nodeset command benefits from ClusterShell NodeSet's basic arithmetic addition. This feature extends the recognized string patterns by supporting operators that match all the Operations we just talked about. String patterns are read left to right, processing any character operators accordingly. It's giving math class but cute. β¨
Supported character operators
,β indicates that the union of both the left and right nodeset should be computed before continuing!β indicates the difference operation&β indicates the intersection operation^β indicates the symmetric difference (XOR) operation
Careful bestie! You should escape these characters as needed when the shell doesn't interpret them literally. Your shell will absolutely snatch them otherwise. π
Examples of use of extended patterns
$ nodeset -f node[0-7],node[8-10]
node[0-10]
$ nodeset -f node[0-10]!node[8-10]
node[0-7]
$ nodeset -f node[0-10]&node[5-13]
node[5-10]
$ nodeset -f node[0-10]^node[5-13]
node[0-4,11-13]
Example of advanced usage
$ nodeset -f @gpu^@slurm:bigmem!@chassis[1-9/2]
This computes a folded nodeset containing nodes found in groups @gpu and @slurm:bigmem, but not in both, minus the nodes found in the odd chassis groups from 1 to 9. Chef's kiss. π
"All nodes" extension
The @* and @SOURCE:* special notations may be used in extended patterns to represent all nodes (in SOURCE) according to the all external shell command (see groups.conf(5)), and they're equivalent to:
$ nodeset [-s SOURCE] -a -f
Group names in expressions
The @@SOURCE notation may be used to access all group names from the specified SOURCE (or from the default group source when just @@ is used) in node set expressions. This works with either file-based group sources or with external group sources that have the list or mapall upcall defined (see groups.conf(5)):
$ nodeset -f @@rack
J[1-3]
π§ NODE WILDCARDS π§
Any wildcard mask found gets matched against all nodes from the group source (see groups.conf(5) and the -a/--all option above). Here's the tea:
*means match zero or more characters of any type?means match exactly one character of any type
This can be especially useful for server farms, or when cluster node names differ. π«Ά
Say your group configuration is set to return the following "all nodes":
$ nodeset -f -a
bckserv[1-2],dbserv[1-4],wwwserv[1-9]
Then you can use wildcards to select particular nodes, like this:
$ nodeset -f 'www*'
wwwserv[1-9]
$ nodeset -f 'www*[1-4]'
wwwserv[1-4]
$ nodeset -f '*serv1'
bckserv1,dbserv1,wwwserv1
Wildcard masks are resolved prior to extended patterns, but each mask is evaluated as a whole node set operand. In the example below, we select all nodes matching *serv* before removing all nodes matching www*:
$ nodeset -f '*serv*!www*'
bckserv[1-2],dbserv[1-4]
β EXIT STATUS β
An exit status of zero indicates success of the nodeset command. A non-zero exit status indicates failure. That's it, that's the vibe check. π
π₯ EXAMPLES π₯
Getting the node count
$ nodeset -c node[0-7,32-159]
136
$ nodeset -c node[0-7,32-159] node[160-163]
140
$ nodeset -c dc[1-2]n[100-199]
200
$ nodeset -c @login
4
Folding nodesets
$ nodeset -f node[0-7,32-159] node[160-163]
node[0-7,32-163]
$ echo node3 node6 node1 node2 node7 node5 | nodeset -f
node[1-3,5-7]
$ nodeset -f dc1n2 dc2n2 dc1n1 dc2n1
dc[1-2]n[1-2]
$ nodeset --axis=1 -f dc1n2 dc2n2 dc1n1 dc2n1
dc[1-2]n1,dc[1-2]n2
Expanding nodesets
$ nodeset -e node[160-163]
node160 node161 node162 node163
$ echo 'dc[1-2]n[2-6/2]' | nodeset -e
dc1n2 dc1n4 dc1n6 dc2n2 dc2n4 dc2n6
Excluding nodes from nodeset
$ nodeset -f node[32-159] -x node33
node[32,34-159]
Computing nodesets intersection
$ nodeset -f node[32-159] -i node[0-7,20-21,32,156-159]
node[32,156-159]
Computing nodesets symmetric difference (xor)
$ nodeset -f node[33-159] --xor node[32-33,156-159]
node[32,34-155]
Splitting nodes into several nodesets (expanding results)
$ nodeset --split=3 -e node[1-9]
node1 node2 node3
node4 node5 node6
node7 node8 node9
Splitting non-contiguous nodesets (folding results)
$ nodeset --contiguous -f node2 node3 node4 node8 node9
node[2-4]
node[8-9]
$ nodeset --contiguous -f dc[1,3]n[1-2,4-5]
dc1n[1-2]
dc1n[4-5]
dc3n[1-2]
dc3n[4-5]
β¨ bestie this page keeps going β part 2 is right there, don't go anywhere β¨
β¨ HISTORY β¨
okay so bestie, listen up, because the syntax has literally changed since the days of the nodeset command that shipped with ClusterShell v1.1. Back then the operations, like --intersection or -x, were specified before the nodesets on the command line. Now? They go between the nodesets. glow-up fr fr π
ClusterShell v1.1:
$ nodeset -f -x node[3,5-6,9] node[1-9]
node[1-2,4,7-8]
ClusterShell v1.2+:
$ nodeset -f node[1-9] -x node[3,5-6,9]
node[1-2,4,7-8]
see how the -x slid on in there between the two nodesets? that's the new way, the main character way π
also, cluset was added in 1.7.3 to avoid a conflict with xCAT's nodeset command, and also to conform with ClusterShell's "clu*" command nomenclature. iconic naming convention tbh π
πΈ SEE ALSO πΈ
https://clustershell.readthedocs.io/
go read those bestie, they're all part of the same friend group π«Ά
π BUG REPORTS π
found a bug? no cap, we wanna know. use the following URL to submit a bug report or feedback:
https://github.com/clustershell/clustershell/issues
not me asking you to tell us everything π please do though, we're obsessed with fixing things
π AUTHOR π
Stephane Thiell
β COPYRIGHT β
GNU Lesser General Public License version 2.1 or later (LGPLv2.1+)
and that's the whole page, bestie!! this was NODESET(1) from ClusterShell version 1.10.1, dated 2026-07-16. now go forth and set those nodes π
β¨π¦
π¦ where this page comes from
- arch rolling: clustershell 1.10.1-2 Β· LGPL-2.1-or-later
- epel 10: clustershell 1.10.1-1.el10_3 Β· LGPL-2.1-or-later
- epel 9: clustershell 1.10.1-1.el9 Β· LGPL-2.1-or-later
- fedora 43: clustershell 1.10.1-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: clustershell 1.10.1-1.fc44 Β· LGPL-2.1-or-later
- ubuntu stonking: clustershell 1.10.1-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms