bingtuag 发表于 2018-12-28 13:37:57

解决Keepalived无法编译的问题

  系统环境:
  SUSE Linux Enterprise Server 10 SP1 (x86_64)
  

  首先需要安装两个依赖库:openssl、popt
  # tar xvzf openssl-1.0.1a.tar.gz
  # cd openssl-1.0.1a
  # ./config shared --prefix=/usr/local
  # make && make install
  

  # tar xvzf popt-1.14.tar.gz
  # cd popt-1.14
  # ./configure --prefix=/usr/local
  # make && make install
  

  然后在keepalived安装的make阶段会报错,导致安装失败,信息如下:
http://blog.运维网.com/attachment/201310/014319894.png
  

  根据提示信息,是由于缺少“if_addr.h”头文件导致的,于是从网上下载一份此文件放置于“/usr/include/linux”目录下,再次make会出现如下信息:
http://blog.运维网.com/attachment/201310/014603635.png
  

  根据报错信息,是由于重复定义导致的,于是将“if_addr.h”文件中的:
  struct ifaddrmsg结构、enum枚举类型、struct ifa_cacheinfo结构都注释掉,然后再次编译:
http://blog.运维网.com/attachment/201310/015004824.png
  

  定位到“./keepalived/include/vrrp_ipaddress.h”的41行,经确认是由于缺少“struct ifaddrmsg”结构的定义,所以在此文件的开头增加“#include ”,再次编译,通过!!
  

  

  

  



附件:http://down.运维网.com/data/2363571

页: [1]
查看完整版本: 解决Keepalived无法编译的问题