Revision b6e88032
b/lib/client/gnt_cluster.py | ||
---|---|---|
397 | 397 |
cluster_name = cl.QueryConfigValues(["cluster_name"])[0] |
398 | 398 |
|
399 | 399 |
results = GetOnlineNodes(nodes=opts.nodes, cl=cl, filter_master=True, |
400 |
secondary_ips=opts.use_replication_network) |
|
400 |
secondary_ips=opts.use_replication_network, |
|
401 |
nodegroup=opts.nodegroup) |
|
401 | 402 |
|
402 | 403 |
srun = ssh.SshRunner(cluster_name=cluster_name) |
403 | 404 |
for node in results: |
... | ... | |
421 | 422 |
|
422 | 423 |
command = " ".join(args) |
423 | 424 |
|
424 |
nodes = GetOnlineNodes(nodes=opts.nodes, cl=cl) |
|
425 |
nodes = GetOnlineNodes(nodes=opts.nodes, cl=cl, nodegroup=opts.nodegroup)
|
|
425 | 426 |
|
426 | 427 |
cluster_name, master_node = cl.QueryConfigValues(["cluster_name", |
427 | 428 |
"master_node"]) |
... | ... | |
1288 | 1289 |
"", "Shows the cluster master"), |
1289 | 1290 |
'copyfile': ( |
1290 | 1291 |
ClusterCopyFile, [ArgFile(min=1, max=1)], |
1291 |
[NODE_LIST_OPT, USE_REPL_NET_OPT], |
|
1292 |
[NODE_LIST_OPT, USE_REPL_NET_OPT, NODEGROUP_OPT],
|
|
1292 | 1293 |
"[-n node...] <filename>", "Copies a file to all (or only some) nodes"), |
1293 | 1294 |
'command': ( |
1294 | 1295 |
RunClusterCommand, [ArgCommand(min=1)], |
1295 |
[NODE_LIST_OPT], |
|
1296 |
[NODE_LIST_OPT, NODEGROUP_OPT],
|
|
1296 | 1297 |
"[-n node...] <command>", "Runs a command on all (or only some) nodes"), |
1297 | 1298 |
'info': ( |
1298 | 1299 |
ShowClusterConfig, ARGS_NONE, [ROMAN_OPT], |
b/man/gnt-cluster.rst | ||
---|---|---|
37 | 37 |
COMMAND |
38 | 38 |
~~~~~~~ |
39 | 39 |
|
40 |
**command** [-n *node*] {*command*} |
|
40 |
**command** [-n *node*] [-g *group*] {*command*}
|
|
41 | 41 |
|
42 | 42 |
Executes a command on all nodes. If the option ``-n`` is not given, |
43 | 43 |
the command will be executed on all nodes, otherwise it will be |
... | ... | |
46 | 46 |
|
47 | 47 |
# gnt-cluster command -n node1.example.com -n node2.example.com date |
48 | 48 |
|
49 |
The ``-g`` option can be used to run a command only on a specific node |
|
50 |
group, e.g.:: |
|
51 |
|
|
52 |
# gnt-cluster command -g default date |
|
53 |
|
|
49 | 54 |
The command is executed serially on the selected nodes. If the |
50 | 55 |
master node is present in the list, the command will be executed |
51 | 56 |
last on the master. Regarding the other nodes, the execution order |
... | ... | |
67 | 72 |
COPYFILE |
68 | 73 |
~~~~~~~~ |
69 | 74 |
|
70 |
**copyfile** [--use-replication-network] [-n *node*] {*file*} |
|
75 |
| **copyfile** [--use-replication-network] [-n *node*] [-g *group*] |
|
76 |
| {*file*} |
|
71 | 77 |
|
72 | 78 |
Copies a file to all or to some nodes. The argument specifies the |
73 | 79 |
source file (on the current system), the ``-n`` argument specifies |
74 | 80 |
the target node, or nodes if the option is given multiple times. If |
75 |
``-n`` is not given at all, the file will be copied to all nodes. |
|
81 |
``-n`` is not given at all, the file will be copied to all nodes. The |
|
82 |
``-g`` option can be used to only select nodes in a specific node group. |
|
76 | 83 |
Passing the ``--use-replication-network`` option will cause the |
77 | 84 |
copy to be done over the replication network (only matters if the |
78 | 85 |
primary/secondary IPs are different). Example:: |
Also available in: Unified diff