码迷,mamicode.com
首页 > 其他好文 > 详细

keepalived安装

时间:2020-05-08 10:01:29      阅读:55      评论:0      收藏:0      [点我收藏+]

标签:工作   dir   环境搭建   ini   ref   安装路径   strong   创建文件夹   --   

两台Linux 

 

环境搭建

 安装keepalived

1.下载keepalived

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

2.解压安装:

tar -zxvf keepalived-1.2.18.tar.gz -C /usr/local/

3.下载插件openssl

yum install -y openssl openssl-devel(需要安装一个软件包)

4.开始编译keepalived

cd /usr/local/keepalived-1.2.18/ && ./configure --prefix=/usr/local/keepalived

5.make一下

make && make install

 

keepalived安装成Linux系统服务

(项目启动时候 服务也启动)

将keepalived安装成Linux系统服务,因为没有使用keepalived的默认安装路径(默认路径:/usr/local),安装完成之后,需要做一些修改工作:

首先创建文件夹,将keepalived配置文件进行复制:

mkdir /etc/keepalived

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

然后复制keepalived脚本文件:复制到 系统的文件里 会有意想不到的效果

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

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

ln -s /usr/local/sbin/keepalived /usr/sbin/

ln -s /usr/local/keepalived/sbin/keepalived /sbin/

可以设置开机启动:chkconfig keepalived on,到此我们安装完毕!

 

开启& 关闭:

   

service keepalived start

service keepalived stop

技术图片

 

keepalived安装

标签:工作   dir   环境搭建   ini   ref   安装路径   strong   创建文件夹   --   

原文地址:https://www.cnblogs.com/liuys635/p/12848315.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!