syncd 实时同步无法使用?


也不知道是哪里的问题,直接就没反应,一直在弹通知,目标服务器也没见更新内容


text

下面是我的设置




text
text
text
text

上传的附件:
最新回复 (8)
  • 小鱼儿 2018-6-28
    引用 2

    1 你的配置有问题, 导致启动失败
    2 你开启了进程守护, 在启动失败后会自动尝试重启, 所以会有通知.

    现在你需要开启日志, 然后重启,获取错误日志.

    先执行
    tail -f /var/log/messages

    然后启动lsyncd

    然后将输出的日志截图提供下.

  • [root@VM_0_41_centos ~]# tail -f /var/log/messages
    Jun 28 15:48:11 VM_0_41_centos systemd: lsyncd.service failed.
    Jun 28 15:48:59 VM_0_41_centos systemd: Started Session 51 of user root.
    Jun 28 15:48:59 VM_0_41_centos systemd-logind: New session 51 of user root.
    Jun 28 15:48:59 VM_0_41_centos systemd: Starting Session 51 of user root.
    Jun 28 15:48:59 VM_0_41_centos dbus-daemon: dbus[622]: [system] Activating service name='org.freedesktop.problems' (using servicehelper)
    Jun 28 15:48:59 VM_0_41_centos dbus[622]: [system] Activating service name='org.freedesktop.problems' (using servicehelper)
    Jun 28 15:48:59 VM_0_41_centos dbus[622]: [system] Successfully activated service 'org.freedesktop.problems'
    Jun 28 15:48:59 VM_0_41_centos dbus-daemon: dbus[622]: [system] Successfully activated service 'org.freedesktop.problems'
    Jun 28 15:49:01 VM_0_41_centos systemd: Started Session 52 of user root.
    Jun 28 15:49:01 VM_0_41_centos systemd: Starting Session 52 of user root.
    Jun 28 15:49:23 VM_0_41_centos systemd: Started Live Syncing (Mirror) Daemon.
    Jun 28 15:49:23 VM_0_41_centos systemd: Starting Live Syncing (Mirror) Daemon...
    Jun 28 15:49:23 VM_0_41_centos lsyncd: ssh: connect to host 这是IP  port 22: Connection refused
    Jun 28 15:49:23 VM_0_41_centos lsyncd: rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    Jun 28 15:49:23 VM_0_41_centos lsyncd: rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]
    Jun 28 15:49:23 VM_0_41_centos lsyncd: 15:49:23 Error: Temporary or permanent failure on startup of /data/mystack/sites/api/www/yueji_api/ -> root@这是IP:/data/mystack/sites/api/www/yueji_api/. Terminating since "insist" is not set.
    Jun 28 15:49:23 VM_0_41_centos lsyncd: 15:49:23 Normal: --- Startup ---
    Jun 28 15:49:23 VM_0_41_centos lsyncd: 15:49:23 Normal: recursive startup rsync: /data/mystack/sites/api/www/yueji_api/ -> root@这是IP:/data/mystack/sites/api/www/yueji_api/
    Jun 28 15:49:23 VM_0_41_centos systemd: lsyncd.service: main process exited, code=exited, status=255/n/a
    Jun 28 15:49:23 VM_0_41_centos systemd: Unit lsyncd.service entered failed state.
    Jun 28 15:49:23 VM_0_41_centos systemd: lsyncd.service failed.
    Jun 28 15:49:32 VM_0_41_centos systemd: Started Live Syncing (Mirror) Daemon.
    Jun 28 15:49:32 VM_0_41_centos systemd: Starting Live Syncing (Mirror) Daemon...
    Jun 28 15:49:32 VM_0_41_centos lsyncd: ssh: connect to host 这是IP port 22: Connection refused
    Jun 28 15:49:32 VM_0_41_centos lsyncd: rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    Jun 28 15:49:32 VM_0_41_centos lsyncd: rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]
    Jun 28 15:49:32 VM_0_41_centos lsyncd: 15:49:32 Error: Temporary or permanent failure on startup of /data/mystack/sites/api/www/yueji_api/ -> root@这是IP:/data/mystack/sites/api/www/yueji_api/. Terminating since "insist" is not set.
    Jun 28 15:49:32 VM_0_41_centos lsyncd: 15:49:32 Normal: --- Startup ---
    Jun 28 15:49:32 VM_0_41_centos lsyncd: 15:49:32 Normal: recursive startup rsync: /data/mystack/sites/api/www/yueji_api/ -> root@这是IP:/data/mystack/sites/api/www/yueji_api/
    Jun 28 15:49:32 VM_0_41_centos systemd: lsyncd.service: main process exited, code=exited, status=255/n/a
    Jun 28 15:49:32 VM_0_41_centos systemd: Unit lsyncd.service entered failed state.
    Jun 28 15:49:32 VM_0_41_centos systemd: lsyncd.service failed.
  • 小鱼儿 2018-6-28
    引用 4
    日志写的很清楚了 
    ssh: connect to host 这是IP port 22: Connection refused

    ssh 连接被拒绝了. 
    需要检查下 ssh 连接是否可用. 比如端口, 密码, 用户名, 防火墙 
  • Jun 28 16:12:15 VM_0_41_centos lsyncd: Warning: Permanently added '[ip]:22' (ECDSA) to the list of known hosts.
    Jun 28 16:13:01 VM_0_41_centos systemd: Started Session 79 of user root.
    Jun 28 16:13:01 VM_0_41_centos systemd: Starting Session 79 of user root.


    是不是这样就算成功了呢?
  • 小鱼儿 2018-6-28
    引用 6
    检验一下不就知道了
     新建一个文件, 然后看看有没有同步过去
  • Jun 28 17:01:08 VM_0_41_centos lsyncd: 17:00:56 Normal: Finished a list after exitcode: 0
    Jun 28 17:01:08 VM_0_41_centos lsyncd: 17:01:08 Normal: --- TERM signal, fading ---
    Jun 28 17:01:08 VM_0_41_centos systemd: lsyncd.service: main process exited, code=exited, status=143/n/a
    Jun 28 17:01:08 VM_0_41_centos systemd: Unit lsyncd.service entered failed state.
    Jun 28 17:01:08 VM_0_41_centos systemd: lsyncd.service failed.


    还是不行。。。真难啊!
  • 小鱼儿 2018-6-28
    引用 8
    现在启动状态还是失败吗? 你的ssh已经ok是吧, 然后还是无法启动?
  • 小鱼儿 2018-6-28
    引用 9
     检查下对方ssh的sftp功能是否有开启.
返回
发新帖