iptables 负裁平衡(Load balancing)
「负戴平衡」的作用是将连線平均分散给一组伺服器,以充分利用资源。最简单的作法是利用「通讯端口转接」技术,使其以循环顺序选择目的地位址。
设定iptables的组态
各家Linux系统的iptables组态设定程序都不太一样,本节提供通用的作法,以及Red Hat 特有的设定方法。
「规则」的储存与回复
Red Hat Linu系统将iptables的「规则」储存于/etc/sysconfig/iptables档案,使用iptables initscript (通常是/etc/init.d/iptables)可将当时的规则储存于/etc/sysconfig/iptables,或将该档案裡的规则载入核心,如下:
/etc/init.d/iptables save (储存当时组态)
/etc/init.d/iptables restore (载入前次储存的组态)
使用Red Hat Linux的chkconfig命令,可以查出哪些runlevel会自动执行iptables:
chkconfig - - list iptables
假设你想在runlevels3、4、与5启动iptables,使用下列命令:
chkconfig - -levels 345 iptables on
你也可以自己启动iptables(从/etc/sysconfig/iptables档案载入规则,与/etc/init.d/iptables restore等效):
service iptables start
下列命令可以使其失效(清洗掉核心当时的规则):
service iptables stop
对于Red Hat Linux之外的其它系统,可使用iptables-save与iptables-restore达到储存、回复规则的效果。关于这两个工具程式,请参阅《辅助工具》。
其它相关組態檔
透过/proc档案系统下的虚拟档案,可以监测、控制核心的一般网络功能,以及iptables的行为。
iptables 负裁平衡(Load balancing)的更多相关文章
- 【架构】How To Use HAProxy to Set Up MySQL Load Balancing
How To Use HAProxy to Set Up MySQL Load Balancing Dec 2, 2013 MySQL, Scaling, Server Optimization U ...
- Windows Server 2008配置Network Load Balancing(服务群集)
最近配置SharePoint 2013 WFE 时,客户提到要让多台WFE能load balance,于是研究了下Network Load Balancing. 当把一台服务器 ...
- Codeforce 609 C—— Load Balancing ——————【想法题】
C. Load Balancing time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- 应用交付、负载均衡(Load balancing)、高可用、F5
“应用交付”,实际上就是指应用交付网络(Application Delivery Networking,简称ADN),它利用相应的网络优化/加速设备,确保用户的业务应用能够快速.安全.可靠地交付给内部 ...
- CF# Educational Codeforces Round 3 C. Load Balancing
C. Load Balancing time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
一直用CentOS 6 习惯了,一下没适应过来.防火墙配置后执行service iptables save 出现”Failed to restart iptables.service: Unit ip ...
- Codeforces Educational Codeforces Round 3 C. Load Balancing 贪心
C. Load Balancing 题目连接: http://www.codeforces.com/contest/609/problem/C Description In the school co ...
- UVA 12904 Load Balancing 暴力
Load Balancing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/vi ...
- Load Balancing 折半枚举大法好啊
Load Balancing 给出每个学生的学分. 将学生按学分分成四组,使得sigma (sumi-n/4)最小. 算法: 折半枚举 #include <iostrea ...
随机推荐
- 【P3056】【USACO12NOV】笨牛Clumsy Cows
P3056 [USACO12NOV]笨牛Clumsy Cows 题目描述 Bessie the cow is trying to type a balanced string of parenthes ...
- pycharm 测试执行成功,但却无法成功生成测试报告(使用HTMLTestRunner)的解决办法
pycharm 测试执行成功,在对应的测试路径下确未生成测试报告.反复确认代码也是没有问题的,在网上查找了原因:简单的unittest运行是不执行main方法的.是允许方式问题. 于是在mian方法里 ...
- DataGrid无故多一行空白行
DataGrid绑定datatable时, Datagrid.Itemsource=dt.DefaultView: 发现DataGRID会多处一行 解决如下: 对Datagrid的CanUserAdd ...
- pillow模块
pillow模块 用于操作图片的模块 安装 pip install pillow 生成验证码 from PIL import Image,ImageDraw,ImageFont from io imp ...
- Leetcode884.Uncommon Words from Two Sentences两句话中的不常见单词
给定两个句子 A 和 B . (句子是一串由空格分隔的单词.每个单词仅由小写字母组成.) 如果一个单词在其中一个句子中只出现一次,在另一个句子中却没有出现,那么这个单词就是不常见的. 返回所有不常用单 ...
- 【水滴石穿】FirstReactNativeProject
这个是一个小demo,项目地址为https://github.com/prsioner/FirstReactNativeProject 有注册,忘记密码还有登陆,应该是用到了react-navigat ...
- R语言处理Web数据
R语言处理Web数据 许多网站提供的数据,以供其用户的消费.例如,世界卫生组织(WHO)提供的CSV,TXT和XML文件的形式的健康和医疗信息报告.基于R程序,我们可以通过编程提取这些网站的具体数据. ...
- 常用命令(java、linux)
1.java打war包: jar cvf temp.war */ . 命令格式: java cvf 打包文件名称 要打包的目录 打包文件保存路径 解压: jar xvf temp.war ...
- 【水滴石穿】react-native-template-app
这个也是一个基础项目 地址如下https://github.com/ndlonghi/react-native-template-app 点击登陆跳转到首页 分析代码如 react-native-te ...
- FinalShell for Mac
Mac一键安装脚本 curl -o finalshell_install.sh www.hostbuf.com/downloads/finalshell_install.sh;chmod +x fin ...