-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
topology: *!compute
as root nodes
#553
Comments
If I understand you correctly, you have the following setup:
(most nodes: login, services, mgmt, ...) -> gateways (head nodes) ->
compute
In that case, the head nodes are what ClusterShell names Gateway, and
all other are potential root nodes.
Your config was almost good.
Regarding the group usage. There are very few places where CS expects a
group name and nothing else. This is the case mostly for group
definition, where you must specify a group name, then the group content,
which is a node pattern.
Everytime you must list a list of nodes, you can use a node pattern.
Topology.conf wants node list. The right to do it for you is:
@*!@heads!@compute: @heads
@heads: @compute
Or you can list the root nodes explicitly, if it is simpler.
Escaping is not needed, as this is not parsed by shell.
|
Yes, you can see it like that. Does it make a difference if I specify a group source instead of a group? Unfortunately it is still not working. Here is my
and this is how my default:
node: '@cluster:compute'
head: '@cluster:head'
login: '@cluster:login'
other: '<many other nodes>'
login:
login: 'login[01,02]'
test: login-test
head:
head: 'head'
compute:
cpu: 'node[001-010]'
cluster:
gateway: '@login:*,@head:*'
login: '@login:*'
head: '@head:*'
compute: '@compute:*' If I now run clush -d -v -w node010 -b 'hostname' I see
I guess the problem is caused by EDIT: |
@skwde You're right, the A possible workaround is to use groups in
This is an example to illustrate only, not sure this is exactly what you want. |
Perfect, it is working now. Thanks! For completeness I had to set export CLUSTERSHELL_GW_PYTHON_EXECUTABLE=<path to python executable> I still have some conceptual questions:
|
Yes.
There are ways to interpret the list of group from a groupsource as a unique group: ClusterShell 1.9 introduces a new operator Review https://clustershell.readthedocs.io/en/latest/tools/nodeset.html#listing-group-names-in-expressions But not the list of sources themselves, if this is what you want. You can style built your own sources based on that.
(I filtered out "groupsources" but you can keep it if you think it makes sense) I'll let you play with that, depending on what you want to achieve
Isn't
Yes. This is from the default source. |
Thanks a lot for your elaborate answers! They are indeed helpful!
Yes and No. clush -w $(nodeset -LL | awk '{print $1}' | nodeset -f) 'cmd' It would be good to have a operator for that. Besides, to my knowledge it is not possible to do above for just a single (YAML) file defining group sources. |
This is a more specific use case. Usually people are using different group sources for either managing different kind of hardware (compute, switches, racks, etc...) and they don't really want to run the same command on all of them.
That group query could be simplified:
I would recommend crafting your own specific group sources. One of the nice feature of ClusterShell is that possibility to easily declare your own source based on your exact needs, using shell commands. I put an example below based on the constrains I understood from your explanation.
Then
|
Thanks a lot for your explanation and example. Is there a way to get all nodes defined in a single source (YAML) without defining a specific group source in the file? |
(I would have not made this complex example if something like that would already exist ;) ) A YAML file is not a single source, but a way to declare between 1 and multiple sources. The CLI does not have the knowledge of in which config file the source was declared. If there is a behavior that you want and does not exist, do not hesitate to create your own source!
|
Alright thanks again. I am closing this now because we anyway deviated quite a bit from what I originally asked! Keep up the great work! |
To access our compute nodes (
compute
), we can go through a number of hosts (head
) accessible fromall
hosts (exceptcompute
) in our network.I tried to model that in
topology.conf
but non of my attempts worked.Initial config
Having only
leads to an error if I don't run the
clush
command from a machine inhead
.I.e. I get
If I specify the root node as the node I am currently running the command on
This works but is inconvenient because if I am on another machine than
<local machine>
clush
stops working with above error.I want to specify a group of machines for
<local machine>
.Extending root nodes to all nodes
In all my attempts I see the following problems
compute
is not ignored from the root nodes (seen viaclush -d
)clush: TREE MODE: Invalid root or gateway node: *,<other nodes expect compute>
I also tried to define a group in
*.yaml
and use that but also with no success.All of my problems above might be related to my lack of understanding about where and how groups / group sources can be used in the various config files (
topology.conf
,groups.d/*.yaml
).Unfortunately this is not clear to me from the docs.
Can you please clarify
@
is not always required to access a group, and should be even dropped in some cases?!\&
instead of just&
, is the escaping only required in the shell when not properly quoting?all!compute
as valid root machines intopology.conf
The text was updated successfully, but these errors were encountered: