ADC

使用 NSPEPI 工具转换策略表达式

注意:

您可以从公共 GitHub 下载 NSPEPI 和预配置检查工具。有关下载、安装和使用这些工具的详细说明,请参阅 GitHub NSPEPI 页面和自述文件页面。我们建议客户使用 GitHub 中提供的工具获取最完整和最新的版本。

NetScaler 12.0 版本 56.20 起已弃用经典的基于策略的特性和功能。 作为替代方案,NetScaler 建议您使用高级策略基础结构来实现 NSPEPI 工具支持的功能。有关支持功能的列表,请参阅 nspepi 转换工具处理的命令或功能。NSPEPI 工具不支持的功能继续支持经典策略。有关不支持的功能列表,请参阅 NSPEPI 工具不支持的功能

nspepi工具可以执行以下任务:

  1. 将传统策略表达式转换为高级策略表达式
  2. 将某些 Classic 策略及其实体绑定转换为高级策略和绑定。
  3. 将更多已弃用的功能转换为相应的未弃用功能。
  4. 将经典过滤器命令转换为高级过滤器命令

注意:

nspepi 工具成功转换 ns.conf 配置文件后,该工具会将转换后的文件显示为带有前缀“new_”的新文件。如果转换后的配置文件有错误或警告,则必须在转换过程中手动修复它们。转换后,必须在测试环境中测试该文件,然后使用它替换实际的 ns.conf 配置文件。测试后,必须为新转换或修复的 ns.conf 配置文件重新启动设备。

仅支持 Classic 策略或表达式的功能将被弃用,可以由相应的未弃用功能替换。

注意:

有关 nspepi 工具旧版本的信息以 PDF 格式提供。有关更多信息,请参阅 12.1-51.16 之前使用 nspepi 工具进行经典策略转换 PDF。

转换警告和错误文件

在使用该工具进行转换之前,需要记住一些警告:

  1. 所有警告和错误都会输出到控制台。在存储配置文件的位置创建了一个警告文件。
  2. 警告和错误文件与输入文件的名称相同,但在文件名中添加了前缀“warn_”。在表达式转换期间(使用-e 时),警告会显示在名为“warn_expr”的当前目录中。

注意:

此文件采用标准日志文件格式,带有日期/时间戳和日志级别。由于该工具多次运行,因此文件的先前实例会保留“.1”、“.2”等后缀。最多将保留 10 个实例。

转换的文件格式

转换配置文件时(使用“-f”),转换后的文件将放入与输入配置文件存在的同一目录中,名称相同,但前缀为“new_”。

nspepi 转换工具处理的命令或功能

以下是在自动转换过程中处理的命令。

  • 以下经典策略及其表达式将转换为高级策略和表达式。转换包括实体绑定和全局绑定。
  1. add appfw policy
  2. 添加 cmp 策略
  3. 添加 cr 策略
  4. 添加 cs 策略
  5. add ssl policy
  6. add filter action
  7. add filter policy
  8. 过滤器策略绑定到负载平衡、内容切换、缓存重定向和全局。
  • 在“添加 lb 虚拟服务器”中配置的规则参数将从经典表达式转换为高级表达式。
  • 在“add ns httpProfile”或“set ns httpProfile”命令中配置的 SPDY 参数将更改为“-http2 ENABLED”。
  • 命名表达式(“add policy expression”命令)。每个 Classic 命名策略表达式都将转换为其对应的高级命名表达式,并将“nspepi_adv_”设置为前缀。此外,转换后的 Classic 表达式的命名表达式的用法将更改为相应的高级命名表达式。此外,每个命名表达式都有两个命名表达式,其中一个是 Classic,另一个是 Advanced(如下所示)。
  • 支持通道流量策略转换。
  • 在 CMP、CR 和 Tunnel 中处理内置的经典策略绑定。
  • Patclass 要素将转换为 Pat 集要素。
  • “add rewrite action”命令中的“-pattern”参数被转换为使用“-search”参数。
  • 高级表达式的 Q 和 S 前缀将转换为等效的未弃用的高级表达式。这些表达式可以在任何允许使用高级表达式的命令中看到。

例如:

add policy expression classic_expr ns_true
Converts to:
add policy expression classic_expr ns_true
add policy expression nspepi_adv_classic_expr TRUE
<!--NeedCopy-->
  • 删除在“set cmp parameter”命令中配置的 policyType 参数。默认情况下,策略类型为“高级”。

将经典过滤器命令转换为高级过滤器命令

nspepi 工具可以将基于传统过滤器操作(如添加、绑定等)的命令转换为高级过滤器命令。

但是,nspepi 工具不支持以下过滤器命令。

  1. add filter action <action Name> FORWARD <service name>
  2. add filter action <action name> ADD prebody
  3. add filter action <action name> ADD postbody

注意:

  1. 如果 ns.conf 中存在现有的重写或响应程序功能,并且它们的策略使用 GOTO 表达式作为 ENDUSER_INVOCATION_RESULT 进行全局绑定,并且绑定类型为 REQ_XRES_X,则该工具会部分转换绑定过滤器命令并注释掉。手动转换时显示错误。
  2. 如果存在现有的重写或响应程序功能,并且它们的策略绑定到带有 GOTO - ENDUSER_INVOCATION_RESULT 的 HTTPS 类型的虚拟服务器(例如,负载平衡、内容切换或缓存重定向),则该工具会部分转换绑定过滤器命令,然后注释掉。显示手动转换的警告。

示例

以下是输入示例:

add lb vserver v1 http 1.1.1.1 80 -persistenceType NONE -cltTimeout 9000
add cs vserver csv1 HTTP 1.1.1.2 80 -cltTimeout 180 -persistenceType NONE
add cr vserver crv1 HTTP 1.1.1.3 80 -cacheType FORWARD
add service svc1 1.1.1.4 http 80
add filter action fact_add add 'header:value'
add filter action fact_variable add 'H1:%%HTTP.TRANSID%%'
add filter action fact_prebody add prebody
add filter action fact_error_act1 ERRORCODE 200 "<HTML>Good URL</HTML>"
add filter action fact_forward_act1 FORWARD svc1
add filter policy fpol_add_res -rule ns_true -resAction fact_add
add filter policy fpol_error_res -rule ns_true -resAction fact_error_act1
add filter policy fpol_error_req -rule ns_true -reqAction fact_error_act1
add filter policy fpol_add_req -rule ns_true -reqAction fact_add
add filter policy fpol_variable_req -rule ns_true -reqAction fact_variable
add filter policy fpol_variable_res -rule ns_true -resAction fact_variable
add filter policy fpol_prebody_req -rule ns_true -reqAction fact_prebody
add filter policy fpol_prebody_res -rule ns_true -resAction fact_prebody
add filter policy fpol_forward_req -rule ns_true -reqAction fact_forward_act1
bind lb vserver v1 -policyName fpol_add_res
bind lb vserver v1 -policyName fpol_add_req
bind lb vserver v1 -policyName fpol_error_res
bind lb vserver v1 -policyName fpol_error_req
bind lb vserver v1 -policyName fpol_variable_res
bind lb vserver v1 -policyName fpol_variable_req
bind lb vserver v1 -policyName fpol_forward_req
bind cs vserver csv1 -policyName fpol_add_req
bind cs vserver csv1 -policyName fpol_add_res
bind cs vserver csv1 -policyName fpol_error_res
bind cs vserver csv1 -policyName fpol_error_req
bind cr vserver crv1 -policyName fpol_add_req
bind cr vserver crv1 -policyName fpol_add_res
bind cr vserver crv1 -policyName fpol_error_res
bind cr vserver crv1 -policyName fpol_error_req
bind cr vserver crv1 -policyName fpol_forward_req
bind filter global fpol_add_req
bind filter global fpol_add_res
bind filter global fpol_error_req
bind filter global fpol_error_res
bind filter global fpol_variable_req
bind filter global fpol_variable_res
bind filter global fpol_variable_res -state DISABLED
bind filter global fpol_prebody_req
bind filter global fpol_forward_req
After conversion, warning/error messages will be displayed for manual effort.
Warning files:
cat warn_<input file name>:
2019-11-07 17:13:34,724: ERROR - Conversion of [add filter action fact_prebody add prebody] not supported in this tool.
2019-11-07 17:13:34,739: ERROR - Conversion of [add filter action fact_forward_act1 FORWARD svc1] not supported in this tool.
2019-11-07 17:13:38,042: ERROR - Conversion of [add filter policy fpol_prebody_req -rule ns_true -reqAction fact_prebody] not supported in this tool.
2019-11-07 17:13:38,497: ERROR - Conversion of [add filter policy fpol_prebody_res -rule ns_true -resAction fact_prebody] not supported in this tool.
2019-11-07 17:13:39,035: ERROR - Conversion of [add filter policy fpol_forward_req -rule ns_true -reqAction fact_forward_act1] not supported in this tool.
2019-11-07 17:13:39,060: WARNING - Following bind command is commented out because state is disabled. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. If command is required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config': bind filter global fpol_variable_res -state DISABLED


<!--NeedCopy-->

以下是示例输出。所有转换的命令都会被注释。

cat new_<input file name>
add rewrite action fact_add insert_http_header header ""value""
add filter action fact_prebody add prebody
add filter action fact_forward_act1 FORWARD svc1
add filter policy fpol_prebody_req -rule ns_true -reqAction fact_prebody
add filter policy fpol_prebody_res -rule ns_true -resAction fact_prebody
add filter policy fpol_forward_req -rule ns_true -reqAction fact_forward_act1
bind lb vserver v1 -policyName fpol_forward_req
bind cr vserver crv1 -policyName fpol_forward_req
#bind filter global fpol_variable_res -state DISABLED
bind filter global fpol_prebody_req
bind filter global fpol_forward_req
add rewrite action nspepi_adv_fact_variable insert_http_header H1 HTTP.RES.TXID
add rewrite action fact_variable insert_http_header H1 HTTP.REQ.TXID
add responder action fact_error_act1 respondwith "HTTP.REQ.VERSION.APPEND(" 200 OK\r
nConnection: close\r
nContent-Length: 21\r\n\r
n<HTML>Good URL</HTML>")"
add rewrite action nspepi_adv_fact_error_act1 replace_http_res "HTTP.REQ.VERSION.APPEND(" 200 OK\r
nConnection: close\r
nContent-Length: 21\r\n\r
n<HTML>Good URL</HTML>")"
add rewrite policy fpol_add_res TRUE fact_add
add rewrite policy fpol_error_res TRUE nspepi_adv_fact_error_act1
add responder policy fpol_error_req TRUE fact_error_act1
add rewrite policy fpol_add_req TRUE fact_add
add rewrite policy fpol_variable_req TRUE fact_variable
add rewrite policy fpol_variable_res TRUE nspepi_adv_fact_variable
set cmp parameter -policyType ADVANCED
bind rewrite global fpol_add_req 100 NEXT -type REQ_DEFAULT
bind rewrite global fpol_variable_req 200 NEXT -type REQ_DEFAULT
bind rewrite global fpol_add_res 100 NEXT -type RES_DEFAULT
bind rewrite global fpol_error_res 200 NEXT -type RES_DEFAULT
bind rewrite global fpol_variable_res 300 NEXT -type RES_DEFAULT
bind responder global fpol_error_req 100 END -type REQ_DEFAULT
bind lb vserver v1 -policyName fpol_add_res -type RESPONSE -priority 100 -gotoPriorityExpression NEXT
bind lb vserver v1 -policyName fpol_error_res -type RESPONSE -priority 200 -gotoPriorityExpression NEXT
bind lb vserver v1 -policyName fpol_variable_res -type RESPONSE -priority 300 -gotoPriorityExpression NEXT
bind lb vserver v1 -policyName fpol_add_req -type REQUEST -priority 100 -gotoPriorityExpression NEXT
bind lb vserver v1 -policyName fpol_variable_req -type REQUEST -priority 200 -gotoPriorityExpression NEXT
bind lb vserver v1 -policyName fpol_error_req -type REQUEST -priority 100 -gotoPriorityExpression END
bind cs vserver csv1 -policyName fpol_add_req -type REQUEST -priority 100 -gotoPriorityExpression NEXT
bind cs vserver csv1 -policyName fpol_add_res -type RESPONSE -priority 100 -gotoPriorityExpression NEXT
bind cs vserver csv1 -policyName fpol_error_res -type RESPONSE -priority 200 -gotoPriorityExpression NEXT
bind cs vserver csv1 -policyName fpol_error_req -type REQUEST -priority 100 -gotoPriorityExpression END
bind cr vserver crv1 -policyName fpol_add_req -type REQUEST -priority 100 -gotoPriorityExpression NEXT
bind cr vserver crv1 -policyName fpol_add_res -type RESPONSE -priority 100 -gotoPriorityExpression NEXT
bind cr vserver crv1 -policyName fpol_error_res -type RESPONSE -priority 200 -gotoPriorityExpression NEXT
bind cr vserver crv1 -policyName fpol_error_req -type REQUEST -priority 100 -gotoPriorityExpression END

<!--NeedCopy-->

如果现有的重写或响应程序策略绑定具有 goto 表达式 END 或 USE_INNVOCATION,则将经典过滤器命令转换为高级功能命令

在此转换中,如果重写策略绑定到一个或多个虚拟服务器,并且服务器具有 END 或 USE_INVOCATION_RESULT,则该工具会注释掉这些命令。

示例

以下是一个示例输入命令:

COPY
add filter policy fpol1 -rule ns_true -resAction reset
add filter policy fpol2 -rule ns_true -reqAction reset
add rewrite policy pol1 true NOREWRITE
add rewrite policylabel pl http_res
bind rewrite policylabel pl pol1 1
bind rewrite global NOPOLICY 1 USE_INVOCATION_RESULT -type RES_DEFAULT -invoke policylabel pl
add responder policy pol2 true NOOP
add responder policylabel pl -policylabeltype HTTP
bind responder policylabel pl pol2 1
bind responder global NOPOLICY 1 USE_INVOCATION_RESULT -type REQ_DEFAULT -invoke policylabel pl
bind lb vserver v1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE
bind cs vserver csv1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE
bind lb vserver v1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST
bind cs vserver csv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST
bind cr vserver crv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST
bind lb vserver v1_http -policyName fpol1
bind cs vserver csv1_http -policyName fpol1
bind lb vserver v2_http -policyName fpol2
bind cs vserver csv2_http -policyName fpol2
bind cr vserver crv2_http -policyName fpol2
bind filter global fpol1 -priority 100
bind filter global fpol2 -priority 100
<!--NeedCopy-->

以下是示例输出命令:

COPY
add rewrite policy pol1 true NOREWRITE
add rewrite policylabel pl http_res
bind rewrite policylabel pl pol1 1
add responder policy pol2 true NOOP
add responder policylabel pl -policylabeltype HTTP
bind responder policylabel pl pol2 1
add rewrite policy fpol1 TRUE RESET
add responder policy fpol2 TRUE RESET
#bind lb vserver v1_http -policyName fpol1 -type RESPONSE
#bind cs vserver csv1_http -policyName fpol1 -type RESPONSE
#bind rewrite global fpol1 100 -type RES_DEFAULT
#bind lb vserver v2_http -policyName fpol2 -type REQUEST
#bind cs vserver csv2_http -policyName fpol2 -type REQUEST
#bind cr vserver crv2_http -policyName fpol2 -type REQUEST
#bind responder global fpol2 100 -type REQ_DEFAULT
bind rewrite global NOPOLICY 1 USE_INVOCATION_RESULT -type RES_DEFAULT -invoke policylabel pl
bind responder global NOPOLICY 1 USE_INVOCATION_RESULT -type REQ_DEFAULT -invoke policylabel pl
bind lb vserver v1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE
bind lb vserver v1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST
bind cs vserver csv1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE
bind cs vserver csv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST
bind cr vserver crv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST-

<!--NeedCopy-->

运行 nspepi 工具

以下是运行 nspepi 工具的命令行示例。此工具从 shell 的命令行运行(您需要在 NetScaler” CLI “中键入“shell”命令才能执行该命令)。必须指定“-f”或“-e”才能执行转换。使用“-d”是为了让 Citrix 人员出于支持目的进行分析。

usage: nspepi [-h] (-e <classic policy expression> | -f <path to ns config file>)[-d] [-v] [-V

Convert classic policy expressions to advanced policy expressions and deprecated commands to non-deprecated
commands.

optional arguments:
-h, --help show this help message and exit
-e <classic policy expression>, --expression <classic policy expression>
convert classic policy expression to advanced policy
expression (maximum length of 8191 allowed)
-f <path to ns config file>, --infile <path to ns config file>
convert netscaler config file
-d, --debug log debug output
-v, --verbose show verbose output
-V, --version show program's version number and exit
<!--NeedCopy-->

用法示例:

  1. nspepi -e "req.tcp.destport == 80"
  2. nspepi -f /nsconfig/ns.conf

以下是使用 CLI 运行 nspepi 工具的几个示例

—e 参数的输出示例:

root@ns# nspepi -e "req.http.header foo == "bar""
"HTTP.REQ.HEADER("foo").EQ("bar")"
<!--NeedCopy-->

-f 参数的输出示例:

root@ns# cat sample.conf
add cr vserver cr_vs HTTP -cacheType TRANSPARENT -cltTimeout 180 -originUSIP OFF
add cr policy cr_pol1 -rule ns_true
bind cr vserver cr_vs -policyName cr_pol1
<!--NeedCopy-->

使用-f 参数运行 nspepi

nspepi -f sample.conf
<!--NeedCopy-->

转换后的配置在新文件 new_sample.conf 中提供。 检查 warn_sample.conf 文件中是否存在可能已生成的警告或错误。

-f 参数和-v 参数的示例输出

nspepi -f sample.conf -v
INFO - add cr vserver cr_vs HTTP -cacheType TRANSPARENT -cltTimeout 180 -originUSIP OFF
INFO - add cr policy cr_pol1 -rule TRUE -action ORIGIN
INFO - bind cr vserver cr_vs -policyName cr_pol1 -priority 100 -gotoPriorityExpression END -type REQUEST
<!--NeedCopy-->

转换后的配置在新文件 new_sample.conf 中提供。 检查 warn_sample.conf 文件中是否存在可能已生成的警告或错误。

转换后的配置文件:

root@ns# cat new_sample.conf
add cr vserver cr_vs HTTP -cacheType TRANSPARENT -cltTimeout 180 -originUSIP OFF
add cr policy cr_pol1 -rule TRUE -action ORIGIN
set cmp parameter -policyType ADVANCED
bind cr vserver cr_vs -policyName cr_pol1 -priority 100 -gotoPriorityExpression END -type REQUEST

<!--NeedCopy-->

没有错误或警告的示例配置的输出示例:

nspepi -f sample_2.conf
<!--NeedCopy-->

转换后的配置在新文件 new_sample_2.conf 中提供。 检查 warn_sample_2.conf 文件中是否存在可能已生成的警告或错误。

带有警告的示例配置的输出示例:

root@ns# cat sample_2.conf
add policy expression security_expr "req.tcp.destport == 80" -clientSecurityMessage "Not allowed"
set cmp parameter -policyType CLASSIC
add cmp policy cmp_pol1 -rule ns_true -resAction COMPRESS
add cmp policy cmp_pol2 -rule ns_true -resAction COMPRESS
add cmp policy cmp_pol3 -rule TRUE -resAction COMPRESS
bind cmp global cmp_pol1
bind cmp global cmp_pol2 -state DISABLED
bind cmp global cmp_pol3 -priority 1 -gotoPriorityExpression END -type RES_DEFAULT
bind lb vserver lb_vs -policyName cmp_pol2
root@ns#
<!--NeedCopy-->

使用-f 参数运行 nspepi 的示例:

root@ns# nspepi -f sample_2.conf
ERROR - Error in converting expression security_expr : conversion of clientSecurityMessage based expression is not supported.
WARNING - Following bind command is commented out because state is disabled. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. If command is required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config': bind cmp global cmp_pol2 -state DISABLED
Warning - Bindings of advanced CMP policies to cmp global are commented out, because initial global cmp parameter is classic but advanced policies are bound. Now global cmp parameter policy type is set to advanced. If commands are required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config'. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation.
root@ns#
<!--NeedCopy-->

转换后的文件:

root@ns# cat new_sample_2.conf  
add policy expression security_expr "req.tcp.destport == 80" -clientSecurityMessage "Not allowed"
set cmp parameter -policyType ADVANCED
add cmp policy cmp_pol1 -rule TRUE -resAction COMPRESS
add cmp policy cmp_pol2 -rule TRUE -resAction COMPRESS
add cmp policy cmp_pol3 -rule TRUE -resAction COMPRESS
#bind cmp global cmp_pol2 -state DISABLED
#bind cmp global cmp_pol3 -priority 1 -gotoPriorityExpression END -type RES_DEFAULT
bind cmp global cmp_pol1 -priority 100 -gotoPriorityExpression END -type RES_DEFAULT
bind lb vserver lb_vs -policyName cmp_pol2 -priority 100 -gotoPriorityExpression END -type RESPONSE
root@ns#
<!--NeedCopy-->

警告文件:

root@ns# cat warn_sample_2.conf
2019-02-28 06:20:10,590: ERROR - Error in converting expression security_expr : conversion of clientSecurityMessage based expression is not supported.
2019-02-28 06:20:12,187: WARNING - Following bind command is commented out because state is disabled. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. If command is required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config': bind cmp global cmp_pol2 -state DISABLED
2019-02-28 06:20:12,191: WARNING - Bindings of advanced CMP policies to cmp global are commented out, because initial global cmp parameter is classic but advanced policies are bound. Now global cmp parameter policy type is set to advanced. If commands are required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config'. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation.
root@ns#
<!--NeedCopy-->

绑定优先级

高级策略不允许在全局和非全局之间以及在不同绑定类型之间按优先级进行任意交错。如果您依赖传统策略优先级的这种交织,则需要调整优先级以符合高级策略规则并获得所需的行为。 高级策略中的优先级是绑定点的本地优先级。绑定点是协议、功能、方向和实体的唯一组合(实体是特定的虚拟服务器、用户、组、服务以及全局覆盖或全局默认值)。不会跨绑定点遵循策略优先级。

对于给定的协议、功能和方向,以下是高级策略的评估顺序:

  • 全局覆盖。
  • (当前)身份验证、授权和审核用户。
  • 按权重顺序排列的身份验证、授权和审核组(用户是其中的成员)—— 如果两个或更多组具有相同的权重,则排序未定义。
  • 接收请求或选择了内容交换的 LB 虚拟服务器。
  • 内容交换虚拟服务器,接收请求的缓存重定向虚拟服务器。
  • 通过负载平衡选择的服务。
  • 全局默认值。

在每个绑定点内,将按照优先级从最低编号到最高编号的顺序对策略进行评估。仅针对所使用的协议和接收消息的方向评估策略。

需要手动调整优先级的经典策略绑定

以下是一些需要手动调整优先级才能满足您的需求的经典策略绑定类型。所有这些都是针对给定要素和方向的。

  • 与上述实体类型列表的方向相反的优先级数增加的典型优先级。例如,内容交换虚拟服务器绑定低于负载平衡虚拟服务器绑定。
  • 除身份验证、授权和审核组的权重顺序以外的数量增加的传统优先级。
  • 低于某些非全局优先级和相同全局优先级的传统全局优先级比其他一些非全局优先级更大(换言之,任何非全局优先级段,后跟一个或多个全局优先级,后跟一个非全局优先级)。

NSPEPIcheck_invalid_config 工具可以在 CentOSUbuntu 系统上运行

以下模块是使用这些工具的必备条件:

  • Python
  • Perl
  • Python 画面模块
  • Python 的 PLY 模块
  • 用 Perl 切换.pm

如果安装了 Python 3,则创建一个软链接,例如 "ln -s /usr/bin/python3 /usr/bin/python"

要在 CentOS 中安装 Python pip 模块、适用于 Python 的 PLY 模块和适用于 Perl 的 Switch.pm,请运行以下命令:

  • sudo yum install -y perl-Switch
  • sudo yum install python-pip
  • sudo yum install python-ply

要在 Ubuntu 中安装 Python pip 模块、适用于 Python 的 PLY 模块和适用于 Perl 的 Switch.pm,请运行以下命令:

  • sudo apt install libswitch-perl
  • sudo apt install python-ply
  • sudo apt install python-pip or sudo apt install python3-pip