博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
14.4. Example
阅读量:6927 次
发布时间:2019-06-27

本文共 3563 字,大约阅读时间需要 11 分钟。

14.4.1. Master

例 14.1. piranha master

[root@lvs1 ~]# cat /etc/sysconfig/ha/lvs.cfserial_no = 31primary = 172.16.0.2primary_private = 172.16.2.2service = lvsbackup_active = 1backup = 172.16.0.3backup_private = 172.16.2.3heartbeat = 1heartbeat_port = 539keepalive = 2deadtime = 6network = directdebug_level = NONEmonitor_links = 0syncdaemon = 0virtual LVS-HTTP {     active = 1     address = 172.16.0.1 eth0:1     vip_nmask = 255.255.255.255     port = 80     send = "GET / HTTP/1.0\r\n\r\n"     expect = "HTTP"     use_regex = 0     load_monitor = none     scheduler = wlc     protocol = tcp     timeout = 6     reentry = 15     quiesce_server = 0     server Web1 {         address = 172.16.0.5         active = 1         port = 80         weight = 2     }     server Web2 {         address = 172.16.0.6         active = 1         port = 80         weight = 2     }     server Web3 {         address = 172.16.0.7         active = 1         port = 80         weight = 2     }     server Web4 {         address = 172.16.0.8         active = 0         port = 80         weight = 0     }}

14.4.2. Slave

例 14.2. piranha slave

serial_no = 30primary = 172.16.0.2primary_private = 172.16.2.2service = lvsbackup_active = 1backup = 172.16.0.3backup_private = 172.16.2.3heartbeat = 1heartbeat_port = 539keepalive = 2deadtime = 6network = directdebug_level = NONEmonitor_links = 0syncdaemon = 0virtual LVS-HTTP {     active = 1     address = 172.16.0.1 eth0:1     vip_nmask = 255.255.255.255     port = 80     send = "GET / HTTP/1.0\r\n\r\n"     expect = "HTTP"     use_regex = 0     load_monitor = none     scheduler = wlc     protocol = tcp     timeout = 6     reentry = 15     quiesce_server = 0     server Web1 {         address = 172.16.0.5         active = 1         port = 80         weight = 2     }     server Web2 {         address = 172.16.0.6         active = 1         port = 80         weight = 2     }     server Web3 {         address = 172.16.0.7         active = 1         port = 80         weight = 2     }     server Web4 {         address = 172.16.0.8         active = 0         port = 80         weight = 3     }}

14.4.3. MySQL

virtual SLB-MySQL {     active = 1     address = 172.16.1.50 eth0:2     vip_nmask = 255.255.255.255     port = 3306     persistent = 30     send = ""     expect = ""     use_regex = 0     load_monitor = none     scheduler = wlc     protocol = tcp     timeout = 5     reentry = 15     quiesce_server = 0     server MySQL1 {         address = 172.16.1.46         active = 1         port = 3306         weight = 1     }     server MySQL2 {         address = 172.16.1.47         active = 1         port = 3306         weight = 1     }     server MySQL3 {         address = 172.16.1.48         active = 1         port = 3306         weight = 1     }}
# cat /srv/script/lvs-client-start#!/bin/bash### Disable IP_Forward in Linux Kernel ###echo 0 > /proc/sys/net/ipv4/ip_forward### Disable ARP Reponse on This RealServer ###echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignoreecho 2 > /proc/sys/net/ipv4/conf/lo/arp_announceecho 1 > /proc/sys/net/ipv4/conf/all/arp_ignoreecho 2 > /proc/sys/net/ipv4/conf/all/arp_announce### Add VIP Address and Route ###VIP=172.16.1.50/sbin/ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up/sbin/route add -host $VIP1 dev lo:0

我比较喜欢使用ip命令代替route命令

ip route add $VIP dev lo:0 src $VIP

Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>comments powered by
Disqus

原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

你可能感兴趣的文章
for loop
查看>>
Linux常用命令详解(一) -- 处理目录常用命令
查看>>
指针变量的星号是靠近变量名还是靠近类型
查看>>
在线程中执行代码
查看>>
POJ 2299 Ultra-QuickSort【树状数组+离散化】
查看>>
神经网络损失函数公式解读
查看>>
Android Studio插件:PlantUML
查看>>
Nginx开发从入门到精通
查看>>
Jenkins配置手动发版
查看>>
横向图片轮播(如果一个项目里面只需用这一次,可以用这个插件,多次则不建议使用)...
查看>>
计算机存储单位KB,MB,GB,TB,PB,EB,ZB,YB后面是什么?
查看>>
python 基础笔记十九 - 面向对象
查看>>
Linux安全之——Ubuntu的iptable命令使用
查看>>
entOS7查看开放端口命令
查看>>
操作系统位数
查看>>
关于call()的this指向研究
查看>>
.NET 人工智能相关资料整理
查看>>
【机器学习】--鲁棒性调优之L1正则,L2正则
查看>>
selenium+ChromeOptions登录北京市住房公积金
查看>>
Codeforces Round #316 (Div. 2A) 570A Elections
查看>>