Integrations
Clustershell
ClusterShell is a scalable cluster administration Python framework, designed to execute commands on many cluster nodes in parallel. ClusterShell supports the possibility to define groups of nodes. These groups can be extracted from external sources.
This section illustrates how to make ClusterShell extracts groups from RacksDB and tags associated to nodes with a simple example. In this example, let’s consider a cluster infrastructure named atlas.
Create file /etc/clustershell/groups.conf.d/racksdb.conf
with this content:
[racksdb]
map: racksdb nodes --infrastructure atlas --tags $GROUP --list
all: racksdb nodes --infrastructure atlas --list
list: racksdb tags --infrastructure atlas --on-nodes
reverse: racksdb tags --node $NODE
With this simple configuration, ClusterShell can extract groups and nodes from
RacksDB. For example, with nodeset
command:
-
Get the list of groups:
$ nodeset -s racksdb -l @racksdb:admin @racksdb:compute @racksdb:login
-
Get all nodes in compute group (ie. associated to compute tag in database):
$ nodeset -f @racksdb:compute atcn[1-2]
-
Get all nodes in this cluster:
$ nodeset -f -s racksdb -a atadmin,atcn[1-2],atlogin
ClusterShell can execute commands on nodes from these groups with clush
:
# clush -bw @racksdb:compute uname
---------------
atcn[1-2] (2)
---------------
Linux
This way, ClusterShell groups are always synchronized with tags and content of RacksDB database. when RacksDB database is updated, changes are automatically reflected in ClusterShell.