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

设定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. cmake how to create vs file filters

    用cmakelists构建出来的工程,没有文件filters,可采用如下方法解决 set(SOURCE_LIST "lotteryTicket.cpp" "stdafx. ...

  2. day37 04-Hibernate二级缓存:list和iterate方法比较

    get()和load()方法既可以向一级缓存区放数据,也可以向二级缓存区放数据.这是查询一个的情况.要是查询所有呢?注意, // 查询所有.Query接口的list()方法. // list()方法会 ...

  3. python实例 函数

    #! /usr/bin/python # -*- coding: utf8 -*- def sum(a,b):     return a+b func = sum r = func(5,6) prin ...

  4. Sublime Text Version 3.2.1(Build 3207)注册

    Sublime Text Version 3.2.1, Build 3207 一. host添加地址 C:\Windows\System32\drivers\etc\hosts 127.0.0.1 l ...

  5. 稳定性专题 | StackOverFlowError 常见原因及解决方法

    导读 『StabilityGuide』是阿里多位阿里技术工程师共同发起的稳定性领域的知识库开源项目,涵盖性能压测.故障演练.JVM.应用容器.服务框架.流量调度.监控.诊断等多个技术领域,以更结构化的 ...

  6. HTML input type=file文件选择表单的汇总(一)

    HTML input type=file 在onchange上传文件的过程中,遇到同一个文件二次上传无效的问题. 最近在做项目过程中,遇到同一文件上传的时候,二次上传没有效果,找了资料,找到了原因: ...

  7. java路径中'/'的使用

    考虑java的跨系统:uinux和winw7中的‘/'标识方法不同,使用下放语句可避免 File.separator;//代表"/"

  8. 项目ITP(七) javaWeb 整合 Quartz 实现动态调度 而且 持久化

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/u010378410/article/details/36255511 项目ITP(七) javaWe ...

  9. 【JZOJ4816】【NOIP2016提高A组五校联考4】label

    题目描述 输入 输出 样例输入 3 2 2 0 1 2 3 3 2 1 3 1 2 3 3 1 1 2 2 3 样例输出 4 2 12 数据范围 样例解释 解法 设f[i][j]为在第i个点填了j的合 ...

  10. 【转载】CPU相关总结

    What is the difference between Processor, Core, Logical Processor ? Processor : It’s the physical co ...