欢迎来到天天文库
浏览记录
ID:30803667
大小:631.88 KB
页数:47页
时间:2019-01-03
《基于keepalived的redis系统master双机热备(读数据负载均衡)设置方案》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、基于keepalived的redis系统master双机热备,读数据负载均衡设置方案硬件:机器ip作用master192.168.0.2redis系统的master主机slave1192.168.0.3redis系统的slave机器,和master组成双机热备slave2192.168.0.4redis系统的slave机器,和slave*!构成读数据的负载均衡系统软件:keepalived,下载地址:www.keepalived.orgIvs,下载地址:http://www.linuxvirtuals
2、erver.orgredis,下载地址:www.redis.iocentos6.4版本安装:不采用编译安装的方式,使用yum安装1.安装kernel-devel:yuminstallkernel-devel.这是ipvsadm需要的2安装Ivs:yuminstallipvsadm3.安装keepalived:yuminstallkeepalived如果无法联网,请去这里考古寻找自己需要的rpm文件base:http://tel.mirrors.163.eom/centos/6/os/x86_64/Pa
3、ckages/update:http://tel.mirrors.163.com/centos/6/updates/x86_64/Packages/下面是需要的rpm文件列表截图kernel-devel需要的文件PackageArchUersionRepositoryInsta11ing:kerne1-deve1x86_64Z・6・32-358・14i.tlt.[el6/blog.4、ntos-6-key(?centosPackage:centos-release-6-4.e16.centos•10.x86_64(Banaconda-CentOS-2013030.x86_64/6.4)http://blosdn.net/xqjl98From:/etc/pki/rpm・qpq/RPH-GPG-KEY・CEntOS・6Ivs需耍的文件PackageArchUersionRepositoryInsta11ing:ipvsadmx86641.25-10.e^tp://blog.IX(1J15、98keepalived需要的文件PackageArchUersionRepositoryInsta11ing:keepa1ivedl.Z.7-3.^16tp://^iOg(net/xqj19t注意,三台机器都需要安装keepalived配置keepalived:1.centos必要配置:/etc/sysctl.conf文件net.ipv4.ip_forward=1#转发开启1.keepalived必要配置:master修改/etc/keepalived/keepalived.conf为女口下[pla6、in]viewDlaincopyI.!ConfigurationFileforkeepalived2・2.global_defs{3.notification_email{4.邮箱6・}7•notification_email^from邮箱8.smtp_server邮箱服务器地址9•smtp_connect_timeout3010•router_idLVS_DEVELII.}12.vrrp_instanceVI_1{13.stateMASTER14.interfaceeth0#eth0是要绑定的网卡17、5.virtual_router_id100#同一个vrrp_instanceH1的值必须一样16.priority160#master的值耍高于backup的17.advert_int118.authentication{19.auth_typePASS20.auth_pass111121・}22.virtual_ipaddress{23.192.168.0.5#用于双机热备的虚拟ip24・}25.26.}27.virtual_server192.168.0.56379{28.delay_loop38、29.lb_algowrr30.lb^kindDR31.persistence_timeout3032.protocolTCP33.real_server192.168.0.26379{34.weight835.notify^downredis服务失败后耍执行的脚木的路径/脚木名#服务失败后要执行的脚本36.TCP_CHECK{37.connect_timeout138.nb_get_retry339.delay_before_retry340.conn
4、ntos-6-key(?centosPackage:centos-release-6-4.e16.centos•10.x86_64(Banaconda-CentOS-2013030.x86_64/6.4)http://blosdn.net/xqjl98From:/etc/pki/rpm・qpq/RPH-GPG-KEY・CEntOS・6Ivs需耍的文件PackageArchUersionRepositoryInsta11ing:ipvsadmx86641.25-10.e^tp://blog.IX(1J1
5、98keepalived需要的文件PackageArchUersionRepositoryInsta11ing:keepa1ivedl.Z.7-3.^16tp://^iOg(net/xqj19t注意,三台机器都需要安装keepalived配置keepalived:1.centos必要配置:/etc/sysctl.conf文件net.ipv4.ip_forward=1#转发开启1.keepalived必要配置:master修改/etc/keepalived/keepalived.conf为女口下[pla
6、in]viewDlaincopyI.!ConfigurationFileforkeepalived2・2.global_defs{3.notification_email{4.邮箱6・}7•notification_email^from邮箱8.smtp_server邮箱服务器地址9•smtp_connect_timeout3010•router_idLVS_DEVELII.}12.vrrp_instanceVI_1{13.stateMASTER14.interfaceeth0#eth0是要绑定的网卡1
7、5.virtual_router_id100#同一个vrrp_instanceH1的值必须一样16.priority160#master的值耍高于backup的17.advert_int118.authentication{19.auth_typePASS20.auth_pass111121・}22.virtual_ipaddress{23.192.168.0.5#用于双机热备的虚拟ip24・}25.26.}27.virtual_server192.168.0.56379{28.delay_loop3
8、29.lb_algowrr30.lb^kindDR31.persistence_timeout3032.protocolTCP33.real_server192.168.0.26379{34.weight835.notify^downredis服务失败后耍执行的脚木的路径/脚木名#服务失败后要执行的脚本36.TCP_CHECK{37.connect_timeout138.nb_get_retry339.delay_before_retry340.conn
此文档下载收益归作者所有