admin avatar

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

🕣 by admin





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

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

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

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

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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/ [email protected]:/var/www/www/ --exclude 'data'





💘 相关文章

写一条评论

Based on Golang + fastHTTP + sdb | go1.18.3 Processed in 1ms