大师,我在配置lvs读负载均衡时遇到问题。操作系统为centos7.6
在主库中启动lvsdr配置如下
#!/bin/bash
VIP=192.168.0.140
DEV=enp0s3
. /etc/rc.d/init.d/functions
case “$1” in
start)
echo “1”>/proc/sys/net/ipv4/ip_forward
/sbin/ipvsadm -A -t $VIP:3306 -s rr -p 60
/sbin/ipvsadm -a -t $VIP:3306 -r 192.168.0.121:3306 -g
/sbin/ipvsadm -a -t $VIP:3306 -r 192.168.0.122:3306 -g
/sbin/ipvsadm --start-daemon
echo “LVS-DR server starts successfully.\n”
;;
stop)
/sbin/route del KaTeX parse error: Expected 'EOF', got '&' at position 18: …P >/dev/null 2>&̲1
echo "0" >/p…VIP"isRoOn=
/bin/netstat -rn | grep “VIP"‘if["VIP"`
if [ "VIP"‘if["isLoOn” == “” -a “$isRoOn” == “” ]; then
echo "LVS-DR real server has to run yet."
else
echo "LVS-DR real server is running."
fi
exit 3
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1
esac
exit 0
启动时报错
[root@test1 init.d]# ./lvsdr start
No such device or address
No such device or address
No such device or address
Try `/sbin/ipvsadm -h’ or ‘/sbin/ipvsadm --help’ for more information.
LVS-DR server starts successfully.\n
请大师帮我分析一下,有没有哪个地方记录更详细的日志