csync2 install

FreeBSD Installation tips

csync2 install

Postby stephen » Fri Apr 09, 2010 7:06 pm

Web Site
csync2. the full name is "cluster synchronization tool, 2nd generation"
http://oss.linbit.com/csync2/

How to Install Blog
http://zhenhuiliang.blogspot.com/


Install using the ports system
cd /usr/ports/net/csync2
make install

echo "csync2 30865/tcp" >> /etc/services

add csync2 to inetd
vi /etc/inetd.conf
csync2 stream tcp nowait root /usr/local/sbin/csync2 csync2 -
i


# cd /usr/local/etc/
# cp csync2.cfg-dist csync2.cfg
# vi csync2.cfg
# cat /usr/local/etc/csync2.cfg
Code: Select all

# Csync2 Example Configuration File
# ---------------------------------
#
# Please read the documentation:
# http://oss.linbit.com/csync2/paper.pdf

group mygroup
{
        host xxx1 xxxx2;

        key /etc/csync2.key_mygroup;

        include /etc/apache;
        include /var/www;
#       include %homedir%/bob;
#       exclude %homedir%/bob/temp;
#       exclude *~ .*;

        action
        {
                pattern /etc/apache/httpd.conf;
                pattern /etc/apache/sites-available/*;
                exec "/usr/sbin/apache2ctl graceful";
                logfile "/var/log/csync2_action.log";
                do-local;
        }

        backup-directory /var/backups/csync2;
        backup-generations 3;

        auto none;
 }

# prefix homedir
# {
#       on host[12]: /export/users;
#       on *:        /home;
# }



Create a certificate
openssl genrsa \
-out /etc/csync2_ssl_key.pem 1024

openssl req -new \
-key /etc/csync2_ssl_key.pem \
-out /etc/csync2_ssl_cert.csr

openssl x509 -req -days 600 \
-in /etc/csync2_ssl_cert.csr \
-signkey /etc/csync2_ssl_key.pem \
-out /etc/csync2_ssl_cert.pem

Generate the Pre Shared Key
# csync2 -k /etc/csync2.key_mygroup
stephen
 
Posts: 507
Joined: Thu Feb 09, 2006 9:37 am
Location: Brisbane

Return to FreeBSD

Who is online

Users browsing this forum: No registered users and 3 guests

cron