[c3-users] cconfig v0.99 (smart replacement for c3_conf_manager)

LAHAYE Olivier olivier.lahaye at cea.fr
Thu Apr 3 14:07:33 EDT 2014


Hi,

After few days of development, I've finaly reached a step were cconfig the c3_conf_manager full replacement is ready for "release candidate".
Feel free to test and report bugs.

What is really cconfig?

cconfig is a command line to to edit update and manage c3.conf file.
it is able to:
- Add or remove clusters
- Add or remove nodes from clusters. can handle ranges with or without padding
  for example, range node[000-999] will end as node00[0-9] node0[10-99] node[100-999] in c3.conf
- Enable or disable nodes can handle dead or excludes
- Check that c3.conf is ok (also check for known hosts (head and nodes) and pingable nodes).
- Sort nodes
- list clusters
- list nodes
- set default cluster
- handle or not the dead dummy node trick to avoid zero indexing
- update nodes statuses (mak dead nodes that ping alive and alivenodes that do not resolv or ping as dead. Usefull in a crontab

Many command can be restricted to a cluster or a subset of nodes within that cluster (update, disablenodes, enablenodes, ...)

For more information, see the manual:
=> pod2man cconfig |nroff -man |more

To get cconfig:
wget http://svn.oscar.openclustergroup.org/oscar/trunk/bin/cconfig

To test, the --dry-run switch allows to avoid writing the result to c3.conf.
alternate c3.conf file can be specified using the --file switch.

Here are attached some example of what can be done.
# Creating a cluster:
./cconfig addcluster --cluster MegaCluster --nodes HeadHammer foo bar "test[02-09]" --noresolv --file /tmp/c3.conf

# Creating a virtual cluster:
./cconfig addcluster --cluster VirtualOne --nodes :remotehead --noresolv --file /tmp/c3.conf

# Creating a third cluster with no dummy dead entry (use zero indexing)
# The 1st node is a real node with name dummy
./cconfig addcluster --cluster Zero --nodes local:private dummy wow[0-9] --zero --noresolv --file /tmp/c3.conf

# disabling 1st node. this will result in a "dead dummy" entry as 1st node (index 0).
# if --noresolv is used, then cconfig has no way to determine if node is a real node and will
# ignore it if not specificaly specified with --nodes.
./cconfig disablenodes --cluster Zero --nodes dummy wow[0-5] --file /tmp/c3.conf

# Adding nodes:
./cconfig addnodes --cluster MegaCluster --nodes node1 node2 node3 "ulys[31-34]" zzz test01 --sortnodes --noresolv --file /tmp/c3.conf

# Removing nodes:
./cconfig delnodes --cluster MegaCluster --nodes ulys[32-34] zzz --file /tmp/c3.conf

# List known clusters:
./cconfig listclusters --file /tmp/c3.conf

# Enabling nodes in a cluster (sorting it at the same time)
./cconfig enablenodes --cluster MegaCluster --sortnodes --noresolv --file /tmp/c3.conf

# enabling all nodes in cluster Zero: ("dead dummy" is untouched this time)
./cconfig enablenodes --cluster Zero --noresolv --file /tmp/c3.conf

# But this time it is enabled.(in normal situation without --noresolv, if the "dummy" node
# can be resolved (get ip), the command below wouldn't have been necessary).
./cconfig enablenodes --cluster Zero --nodes dummy --noresolv --file /tmp/c3.conf

#
# Updating nodes status using ping.
# Dead nodes that respond are enable
# alive nodes that do not respond are disabled.
# Update status of upper half nodes.
./cconfig update --cluster MegaCluster --nodes test[05-09] --noresolv --file /tmp/c3.conf

# Do a full update (all clusters).
./cconfig update --noresolv --file /tmp/c3.conf

# Disable some nodes for maintenance (e.g. power outage of a rack)
./cconfig disablenodes --cluster MegaCluster --nodes foo test[01-03] test[06-08] --file /tmp/c3.conf

# Deleting a cluster: (we do a dry-run this time, thus the output on stdout).
./cconfig delcluster --cluster MegaCluster --dry-run --file /tmp/c3.conf

# Now play with ranges and excludes.
# 1st create a big cluster with padding.
./cconfig addcluster --cluster oscar_cluster --nodes oscarnode[000-999] --file /tmp/c3.conf --noresolv --file /tmp/c3.conf
# 2nd disable rack 5 that hosts nodes 090 to 120 to fix a PDU problem.
./cconfig disablenodes --cluster oscar_cluster --nodes oscarnode[090-120] --file /tmp/c3.conf --file /tmp/c3.conf
# 3rd after restart only a few nodes have power, reenable them
./cconfig enablenodes --cluster oscar_cluster --nodes oscarnode[095-105] --file /tmp/c3.conf --noresolv --file /tmp/c3.conf
# 4th everything fiwxed, reenable all nodes
./cconfig enablenodes --cluster oscar_cluster --file /tmp/c3.conf --noresolv --file /tmp/c3.conf

Best regards,

Olivier.
--
   Olivier LAHAYE
   CEA DRT/LIST/DIR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://elist.ornl.gov/pipermail/c3-users/attachments/20140403/8da8e488/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cconfig_test.sh
Type: text/x-sh
Size: 3452 bytes
Desc: cconfig_test.sh
URL: <https://elist.ornl.gov/pipermail/c3-users/attachments/20140403/8da8e488/cconfig_test.sh>


More information about the c3-users mailing list