zoukankan      html  css  js  c++  java
  • 使用lsyncd配置数据库备份多异地同步

    lsyncd配置文件

    settings {
        logfile = "/var/log/lsyncd.log", --日志路径
        status = "/var/log/lsyncd.status", --状态文件
        pidfile = "/var/run/lsyncd.pid", --pid文件路径
        statusInterval = 1,  --状态文件写入最短时间
        maxProcesses = 4,    --最大进程
        maxDelays = 1        --最大延迟
    }
    --多host同步
    servers = {
        "192.168.1.1"
    }
    -- 多同步目录,源备份用路径和rsync节点名相同
    bakpaths = {
        "mysql",
        "mongodb",
        "mssql"
    }
    -- 源路径
    source_path='/dbbackup/'
    for _, server in ipairs(servers) do
        for _, bakpath in ipairs(bakpaths) do
        sync {
            default.rsync,
            source = source_path..bakpath,
            target = server.."::"..bakpath,
            delete = "running",
            exclude = { 
            },  
            rsync = {
                binary = "/usr/local/bin/rsync", -- rsync 版本要到3以上
                archive = true,
                compress = true,
                owner = false,
                group = false,
                perms = true,
                verbose = true,
                copy_links = true
            }   
        }   
        end
    end
    

      

  • 相关阅读:
    springmvc
    POJ 3683 Priest John's Busiest Day
    POJ 3678 Katu Puzzle
    HDU 1815 Building roads
    CDOJ UESTC 1220 The Battle of Guandu
    HDU 3715 Go Deeper
    HDU 3622 Bomb Game
    POJ 3207 Ikki's Story IV
    POJ 3648 Wedding
    HDU 1814 Peaceful Commission
  • 原文地址:https://www.cnblogs.com/ivistn/p/3906897.html
Copyright © 2011-2022 走看看