VMware下Linux实现Keepalived+DNS+Apache实现负载均衡+高(2)

 

 

首页服务器应用

背景:

阅读新闻

VMware下Linux实现Keepalived+DNS+Apache实现负载均衡+高可用

[日期:2011-11-08]   来源:Linux社区  作者:ethnicitybeta   [字体:]  

第二:对于keepalived的安装配置

首先是双方(192.168.1.195和192.168.1.196)都要做的步骤:

[root@localhost ~]# yum -y install ipvsadm kernel-devel openssl openssl-devel

[root@localhost ~]# ln -s /usr/src/kernels/2.6.18-194.el5-i686/ /usr/src/linux

[root@localhost ~]# wget

[root@localhost ~]# ls keepalived-1.2.1.tar.gz

keepalived-1.2.1.tar.gz

[root@localhost ~]# tar zxvf keepalived-1.2.1.tar.gz

[root@localhost ~]# cd keepalived-1.2.1

[root@localhost keepalived-1.2.1]# ./configure  //结束后出现以下的内容表示可以编译安装了

Keepalived configuration

------------------------

Keepalived version       : 1.2.1

Compiler                 : gcc

Compiler flags           : -g -O2 -DETHERTYPE_IPV6=0x86dd

Extra Lib                : -lpopt -lssl -lcrypto

Use IPVS Framework       : Yes

IPVS sync daemon support : Yes

Use VRRP Framework       : Yes

Use Debug flags          : No

[root@localhost keepalived-1.2.1]# make && make install

[root@localhost ~]# mkdir /etc/keepalived

[root@localhost ~]# cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf

[root@localhost ~]# cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/keepalived

[root@localhost ~]# cp /usr/local/sbin/keepalived /usr/sbin/keepalived

[root@localhost ~]# cp /usr/local/etc/rc.d/init.d/keepalived /etc/init.d/keepalived

其次是在192.168.1.195上的配置异于192.168.1.196的内容为:

[root@localhost ~]# "web 192.168.1.195">/var/www/html/index.html

[root@localhost ~]# cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived

global_defs {

notification_email {

38205036@qq.com

}

notification_email_from Alexandre.Cassen@firewall.loc

smtp_server 192.168.1.196

smtp_connect_timeout 30

router_id LVS_DEVEL

}

vrrp_script chk_http_port {

script "killall -0 httpd"

interval 2

}

vrrp_instance VI_1 {

state BACKUP

interface eth0

virtual_router_id 51

priority 100

advert_int 5

authentication {

auth_typePASS

auth_pass 1111

}

virtual_ipaddress {

192.168.1.200/24 dev eth0

}

track_script {

chk_http_port

}

}

vrrp_instance VI_2 {

state MASTER

interface eth0

virtual_router_id 52

priority 150

advert_int 5

authentication {

auth_typePASS

auth_pass 1111

}

virtual_ipaddress {

192.168.1.203/24 dev eth0

}

track_script {

chk_http_port

}

}

 

VMware下Linux+Keepalived+MySQL-Cluster实现高可用负载均衡MySQL

VMware下Linux构建DNS的基本主辅框架

相关资讯       Linux服务器  keepalived 

   

本文评论   查看全部评论 (0)


评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

 

 

 

最新资讯

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/ppjsw.html