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

设定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. win10 下安装 neo4j

    1.neo4j介绍 neo4j是基于Java语言编写图形数据库.图是一组节点和连接这些节点的关系.图形数据库也被称为图形数据库管理系统或GDBMS.详细介绍可看Neo4j 教程 2.安装Java jd ...

  2. 【模板】 递归线段树 [2017年五月计划 清北学堂51精英班Day4]

    P3372 [模板]线段树 1 题目描述 如题,已知一个数列,你需要进行下面两种操作: 1.将某区间每一个数加上x 2.求出某区间每一个数的和 输入输出格式 输入格式: 第一行包含两个整数N.M,分别 ...

  3. shell 向python传参数,空格引发的问题

    昨天用一个shell脚本,调用一个python脚本,并把shell脚本中用 time1=`date "+%Y-%m-%d %H:%M:%S"`生成的时间戳作为参数,传到python ...

  4. Django 点滴

    1.views 中可用 render 传递参数 def home(request): info_dict = {'site': u'震撼学习', 'content': u'各种IT技术'} #Tuto ...

  5. Duplicate a whole line in Vim

    yy or Y to copy the line or dd to delete (cutting) the line then p to paste the copied or deleted te ...

  6. This Product is covered by one or more of the folloWing patents

    借用一下网络图片,作为描述: 原因: 启动方式使用了网络启动, 解决方案: 进入bios,修改启动方式,禁用网卡驱动,使用从硬盘启动或者从U盘启动即可.

  7. golang数据类型二

    字符类型 3.14基本数据类型的相互转换 3.15基本数据类型和string的转换 FormatInt // FormatUint 将 int 型整数 i 转换为字符串形式// base:进位制(2 ...

  8. bzoj2073 PRZ

    Description 一只队伍在爬山时碰到了雪崩,他们在逃跑时遇到了一座桥,他们要尽快的过桥. 桥已经很旧了, 所以它不能承受太重的东西. 任何时候队伍在桥上的人都不能超过一定的限制. 所以这只队伍 ...

  9. 基于Spark Mllib的Spark NLP库

    SparkNLP的官方文档 1>sbt引入: scala为2.11时 libraryDependencies += "com.johnsnowlabs.nlp" %% &qu ...

  10. 四.使用JDBC进行批处理操作

    1 create table testbatch 2 ( 3 id int primary key, 4 name varchar(20) 5 ); 在实际的项目开发中,有时候需要向数据库发送一批SQ ...