diff --git a/plugins/keepalived/config/keepalived.conf b/plugins/keepalived/config/keepalived.conf index 07b2cc1b3..9537e25a0 100644 --- a/plugins/keepalived/config/keepalived.conf +++ b/plugins/keepalived/config/keepalived.conf @@ -17,7 +17,7 @@ global_defs { } vrrp_script chk_mysql_port { #检测mysql服务是否在运行。有很多方式,比如进程,用脚本检测等等 - script "{$SERVER_PATH}/mdserver-web/plugins/keepalived/scripts/chk_mysql.sh" #这里通过脚本监测 + script "{$PLUGIN_PATH}/scripts/chk_mysql.sh" #这里通过脚本监测 interval 2 #脚本执行间隔,每2s检测一次 weight –5 #脚本结果导致的优先级变更,检测失败(脚本返回非0)则优先级 -5 fall 2 #检测连续2次失败才算确定是真失败。会用weight减少优先级(1-255之间) diff --git a/plugins/keepalived/index.py b/plugins/keepalived/index.py index 54b87eaef..b96584fa0 100755 --- a/plugins/keepalived/index.py +++ b/plugins/keepalived/index.py @@ -101,7 +101,7 @@ def initDreplace(): # initd replace if not os.path.exists(file_bin): content = mw.readFile(file_tpl) - content = content.replace('{$SERVER_PATH}', service_path) + content = contentReplace(content) mw.writeFile(file_bin, content) mw.execShell('chmod +x ' + file_bin)