google/seesaw

centos7.9 Failed to initialise LB interface: Failed to get network interface: route ip+net: no such network interface

luo964973791 opened this issue · 10 comments

How to solve the problem after starting seesaw_watchdog.service on centos and reporting Failed to get network interface: route ip+net: no such network interface

Deployment steps:
yum install epel-release -y
yum -y erase git
yum -y install https://repo.ius.io/ius-release-el7.rpm
yum -y install git222 ipvsadm golang protobuf-compiler libnl3-devel
echo ip_vs > /etc/modules-load.d/ipvs.conf
echo ip_vs_wrr>/etc/modules-load.d/ipvs.conf
echo nf_conntrack_ipv4 > /etc/modules-load.d/nf_conntrack.conf
modprobe dummy numdummies=1
echo "options dummy numdummies=1" > /etc/modprobe.d/dummy.conf
systemctl restart systemd-modules-load.service
ip link add ip+net type dummy

cd /root && mkdir go && export GOPATH=/root/go
go get -u golang.org/x/crypto/ssh
go get -u github.com/dlintw/goconf
go get -u github.com/golang/glog
go get -u github.com/miekg/dns
go get -u github.com/kylelemons/godebug/pretty
go get -u github.com/golang/protobuf/proto
export PATH=$PATH:${GOPATH}/bin
go get -u github.com/google/seesaw

cd /root/go/src/github.com/google/seesaw/
make test
make install
cp -r /root/go/src/github.com/google/seesaw/etc /root/go/bin/

cd /root/go/bin && vi /root/go/bin/install.sh
SEESAW_BIN="/usr/local/seesaw"
SEESAW_ETC="/etc/seesaw"
SEESAW_LOG="/var/log/seesaw"

INIT=ps -p 1 -o comm=

install -d "${SEESAW_BIN}" "${SEESAW_ETC}" "${SEESAW_LOG}"

install "${GOPATH}/bin/seesaw_cli" /usr/bin/seesaw

for component in {ecu,engine,ha,healthcheck,ncc,watchdog}; do
install "${GOPATH}/bin/seesaw_${component}" "${SEESAW_BIN}"
done

if [ $INIT = "init" ]; then
install "etc/init/seesaw_watchdog.conf" "/etc/init"
elif [ $INIT = "systemd" ]; then
install "etc/systemd/system/seesaw_watchdog.service" "/etc/systemd/system"
systemctl --system daemon-reload
fi
install "etc/seesaw/watchdog.cfg" "${SEESAW_ETC}"

Enable CAP_NET_RAW for seesaw binaries that require raw sockets.

/sbin/setcap cap_net_raw+ep "${SEESAW_BIN}/seesaw_ha"
/sbin/setcap cap_net_raw+ep "${SEESAW_BIN}/seesaw_healthcheck"

chmod +x install.sh
./install.sh
systemctl status seesaw_watchdog
systemctl enable seesaw_watchdog
cd /root/go/bin/etc/seesaw
cp cluster.pb.example seesaw.cfg.example /etc/seesaw
cd /etc/seesaw
mv cluster.pb.example cluster.pb
mv seesaw.cfg.example seesaw.cfg
systemctl --system daemon-reload
systemctl --now enable seesaw_watchdog.service

In "seesaw.cfg" there is an option to set lb interface. Make sure you edit it to match the interface you have on the machine.

[root@localhost ssl]# cat /etc/seesaw/seesaw.cfg
[cluster]
anycast_enabled = false
name = au-syd
node_ipv4 = 172.27.0.5
peer_ipv4 = 172.27.0.6
vip_ipv4 = 172.27.0.8

[config_server]
primary = node1
secondary = node2

[interface]
node = eth0
lb = eth1
[root@localhost ssl]# cat /var/log/seesaw/seesaw_engine.log
Log file for seesaw_engine (stdout/stderr)
Created at: 2020/12/29 13:32:13
E1229 13:32:18.212401 14639 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 13:32:19.714092 14639 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 13:33:13.261729 14639 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 13:34:13.267758 14639 notifier.go:159] Failed to pull configuration: all config server requests failed
[root@localhost ssl]# ls
ca.crt ca.key ca.srl node1.csr node1.key

node1

vi /etc/hosts
172.27.0.5 node1
172.27.0.6 node2
mkdir /etc/seesaw/ssl -p && cd /etc/seesaw/ssl
openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -subj "/CN=node1" -days 5000 -out ca.crt
openssl genrsa -out node1.key 2048
openssl req -new -key node1.key -subj "/CN=node1" -out node1.csr
openssl x509 -req -in node1.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out node1.csr -days 5000

#node2
vi /etc/hosts
172.27.0.5 node1
172.27.0.6 node2
mkdir /etc/seesaw/ssl -p && cd /etc/seesaw/ssl
openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -subj "/CN=node2" -days 5000 -out ca.crt
openssl genrsa -out node2.key 2048
openssl req -new -key node2.key -subj "/CN=node1" -out node2.csr
openssl x509 -req -in node2.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out node2.csr -days 5000

E1229 16:28:44.692794 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:29:39.704966 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:30:39.705453 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:31:39.707495 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:32:39.706918 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:33:39.704106 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:34:39.706784 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:35:39.703267 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:36:39.703592 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:37:39.709039 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:38:39.705321 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:39:39.705490 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:40:39.707153 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:41:39.706534 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:42:39.705840 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:43:39.706939 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:44:39.705917 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:45:39.706700 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:46:39.708137 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:47:39.707732 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:48:39.704992 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:49:39.705168 20458 notifier.go:159] Failed to pull configuration: all config server requests failed
E1229 16:50:39.705144 20458 notifier.go:159] Failed to pull configuration: all config server requests failed