Skip to content
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

Treemode Exception: 'host01' is not a valid root node #571

Open
luxiaoyong opened this issue Nov 5, 2024 · 4 comments
Open

Treemode Exception: 'host01' is not a valid root node #571

luxiaoyong opened this issue Nov 5, 2024 · 4 comments

Comments

@luxiaoyong
Copy link

I encountered a problem when using clush in tree mode. When my hostname (host01.a.b) contains a dot and is used as the root node, clush throws an error:

clush: TREE MODE: "host01" is not a valid root node!

However, I found that when not using tree mode, the following command can be executed successfully. Is this a bug?

clush -w host01.a.b whoami
@degremont
Copy link
Collaborator

Hello. Could you provide your tree configuration?

@luxiaoyong
Copy link
Author

Hi, @degremont, thank you for your attention to our questions. Our topology.conf file content is:

[routes]
host01.a.b:Controller-vm2,Controller-vm3
Controller-vm2:Comp101,Computer102
Controller-vm3:Comp335,Computer336

Environment hostname:

[root@host01 ~]$ hostname
host01.a.b

Execute cmd:

[root@host01 ~]$ clush -o-q -w Computer102 whoami
clush: TREE MODE: "host01" is not a valid root node!

@degremont
Copy link
Collaborator

Indeed, the code compare what is in your config file with the local short hostname

https://github.com/cea-hpc/clustershell/blob/master/lib/ClusterShell/Task.py#L426

@luxiaoyong
Copy link
Author

Indeed, the code compare what is in your config file with the local short hostname

https://github.com/cea-hpc/clustershell/blob/master/lib/ClusterShell/Task.py#L426

Hi @degremont , thank you very much for your reply. However, I found that when not using the treemode, hostnames with dots are supported, as shown in the following command:

clush -w host01.a.b whoami

Can the treemode remove the restrictions on hostname names? Why do we need to take the part of the hostname before the dot?

def _getshorthostname():
    """Get short hostname (host name cut at the first dot)"""
    return socket.gethostname().split('.')[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants