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 requires you to enter redundant information, too:

That's where clucp comes into play. 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 highly 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

  1. Either take an RPM from below, or compile clucp on your own. You'll need a C compiler, make (GNU or BSD), and corosynclib-devel for that:
    tar xf clucp-2.tar.bz2
    cd clucp-2
    make
    
  2. On FreeBSD:
    sudo make install.freebsd
    
  3. On RedHat based Linux:
    sudo make install.redhat
    

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 2 (released 2025-03-07)

Version 0.1 (released 2012-10-29)