了解负载平衡实体模板和部署文件

创建负载平衡实体模板的方式与创建 Citrix ADC 应用程序模板相同。将负载平衡虚拟服务器导出到模板文件时,将自动创建以下两个文件:

  • 负载平衡虚拟服务器模板文件。包含存储为负载平衡虚拟服务器配置的参数值的 XML 元素。该文件还包含用于存储有关绑定策略的信息的 XML 元素。
  • 部署文件。包含存储特定于部署的信息(如服务、服务组和配置变量)的 XML 元素。

在模板和部署文件中,每个配置信息单元都封装在用于该单元类型的特定 XML 元素中。例如,负载平衡方法参数 LbMethod 封装在 <lbmethod></lbmethod> 标签中。

注意:导出负载平衡虚拟服务器后,可以在将配置信息导入 Citrix ADC 设备之前添加元素、删除元素和修改现有元素。

负载平衡虚拟服务器模板示例

下面是从名为“Lbvip”的负载平衡虚拟服务器创建的模板文件示例:


<?xml version="1.0" encoding="UTF-8" ?>
  <template>
    <template_info>
      <entity_name>Lbvip</entity_name>
      <version_major>10</version_major>
      <version_minor>0</version_minor>
      <build_number>40.406</build_number>
    </template_info>
    <entitytemplate>
      <lbvserver_list>
        <lbvserver>
          <name>Lbvip</name>
          <servicetype>HTTP</servicetype>
          <ipv46>0.0.0.0</ipv46>
          <ipmask>*</ipmask>
          <port>0</port>
          <range>1</range>
          <persistencetype>NONE</persistencetype>
          <timeout>2</timeout>
          <persistencebackup>NONE</persistencebackup>
          <backuppersistencetimeout>2</backuppersistencetimeout>
          <lbmethod>LEASTCONNECTION</lbmethod>
          <persistmask>255.255.255.255</persistmask>
          <v6persistmasklen>128</v6persistmasklen>
          <pq>OFF</pq>
          <sc>OFF</sc>
          <m>IP</m>
          <datalength>0</datalength>
          <dataoffset>0</dataoffset>
          <sessionless>DISABLED</sessionless>
          <state>ENABLED</state>
          <connfailover>DISABLED</connfailover>
          <clttimeout>180</clttimeout>
          <somethod>NONE</somethod>
          <sopersistence>DISABLED</sopersistence>
          <sopersistencetimeout>2</sopersistencetimeout>
          <redirectportrewrite>DISABLED</redirectportrewrite>
          <downstateflush>DISABLED</downstateflush>
          <gt2gb>DISABLED</gt2gb>
          <ipmapping>0.0.0.0</ipmapping>
          <disableprimaryondown>DISABLED</disableprimaryondown>
          <insertvserveripport>OFF</insertvserveripport>
          <authentication>OFF</authentication>
          <authn401>OFF</authn401>
          <push>DISABLED</push>
          <pushlabel>none</pushlabel>
          <l2conn>OFF</l2conn>
          <appflowlog>DISABLED</appflowlog>
          <icmpvsrresponse>PASSIVE</icmpvsrresponse>
          <lbvserver_cmppolicy_binding_list>
            <lbvserver_cmppolicy_binding>
              <name>Lbvip</name>
              <policyname>NOPOLICY-COMPRESSION</policyname>
              <priority>100</priority>
              <gotopriorityexpression>END</gotopriorityexpression>
              <bindpoint>REQUEST</bindpoint>
            </lbvserver_cmppolicy_binding>
          </lbvserver_cmppolicy_binding_list>
        </lbvserver>
      </lbvserver_list>
    </entitytemplate>
  </template>

部署文件示例

下面是前面示例中与虚拟服务器关联的部署文件:


<?xml version="1.0" encoding="UTF-8" ?>
  <template_deployment>
    <template_info>
      <entity_name>Lbvip</entity_name>
      <version_major>10</version_major>
      <version_minor>0</version_minor>
      <build_number>40.406</build_number>
    </template_info>
    <service_list>
      <service>
      <ip>1.2.3.4</ip>
      <port>80</port>
      <servicetype>HTTP</servicetype>
      </service>
    </service_list>
    <servicegroup_list>
      <servicegroup>
        <name>svcgrp</name>
        <servicetype>HTTP</servicetype>
        <servicegroup_servicegroupmember_binding_list>
          <servicegroup_servicegroupmember_binding>
            <ip>1.2.3.90</ip>
            <port>80</port>
          </servicegroup_servicegroupmember_binding>
        <servicegroup_servicegroupmember_binding>
          <ip>1.2.8.0</ip>
          <port>80</port>
        </servicegroup_servicegroupmember_binding>
        <servicegroup_servicegroupmember_binding>
          <ip>1.2.8.1</ip>
          <port>80</port>
        </servicegroup_servicegroupmember_binding>
        <servicegroup_servicegroupmember_binding>
          <ip>1.2.9.0</ip>
          <port>80</port>
        </servicegroup_servicegroupmember_binding>
      </servicegroup_servicegroupmember_binding_list>
    </servicegroup>
  </servicegroup_list>
</template_deployment>

了解负载平衡实体模板和部署文件