Keepalived系列一:Keepalived.conf 详解
接上一篇博客:
http://www.cnblogs.com/xiaoit/p/4499703.html
1:按照上篇博客安装后的配置文件在
- /usr/local/etc/keepalived/keepalived.conf
默认内容如下:
- ! Configuration File for keepalived
- #全局定义块,以下模版不能省略
- global_defs {
- #如有故障,发邮件的地址。
- notification_email {
- acassen@firewall.loc
- failover@firewall.loc
- sysadmin@firewall.loc
- }
- notification_email_from Alexandre.Cassen@firewall.loc
- smtp_server 192.168.200.1
- #邮件服务链接超时的最长时间
- smtp_connect_timeout 30
- router_id LVS_DEVEL
- }
- #前面定义的后备的负载均衡服务器名称
- vrrp_instance VI_1 {
- #只有MASTER和BACKUP 两种状态,都必须大写。
- state MASTER
- #进行通信的端口
- interface eth0
- #同一个vrrp实例的唯一标识。即同一个vrrp_stance,MASTER和BACKUP的virtual_router_id是一致的。在整个vrrp内也唯一。
- virtual_router_id 51
- #权重,数值越大,权重越大。MASTER大于SLAVE
- priority 100
- #MASTER和SLAVE负载均衡器之间同步检查的时间间隔。单位是:秒
- advert_int 1
- #MASTER和SLAVE的认证方式
- authentication {
- auth_type PASS
- auth_pass 1111
- }
- virtual_ipaddress {
- 192.168.200.16
- 192.168.200.17
- 192.168.200.18
- }
- }
- #virtual_ipaddress,需要添加端口
- virtual_server 192.168.200.100 443 {
- #服务健康检查周期,6秒
- delay_loop 6
- #负载均衡调度算法rr|wrr|lc|wlc|sh|dh|lblc
- lb_algo rr
- #负载均衡转发规则NAT|DR|TUN
- lb_kind NAT
- nat_mask 255.255.255.0
- #回话保持时间,如果是动态服务,建议开启。默认50秒
- persistence_timeout 50
- protocol TCP
- #真是IP
- real_server 192.168.201.100 443 {
- #权重,数值越大,权重越高。分发的可能越大
- weight 1
- SSL_GET {
- url {
- path /
- digest ff20ad2481f97b1754ef3e12ecd3a9cc
- }
- url {
- path /mrtg/
- digest 9b3a0c85a887a256d6939da88aabd8cd
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
- }
- virtual_server 10.10.10.2 1358 {
- delay_loop 6
- lb_algo rr
- lb_kind NAT
- persistence_timeout 50
- protocol TCP
- sorry_server 192.168.200.200 1358
- real_server 192.168.200.2 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl3/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
- real_server 192.168.200.3 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334c
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334c
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
- }
- virtual_server 10.10.10.3 1358 {
- delay_loop 3
- lb_algo rr
- lb_kind NAT
- nat_mask 255.255.255.0
- persistence_timeout 50
- protocol TCP
- real_server 192.168.200.4 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl3/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
- real_server 192.168.200.5 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl3/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
- }
参考:
http://www.keepalived.org/documentation.html
Keepalived系列一:Keepalived.conf 详解的更多相关文章
- Redis:默认配置文件redis.conf详解
转: Redis:默认配置文件redis.conf详解 # Redis配置文件样例 # Note on units: when memory size is needed, it is possibl ...
- Redis配置文件redis.conf详解
一.Redis配置文件redis.conf详解 # Note on units: when memory size is needed, it is possible to specifiy # it ...
- linux离线部署redis及redis.conf详解
一.离线部署redis 由于博主部署的虚拟机没有网络也没有gcc编译器,所以就寻找具备gcc编译器的编译环境把redis编译安装好,Copy Redis安装目录文件夹到目标虚拟机的目录下.copy时r ...
- ASP.NET MVC深入浅出系列(持续更新) ORM系列之Entity FrameWork详解(持续更新) 第十六节:语法总结(3)(C#6.0和C#7.0新语法) 第三节:深度剖析各类数据结构(Array、List、Queue、Stack)及线程安全问题和yeild关键字 各种通讯连接方式 设计模式篇 第十二节: 总结Quartz.Net几种部署模式(IIS、Exe、服务部署【借
ASP.NET MVC深入浅出系列(持续更新) 一. ASP.NET体系 从事.Net开发以来,最先接触的Web开发框架是Asp.Net WebForm,该框架高度封装,为了隐藏Http的无状态模 ...
- yum的配置文件yum.conf详解
说明:经过网上抄袭和自己的总结加实验,非常详细,可留作参考. yum的配置一般有两种方式: 一种是直接配置/etc目录下的yum.conf文件, 另外一种是在/etc/yum.repos.d目录下 ...
- Hexo系列(三) 常用命令详解
Hexo 框架可以帮助我们快速创建一个属于自己的博客网站,熟悉 Hexo 框架提供的命令有利于我们管理博客 1.hexo init hexo init 命令用于初始化本地文件夹为网站的根目录 $ he ...
- /etc/security/limits.conf 详解与配置
目录 一. /etc/security/limits.conf 详解 /etc/security/limits.conf 配置解析 /etc/security/limits.d/ 目录 二. ulim ...
- Nginx知多少系列之(三)配置文件详解
目录 1.前言 2.安装 3.配置文件详解 4.Linux下托管.NET Core项目 5.Linux下.NET Core项目负载均衡 6.Linux下.NET Core项目Nginx+Keepali ...
- httpd.conf详解,因为php始终报fileinfo扩展无法加载的错
# # This is the main Apache HTTP server configuration file. It contains the # configuration directiv ...
- Signalr系列之虚拟目录详解与应用中的CDN加速实战
目录 对SignalR不了解的人可以直接移步下面的目录 SignalR系列目录 前言 前段时间一直有人问我 在用SignalR 2.0开发客服系统[系列1:实现群发通讯]这篇文章中的"/Si ...
随机推荐
- WebRTC 基于GCC的拥塞控制(下)
转自;http://blog.csdn.net/ljh081231/article/details/79152578 本文在文章[1]的基础上,从源代码实现角度对WebRTC的GCC算法进行分析.主要 ...
- tomcat使用不同jdk的解决方法
1,修改bin文件夹下面的catalina.bat文件,把如下内容 rem ----- Execute The Requested Command -------------------------- ...
- 女子监狱第一季/全集Orange Is the New Black迅雷下载
本季第一季 Orange Is the New Black 1 (2013) 看点:该剧描述主人公Piper Chapman(Taylor Schilling)在大学里结识了毒贩Alex(Laura ...
- mongodb centos7上的安装
1,下载安装包 下载mongoDB的安装文件地址:https://www.mongodb.org/downloads#production 选择Linux 64-bit legacy 版本,下载到目标 ...
- nodejs ffi(DLL)
npm install ffi Error: The specified module could not be found. npm rebuild var ffi = require('ffi') ...
- JAVA开发中文乱码的几个解决方案
一:html乱码或者引入的JS乱码 1:第一步,text file encoding 首先确保文件的保存格式要UTF-8,如在eclipse中,要在文件上点属性,确保这里选择UTF-8 注意,在ecl ...
- 第三章 logstash - 输入插件之tcp与redis
常用的输入插件: tcp redis 一.tcp 1.用法 input { tcp { port => 4560 codec => json_lines mode => server ...
- C#中byte[] 转 double[] 或 int[] 或 struct结构体
方法:使用C#调用C++ memcpy实现各种参数类型的内存拷贝 using System.Runtime.InteropServices; public class GlbWSGridDataset ...
- Spring系列:Scheduled注解学习笔记
一.试验代码 //@Scheduled(fixedRate = 5000) //@Scheduled(fixedDelay = 5000) @Scheduled(cron ="*/5 * * ...
- 客户端连接SQL报"Cannot Generate SSPI Context"错误
这种错误实在是让人头痛, 如果你遇到它还没有头痛的话, 请先看看微软给出的针对这个错误的这篇KB811889. 一般我遇到这种错误都是直接放弃, 重新运行sysprep之后再安装一遍所需要的软件. 然 ...