haproxy 配置检查
This commit is contained in:
parent
da1646eaed
commit
6619ae0bc5
|
|
@ -152,6 +152,13 @@ def initDreplace():
|
|||
def haOp(method):
|
||||
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():
|
||||
data = mw.execShell('systemctl ' + method + ' haproxy')
|
||||
if data[1] == '':
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ function spPostMin(method, args, callback){
|
|||
|
||||
$.post('/plugins/run', req_data, function(data) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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…
Reference in New Issue