-
-
Save mshuler/94e7ea89c48048797674c37876945a84 to your computer and use it in GitHub Desktop.
lsyncd and configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local hostname = os.getenv("HOSTNAME") | |
local package = os.getenv("PACKAGE") | |
assert(hostname, "HOSTNAME env variable is not set") | |
assert(package, "PACKAGE env variable is not set") | |
local privateKey = "/usr/share/" .. package .. "/etc/id_rsa" | |
settings { | |
statusFile = "/var/run/" .. package .. "/lsyncd.stat", | |
statusInterval = 60, | |
nodaemon = true, | |
-- maxDelays = 100, | |
-- maxProcesses = 2, | |
} | |
-- OPS-STORAGE | |
local storage_enabled = false | |
if (storage_enabled) then | |
sync { | |
default.rsync, | |
source = "/var/lib/fk-pf-cfgsvc/data", | |
target = "storage::fk-storage/ConfigServiceData/" .. hostname, | |
exclude = { | |
"*.tmp", | |
}, | |
rsync = { | |
verbose = false, | |
timeout = 120, | |
}, | |
-- delete = false, | |
} | |
end | |
-- PEER SERVER | |
local peers = { | |
["pf-config-manage-1"] = "pf-config-manage-2", | |
["pf-config-manage-2"] = "pf-config-manage-1", | |
["stage-pf-config-manage-1"] = "stage-pf-config-manage-2", | |
["stage-pf-config-manage-2"] = "stage-pf-config-manage-1", | |
} | |
if (peers[hostname]) then | |
sync { | |
default.rsync, | |
source = "/var/lib/fk-pf-cfgsvc/data", | |
target = peers[hostname] .. ":/var/lib/fk-pf-cfgsvc/" .. hostname, | |
exclude = { | |
"*.tmp", | |
}, | |
rsync = { | |
verbose = false, | |
timeout = 120, | |
_extra = { | |
"-e ssh -i " .. privateKey .. " -l fk-pf-cfgsvc -o StrictHostKeyChecking=no" | |
}, | |
}, | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget https://lsyncd.googlecode.com/files/lsyncd-2.1.4.tar.gz | |
$ sudo apt-get install lua5.1 liblua5.1-dev | |
$ ./configure | |
# comment out the check for asciidoc if it errors out and run configure again | |
$ make |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment