cenos/Red Hat 7.4 编译keepalived,生成rpm包

本文档详细介绍了如何在CentOS/Red Hat 7.4上从源代码编译keepalived 2.0.7并生成RPM包。首先,从官方站点下载并解压源代码,接着安装必要的依赖库,如openssl-devel, libnl3-devel等。配置编译时,使用configure脚本并启用SNMP、BFD等功能。在打包过程中,需要注意修正keepalived.spec.in文件中的错误,并创建用于rpmbuild的目录结构。最后,运行`make rpm`生成RPM包。" 102966649,5001599,解决Spring RestTemplate调用RESTful API时406错误,"['Java', 'Spring', 'Restful API', 'String boot', '微服务']
摘要由CSDN通过智能技术生成

首先下载keepalived-2.0.7,地址http://www.keepalived.org/download.html

接下来解压keepalived-2.0.7.tar.gz

        tar -xzpvf  keepalived-2.0.7.tar.gz

        cd keepalived-2.0.7

目录中有个INSTALL的文件,我们先打开。可以看到如果是red hat系列的linux,需要安装一些包。对于file-devel、 net-snmp-devel、net-snmp-devel、glib2-devel、json-c-devel、pcre2-devel以及后面说的一些包,都是根据特定的需求需要安装的一些包,根据需要安装。

Library dependencies
====================

  In order to compile Keepalived needs the following libraries :

  * OpenSSL, <www.openssl.org>

Linux flavours
==============

RedHat based systems (RedHat Enterprise/CentOS/Fedora)
------------------------------------------------------
The following libraries need to be installed:
    openssl-devel libnl3-devel ipset-devel iptables-devel libnfnetlink-devel
For magic file identification support:
    file-devel
For SNMP support:
    net-snmp-devel
For DBUS support:
    glib2-devel
For JSON support:
    json-c-devel
For PCRE support
    pcre2-devel

For building the documentation, the following packages need to be installed:
    Fedora: python-sphinx (will pull in: python2-sphinx_rtd_theme)
    CentOS-and-friends: python-sphinx epel-release python-sphinx_rtd_theme
   For latex or pdf files, the following are also needed:
    Fedora: latexmk python-sphinx-latex
    CentOS-and-friends: latexmk texlive texlive-titlesec texlive-framed texlive-threeparttable texlive-wrapfig texlive-multirow
 

主要的,编译过程中需要gcc编译器,我这里gcc的版本是gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)。如果是较低的版本,可能有问题。打包rpm需要rpmbuild这个工具,也需要安装rpm-build-4.11.3-32.el7.x86_64。

先看看configure有哪些选项,下面这些选项大家根据自己需要选择,通常默认的就可以满足需求了。

需要重点说一下的就是最后的Some influential environment variables的部分,这里是通过设置环境变量来影响configure的过程。主要的可以设置CC这个env。例如export CC=g++ 。

`configure' configures Keepalived 2.0.7 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值