linux安装keepalived

原创
2017/02/22 10:57
阅读数 57

#编译安装keepalived

# cd /usr/local/src

# wget  http://www.keepalived.org/software/keepalived-1.2.18.tar.gz

# tar -zxvf keepalived-1.2.18.tar.gz

# cd keepalived-1.2.2

# ./configure --prefix=/usr/local/keepalived

# make && make install #编译keepalived源码

 

#设定keepalived的配置文件并将keepalived注册为服务然后设定为开机启动(开机启动前面有讲)

mkdir /etc/keepalived

cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf

cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/

cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/

cp /usr/local/keepalived/sbin/keepalived /usr/sbin/

chkconfig --level 2345 keepalived on  #注册开机启动

 

---------------本人安装中遇到几个坑------------------------

首先进入

[root@localhost //]# cd /usr/local/src

下载:

[root@localhost src]# wget  http://www.keepalived.org/software/keepalived-1.2.18.tar.gz

解压:

[root@localhost src]# tar -zxvf keepalived-1.2.18.tar.gz

进入:

[root@localhost src]# cd keepalived-1.2.18

[root@localhost keepalived-1.2.18]# ./configure --prefix=/usr/local/keepalived

此时遇到一个bug

错误:没有按照gcc,cc

[root@localhost keepalived-1.2.18]# yum install gcc gcc-c++

正在安装中....,因为在windows中习惯ctrl+c复制,导致退出 再次运行 yum install gcc gcc-c++命令时,报错

网上找到解决办法: 可以通过强制关掉yum进程:

#rm -f /var/run/yum.pid

然后再次:# yum install gcc gcc-c++ 就可以继续安装直到安装完毕。

 

然后继续执行: ./configure --prefix=/usr/local/keepalived

 

又出现问题:

 !!! OpenSSL is not properly installed on your system. !!!

  !!! Can not include OpenSSL headers files. 

解决方法:

 执行:yum -y install openssl-devel

直到完毕

然后继续执行: ./configure --prefix=/usr/local/keepalived

终于正常了!!!!

 

# make && make install #编译keepalived源码

 

#设定keepalived的配置文件并将keepalived注册为服务然后设定为开机启动(开机启动前面有讲)

mkdir /etc/keepalived

cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf

cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/

cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/

cp /usr/local/keepalived/sbin/keepalived /usr/sbin/

chkconfig --level 2345 keepalived on  #注册开机启动

 

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部