「负戴平衡」的作用是将连線平均分散给一组伺服器,以充分利用资源。最简单的作法是利用「通讯端口转接」技术,使其以循环顺序选择目的地位址。

设定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)的更多相关文章

  1. 【架构】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 ...

  2. Windows Server 2008配置Network Load Balancing(服务群集)

          最近配置SharePoint 2013 WFE 时,客户提到要让多台WFE能load balance,于是研究了下Network Load Balancing.       当把一台服务器 ...

  3. Codeforce 609 C—— Load Balancing ——————【想法题】

    C. Load Balancing time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  4. 应用交付、负载均衡(Load balancing)、高可用、F5

    “应用交付”,实际上就是指应用交付网络(Application Delivery Networking,简称ADN),它利用相应的网络优化/加速设备,确保用户的业务应用能够快速.安全.可靠地交付给内部 ...

  5. 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 ...

  6. 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load

    一直用CentOS 6 习惯了,一下没适应过来.防火墙配置后执行service iptables save 出现”Failed to restart iptables.service: Unit ip ...

  7. Codeforces Educational Codeforces Round 3 C. Load Balancing 贪心

    C. Load Balancing 题目连接: http://www.codeforces.com/contest/609/problem/C Description In the school co ...

  8. UVA 12904 Load Balancing 暴力

    Load Balancing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/vi ...

  9. Load Balancing 折半枚举大法好啊

    Load Balancing 给出每个学生的学分.   将学生按学分分成四组,使得sigma (sumi-n/4)最小.         算法:   折半枚举 #include <iostrea ...

随机推荐

  1. java-Map-system

    一 概述 0--星期日1--星期一... 有对应关系,对应关系的一方是有序的数字,可以将数字作为角标. public String getWeek(int num){ if(num<0 || n ...

  2. 使用Cmder 安装 Composer 出现 "attempt to call a nil value"

    原因: 不是这个原因,也不是那个原因,而是采用了中文路径, 把comder 整个搬到其他目录就行了

  3. angular依赖注入(3) —— 的提供商

    一.注册商必须写在NgModel当中,不然只能对当前组件注入 二.写法: 1.令牌:providers:[Logger,Data] 2.供应商定义对象:providers:[{provide:Logg ...

  4. myeclipse10 java builder path libraries 添加tomcat

    Error:     The import javax.servlet cannot be resolved     The import javax.servlet.http.HttpServlet ...

  5. 批量删除maven lastUpdated

    批量删除lastUpdated for /r %i in (*.lastUpdated) do del %i 安装jar到本地仓库 mvn install:install-file -Dfile=D: ...

  6. SpringBoot启动报错Failed to determine a suitable driver class

    SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...

  7. Vue. 之 npm安装Element

    Vue. 之 npm安装Element 前提: 相关运行环境以搭建完成,例如:Node.Npm等.    假如我的项目目录如下: D:\DISK WORKSPACE\VSCODE\CDS\cds-ap ...

  8. Python 运算符括号

  9. 安装babel-preset-stage-0为了不打包所有的组件

    今天 看到一段话 是否是我们可以通过这个自定义多种组件,但是只选择我们需要的组件进行打包

  10. C++ 浮点数 为 0 的判断