haproxy 配置检查

pull/504/head
Mr Chen 1 year ago
parent da1646eaed
commit 6619ae0bc5
  1. 7
      plugins/haproxy/index.py
  2. 2
      plugins/haproxy/js/haproxy.js
  3. 20
      plugins/lvs/readme.md

@ -152,6 +152,13 @@ def initDreplace():
def haOp(method): def haOp(method):
file = initDreplace() file = initDreplace()
# check config
sdir = getServerDir()
cmd_check = sdir+'/sbin/haproxy -c -f ' + sdir + '/haproxy.conf'
chk_data = mw.execShell(cmd_check)
if chk_data[1]!= '':
return chk_data[1]
if not mw.isAppleSystem(): if not mw.isAppleSystem():
data = mw.execShell('systemctl ' + method + ' haproxy') data = mw.execShell('systemctl ' + method + ' haproxy')
if data[1] == '': if data[1] == '':

@ -10,7 +10,7 @@ function spPostMin(method, args, callback){
$.post('/plugins/run', req_data, function(data) { $.post('/plugins/run', req_data, function(data) {
if (!data.status){ if (!data.status){
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); layer.msg(data.msg,{icon:0,time:10000,shade: [0.3, '#000']});
return; return;
} }

@ -0,0 +1,20 @@
debian
# 查看网卡
ls /sys/class/net/
ifconfig ens256 172.16.204.100 netmask 255.255.255.255 broadcast 192.168.212.100 up
route add -host 172.16.204.100 dev ens256
ipvsadm -A -t 172.16.204.100:80 -s rr
ipvsadm -a -t 172.16.204.100:80 -r 172.16.204.129:80 -m
# 清空LVS规则
ipvsadm -C
# 查看LVS
ipvsadm -L -n
Loading…
Cancel
Save