default.rsyncssh must have maxProcesses set to 1.的解决方法

By admin at 2021-04-18 03:53 • 42次点击
admin


很奇怪,今天使用lsyncd同步文件时出现了下面错误

Error: error preparing /etc/lsyncd.conf: /etc/lsyncd.conf:8: default.rsyncssh must have maxProcesses set to 1.

从字面也可以理解上面的意思了,使用default.rsyncssh模式时

同步最大进程要设置为1maxProcesses 1

下面是详细的lsyncd实时同步代码

settings {
    nodaemon = false,
    logfile = "/var/log/lsyncd.log",
    pidfile = "/var/run/lsyncd.pid",
    statusFile = "/var/log/lsyncd.status",
    inotifyMode = "CloseWrite or Modify",",
    maxProcesses = 1,
}


sync {
    default.rsyncssh,
    source    = "/var/www/www/",
    host      = "host1",
    targetdir = "/var/www/www/",
    delay = 0,
    init = false,
    rsync = {
        binary = "/usr/bin/rsync",
        archive = true,
        compress = true,
        verbose = true,
        },
}

sync {
    default.rsyncssh,
    source    = "/var/www/www/",
    host      = "host2",
    targetdir = "/var/www/www/",
    delay = 0,
    init = false,
    rsync = {
        binary = "/usr/bin/rsync",
        archive = true,
        compress = true,
        verbose = true,
        },
}

注意,有个很重要的问题,如果发现lsyncd没有自动同步,首先需要手动同步一次文件

rsync -vzrtopgur /var/www/www/ root@domin:/var/www/www/ --exclude 'data'



也许我的文章解决了你的问题,如果没有那很抱歉,
真诚希望您能把本站开启广告白名单,谢谢您~
联系邮箱vpslala#foxmail.com


鄙人非专业程序員,只是一个深度网瘾者,爱好折腾网络
现在百分之九十的都开启了广告过滤,更新不易.
请我喝杯咖啡吧,是我一直更新下去不删库跑路的动力.


打赏


rsyncssh, set, default, maxProcesses, 解决


目前尚无回复
登录 后发表评论