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 ...
随机推荐
- Python之路,Day5 - 常用模块学习 (转载Alex)
本节大纲: 模块介绍 time &datetime模块 random os sys shutil json & picle shelve xml处理 yaml处理 configpars ...
- Ubuntu18.04 修改IP地址、查看网关、防火墙
1. Ubuntu18.04 修改IP地址 修改 sudo vim /etc/netplan/50-cloud-init.yaml文件 # This file is generated from in ...
- Python实例 遍历文件夹和文件
import os import os.path # os,os.path里包含大多数文件访问的函数,所以要先引入它们. # 请按照你的实际情况修改这个路径 rootdir = &quo ...
- apache添加虚拟主机(windows下)
1.打开Apache的目录下的 D:\Web\Apache\conf\httpd.conf 允许虚拟,启动虚拟配置文件 2.配置虚拟主机 打开 D:\Web\Apache\conf\extra\ht ...
- web前端学习(二)html学习笔记部分(10)-- HTML5构建应用布局和页面
1.2.25 HTML5构建应用布局和页面 1.2.25.1 HTML5在移动开发中的准则 1.尽量使用单页面开发 2.慎重选择前端UI框架 3.动画.特效使用准则(60fps) 浏览器消耗最小的 ...
- HTML input type=file文件选择表单的汇总(一)
HTML input type=file 在onchange上传文件的过程中,遇到同一个文件二次上传无效的问题. 最近在做项目过程中,遇到同一文件上传的时候,二次上传没有效果,找了资料,找到了原因: ...
- LintCode刷题笔记-- Edit distance
标签:动态规划 描述: Given two words word1 and word2, find the minimum number of steps required to convert wo ...
- Codeforces Round #395 (Div. 2) A. Taymyr is calling you【数论/最小公倍数】
A. Taymyr is calling you time limit per test 1 second memory limit per test 256 megabytes input stan ...
- JDK8 Stream 数据流效率分析
JDK8 Stream 数据流效率分析 Stream 是Java SE 8类库中新增的关键抽象,它被定义于 java.util.stream (这个包里有若干流类型: Stream<T> ...
- SQLServer —— 数据类型的转换
一.使用convert函数实现强制转换 例如我们现在有如下一张学员成绩表: 现在想查询学号等于100003的学员总成绩,并按照要求打印出来,我们可以这样实现: 结果报错,因为最后一句字符串不能和数值相 ...