Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (62 sloc) 3.69 KB

INSTALL - lipsync

To get started with lipsync you need at least a client and a server, preferably on multiple systems.

Server install

Install required software

Debian (squeeze) / Ubuntu (maverick)

apt-get install openssh-server rsync

Create a user to sync with, should be the same name as the one on the client

useradd -U -m -d /home/USER -p PASSWORD -s /bin/bash USER

Verfiy the account was created, and setup a sync directory to sync with

su - USER
mkdir ~/sync

Client install

Debian (Squeeze or earlier) and Ubuntu (lsyncd 2.0.x)

apt-get install lua5.1 liblua5.1-0-dev liblua50-dev liblualib50-dev

wget http://lsyncd.googlecode.com/files/lsyncd-2.0.3.tar.gz
tar -zxf lsyncd-2.0.3.tar.gz
cd lsyncd-2.0.3
./configure
make
make install

Debian (Wheezy and above) (lsyncd 2.0.x)

apt-get install lsyncd

Uninstall/remove

/etc/init.d/lipsyncd
/etc/lipsyncd.conf.xml
/usr/local/bin/lsyncd
/usr/bin/lsync*
/usr/bin/lipsync
crontab -u USERNAME -r

new CRON

rsync -r -a -v -e "ssh -l phil" --delete 64.34.219.15:/home/phil/sync/ /home/phil/sync/

Install required software

Debian (squeeze) / Ubuntu (maverick)

apt-get install openssh-client rsync unison lsyncd

Create a user to sync with, should be the same as the one on the server

useradd -U -m -d /home/USER -p PASSWORD -s /bin/bash USER

Verfiy the account was created, and setup a sync directory to sync with

su - USER
mkdir ~/sync

Install lipsync (if installing from git, first apt-get git-core)

cd lipsync
chmod +x setup

NOTE: during setup, define server IP, path to sync, username and password, so have those ready.

Then run the setup script

./install.sh

After you've answered the questions, watch the script's output for errors. Then, check the logs to see if lipsyncd started successfully.

tail -f /home/$USERNAME/.lipsyncd/lipsyncd.log

Test

Open 3 terminals

Terminal 1 - on the client, become root and watch the logfile

tail -f /home/$USERNAME/.lipsyncd/lipsyncd.log

Terminal 2 - on the client, become your normal user

su - USER

Terminal 3 - on the server, run a watch on the sync directory

watch ls -l /home/$USERNAME/sync

NOTE: this terminal will refresh every 2s by default

Terminal 2 - on the client, create a new file in the sync directory

touch sync/testfile

At this point you should see action on the logfile (Terminal 1), and after a few seconds delay, the file should appear in the server's sync directory (Terminal 2). If this worked, then delete the file on the client (Terminal 2) and see if that change propagates to the server (Terminal 3).

Now try more complex situations by using directories that are full of other files, then file or directory names with spaces in them, then ones with special characters (!@#$%^&*_-) in them. These should all work the same as the initial examples, always propagating to the server after a slight delay (the delay occurs so lsyncd can prevent spinning up for every little change - if there are other changes after the first one they will be chained to the one sync, making things more efficient).

Install more clients

Now that you have a working 2 node setup, it's time to install on more clients. All you need to do is follow the same client install directions on each client you add. Be sure to use the same server IP or domainname, this way Unison will work in a star style setup, with the server being the hub, and the clients all serving as spokes. This way the hub 'wins' if it has something the spokes need, but will sync-up by deleting any missing files from the spoke in the hub. It sounds more complicated than it is, but suffice to say, it works.