Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am on Amazon EC2 and trying to sync two directories(/var/www/html) on my instance together with lsyncd but I am receiving this error in the log:

rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
Mon Dec  5 05:43:36 2011 Error: Failure on startup of '/var/www/html/'.
Mon Dec  5 05:47:38 2011 Normal: recursive startup rsync: /var/www/html/ -> 10.xxx.xx.xx2:/var/www/html/
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
Mon Dec  5 05:47:38 2011 Error: Failure on startup of '/var/www/html/'.

Here is my configuration.

[root@ip-xxx ec2-user]# vi /etc/lsyncd.conf
settings = {
        logfile    = "/tmp/lsyncd.log",
        statusFile = "/tmp/lsyncd.stat",
        statusInterval = 1,
}

sync{
        default.rsync,
        source="/var/www/html",
        target="10.xxx.xx.xx2:/var/www/html/",
        rsyncOps="-avlt",
}

Receiving server:

[root@ip-xxx ec2-user]# vi /etc/rsyncd.conf
[application]
        path = /var/www/html
        hosts allow = 10.xxx.xx.xx1
        log file = /tmp/rsyncd.log
        uid = ec2-user
        gid = ec2-user
        read only = false

What am I doing wrong?

share|improve this question
    
Do you have the appropriate public keys/host configuration for the two machines? –  Conspicuous Compiler Dec 5 '11 at 6:33
    
@Conspicuous Compiler - I just "ssh-keygen -t rsa -N" and scp to my other instance (/root/.ssh/authorized_keys2) –  Maca Dec 5 '11 at 6:47
1  
@Mica: And if you ssh 10.xxx.xx.xx2 from the sending server, it connects without prompting you? –  Conspicuous Compiler Dec 5 '11 at 6:53
    
@Conspicuous Compiler - No, I still need to specify as: ssh .ssh/key.pem ec2-user@10.xxx.xx.xxx in order to remote SSH –  Maca Dec 5 '11 at 7:33
    
@Conspicuous Compiler - you were right i needed to add hosts in ssh/config ! –  Maca Dec 5 '11 at 8:38
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.