clucp

Intro

Calling scp /etc/my.cnf node2:/etc/ on a node which is part of a Corosync cluster gets annoying after a while. That command has also redundant information in it:

That's where clucp comes in. It enables you to copy one or multiple files among all cluster nodes with just one command. It depends on Corosync, which is also the basis for Pacemaker, a cluster resource manager, which is in charge of making resources like ip addresses and services high available. On each cluster node you have to start an additional service called clucpd. Then, you can copy a file from one node to all other nodes:
[root@node1 ~]# clucp /etc/hosts
Add -v to see what's happening:
[root@node1 ~]# clucp -v /etc/hosts
sending /etc/hosts (158 B) to 1 node
node 673753280 (192.168.40.168): OK
You can copy multiple files at a time:
[root@node1 ~]# clucp -v /etc/hosts /etc/resolv.conf 
sending /etc/hosts (158 B) to 1 node
node 673753280 (192.168.40.168): OK
sending /etc/resolv.conf (96 B) to 1 node
node 673753280 (192.168.40.168): OK
List all nodes which have joined the cluster and started clucpd:
[root@node1 ~]# clucp -l
I       group   node id         pid     addrs
*       clucp   36219072        1601    192.168.40.167
        clucp   673753280       2116    192.168.40.168
Hint: A star in the column labeled I denotes the node you're currently working on.
Since clucp uses Corosync, all messages are authenticated and encrypted. Think of corosync-keygen and /etc/corosync/authkey.

Installation

Take either an RPM from below or compile clucp on your own. You'll need a C compiler, make, and corosynclib-devel for that:

tar -xjf clucp-0.1.tar.bz2
cd clucp-0.1
make
sudo make install
The RPM installs binaries below /usr, whereas the source package installs them below /usr/local unless you call make install with a prefix:
sudo make prefix=/opt/clucp install

Download

Version 0.1 (released 2012-10-29)