15.4. lvs常见问题汇总

Date:

2018-10

15.4.1. lvs裂脑

导致裂脑发生的原因
  1. 高可用服务器之间心跳链路故障,导致无法相互检查心跳

  2. 高可用服务器上开启了防火墙,阻挡了心跳检测

  3. 高可用服务器上网卡地址等信息配置不正常,导致发送心跳失败

  4. 其他服务配置不当等原因,如心跳方式不同,心跳广播冲突,软件BUG等

编译报错:

 1libipvs.c:526: note: expected ‘struct nlattr *’ but argument is of type ‘struct nlattr *’
 2libipvs.c: In function ‘ipvs_get_dests’:
 3libipvs.c:809: error: ‘NLM_F_DUMP’ undeclared (first use in this function)
 4libipvs.c:813: warning: assignment makes pointer from integer without a cast
 5libipvs.c:829: error: too many arguments to function ‘ipvs_nl_send_message’
 6libipvs.c: In function ‘ipvs_get_service’:
 7libipvs.c:939: error: too many arguments to function ‘ipvs_nl_send_message’
 8libipvs.c: In function ‘ipvs_timeout_parse_cb’:
 9libipvs.c:972: warning: initialization makes pointer from integer without a cast
10libipvs.c:986: error: ‘NL_OK’ undeclared (first use in this function)
11libipvs.c: In function ‘ipvs_get_timeout’:
12libipvs.c:1005: error: too many arguments to function ‘ipvs_nl_send_message’
13libipvs.c: In function ‘ipvs_daemon_parse_cb’:
14libipvs.c:1023: warning: initialization makes pointer from integer without a cast
15libipvs.c:1048: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast
16/usr/include/string.h:131: note: expected ‘const char * __restrict _ _’ but argument is of type ‘int’
17libipvs.c:1051: error: ‘NL_OK’ undeclared (first use in this function)
18libipvs.c: In function ‘ipvs_get_daemon’:
19libipvs.c:1071: error: ‘NLM_F_DUMP’ undeclared (first use in this function)
20libipvs.c:1072: error: too many arguments to function ‘ipvs_nl_send_message’
21make[1]: *** [libipvs.o] Error 1
22make[1]: Leaving directory ``/home/tools/ipvsadm-1.26/libipvs'``
23make: *** [libs] Error 2

由上面可以发现应该是lib库缺少

1[root@lvs_01 ipvsadm-1.26]# yum install libnl* -y

编译发现错误

1ipvsadm.c:661: error: ‘POPT_BADOPTION_NOALIAS’ undeclared (first use in this function)
2ipvsadm.c:669: warning: implicit declaration of function ‘poptStrerror’
3ipvsadm.c:670: warning: implicit declaration of function ‘poptFreeContext’
4ipvsadm.c:677: warning: implicit declaration of function ‘poptGetArg’
5ipvsadm.c:367: warning: unused variable ‘options_table’
6ipvsadm.c: In function ‘print_largenum’:
7ipvsadm.c:1383: warning: field width should have type ‘int’, but argument 2 has type ‘size_t’
8make: *** [ipvsadm.o] Error 1
1[root@lvs_01 ipvsadm-1.26]# yum install popt* -y
1yum install libnl* popt* -y