lsyncdでftpとか
lsyncdで、rsyncじゃなくて、FTPつかいたいなーとか、
lsyncしたファイルの情報をdbにつっこみたいとかできないかと
調べてたら、デフォルトのconfを修正すれば、出来そうな感ですた。
サンプルのconfをコピーして、(yumでいれてるとこのへん)
cp -p /usr/share/doc/lsyncd-2.0.4/examples/lbash.lua /etc/lsyncd.conf
#cpコマンドを/home/ftpscript.shにかえただけですが、
cpオプションと同じ動きをするように作ればいけるんじゃないでしょうかと。
--------------------------------------------------------------------------------------
-----
-- User configuration file for lsyncd.
--
-- This example uses local bash commands to keep two local
-- directory trees in sync.
--
settings = {
logfile = "/tmp/lsyncd.log",
statusFile = "/tmp/lsyncd.stat",
statusIntervall = 1,
nodaemon = true,
}
-----
-- for testing purposes. prefix can be used to slow commands down.
-- prefix = "sleep 5 && "
--
prefix = "sleep 2 &&"
-----
-- for testing purposes. uses bash command to hold local dirs in sync.
--
bash = {
delay = 0,
maxProcesses = 1,
-- calls `/home/ftpscript.sh -r SOURCE/* TARGET` only when there is something in SOURCE
-- otherwise it deletes contents in the target if there.
onStartup = [[
if [ "$(ls -A ^source)" ]; then
/home/ftpscript.sh ^source* ^target;
else
if [ "$(ls -A ^target)" ]; then rm -rf ^target/*; fi
fi]],
onCreate = prefix..[[ /home/ftpscript.sh -r ^sourcePath ^targetPathdir]],
onModify = prefix..[[ /home/ftpscript.sh -r ^sourcePath ^targetPathdir]],
onDelete = prefix..[[ /home/ftpscript.sh -rf ^targetPath]],
onMove = prefix..[[ /home/ftpscript.sh ^o.targetPath ^d.targetPath]],
}
sync{bash, source="/tmp/aaa", target="/tmp/"}
--------------------------------------------------------------------------------------
- 2012.01.27 Friday
- -
- 17:31
- comments(0)
- trackbacks(0)
- -
- -
- by orz
mod_proxy_balancerの忘れやすい設定とか
balancermenberの設定で、retly,loadfactor,statusを設定した。
忘れそうなので、メモ。
loadfactor:バランサーの重みづけ
retry:タイムアウト時のリトライ回数
status:D=disabled,S=stopped,i= ignore-errors,H=hot-standby
lbset:ロードバランサーのセット番号。複数セットを作成するときにあれこれ
route:stickysessionを使用しなければとくにはいらなそうな感じかな
試しに設定した感じで
<Proxy balancer://cluster>
BalancerMember http://*.*.*.*:8080 retry=3 loadfactor=10 status=D route=r1 lbset=1
BalancerMember http://*.*.*.*:8080 retry=3 loadfactor=10 route=r2 lbset=1
</Proxy>
ProxyPass /hoge balancer://cluster/hoge timeout=2
管理画面の画像とか
- 2012.01.12 Thursday
- -
- 11:54
- comments(0)
- trackbacks(0)
- -
- -
- by orz
calendar
selected entries
- 2012年01月30日のつぶやき (01/31)
- lsyncdでftpとか (01/27)
- あなたの好きな四文字熟語! (01/18)
- 疲れますね (01/16)
- mod_proxy_balancerの忘れやすい設定とか (01/12)
categories
- varnish (1)
archives
recent comment
recent trackback
- mysqlを別ポートで立ち上げるメモ
⇒ My First JUGEM