Running csync2 with different hostnames

The paper for csync2 is a bit unclear to me, when it comes to hosts with different hostnames for two or more interfaces. I often ended up in trying to solve my problem in the following way, that luckily solves my problems without big troubles.

Let’s assume, you have two hosts with their public names test1.suse.de and test2.suse.de, which are also connected via a second network and their hostnames stay more or less the same, but the domain changes: test1.test.suse.de and test2.test.suse.de (yes: this works ;-)

To avoid confusion and longer try and error setups, I use the following way:

In the /etc/csync2/csync2.cfg file, use the line:
host csync2test1 csync2test2;
…and adapt the xinetd configuration file /etc/xinetd.d/csync2 to use:
server_args = -N csync2test1 -i
resp.
server_args = -N csync2test2 -i
according to your hosts.

Now create an alias for your csync2 command line call in ~/.alias (or wherever you like to place such alias definitions – I used the one that is included in SUSE per default here):
alias csync2="csync2 -N csync2test1"
and
alias csync2="csync2 -N csync2test2"
on the other node.

For keeping it save (and avoid that someone uses this ugly hostname), just also reserve the DNS entry of this new hosts (csync2test1 and csync2test2) in the network you are using to synchronize via csync2.

After restarting your xinetd servers and sourcing the alias file via
source ~/.alias
everything should work as expected when you call for example csync2 -xv (assuming you followed the rest of the paper correctly).

About these ads

About lvogdt

This is the private blog space of Lars Vogdt, the topics will be in first place work related.
This entry was posted in network, openSUSE, SUSE Linux Enterprise and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s