首页 > 数据库技术 > 详细

使用lsyncd配置数据库备份多异地同步

时间:2014-08-12 13:07:54      阅读:525      评论:0      收藏:0      [点我收藏+]

 

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

  

使用lsyncd配置数据库备份多异地同步,布布扣,bubuko.com

使用lsyncd配置数据库备份多异地同步

原文:http://www.cnblogs.com/ivistn/p/3906897.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!