为新一代服务配置机箱间服务冗余
本主题介绍如何为新一代服务配置机箱间服务冗余。本主题包含配置不间断服务冗余(双向自动切换)和单向冗余(仅从原始主服务自动切换到原始备用服务)的过程。
您还可以使用手动请求命令释放或获取主要角色:
request services redundancy-set redundancy-set trigger redundancy-event event-name <force>
命令会自动触发指定的冗余事件。您必须创建一个配置,用于将冗余事件分配给发布或获取主要角色的冗余策略。您还必须将冗余策略分配给命令中使用的冗余集。
为下一代服务服务集配置不间断服务冗余
不间断服务冗余可在发生关键事件时在 MX 系列路由器之间实现自动服务切换。从网关 1 到网关 2 以及从网关 2 到网关 1 的自动切换无需人工干预。
要为服务集配置不间断服务冗余,请在 gateway1 和 gateway2 上执行以下步骤:
- 配置一个或多个冗余事件,以监控触发服务切换到对等网关的情况。
- 为冗余事件配置名称。
[edit services] user@host# set event-options redundancy-event event-name
例如:
[edit services] user@host# set event-options redundancy-event RELS_MSHIP_CRIT_EV
- 指定在接口关闭时触发服务切换的任何接口。
[edit services event-options redundancy-event event-name] user@host# set monitor link-down [interface-name]
- 指定进程路由守护程序重新启动请求触发服务切换。
[edit services event-options redundancy-event event-name] user@host# set monitor process routing restart
- 指定进程路由守护程序终止请求触发服务切换。
[edit services event-options redundancy-event event-name] user@host# set monitor process routing abort
- 指定来自对等方获取所有权的请求将触发服务切换。
[edit services event-options redundancy-event event-name] user@host# set monitor peer mastership-acquire
- 为冗余事件配置名称。
- 配置冗余策略,当满足冗余事件条件时,释放主角色并删除静态路由。
- 为策略配置名称。
user@host# edit policy-options redundancy-policy policy-name
例如:
user@host# edit policy-options redundancy-policy RLS_MSHIP_POL
- 指定释放主要角色的冗余事件。
[edit policy-options redundancy-policy policy-name] user@host# set redundancy-events [event-list]
例如:
[edit policy-options redundancy-policy RLS_MSHIP_POL user@host# set redundancy-events RELS_MSHIP_CRIT_EV
如果希望能够运行
request services redundancy-set redundancy-set trigger redundancy-event event-name <force>手动释放主要角色,请将其包含在 event-name 冗余策略中。冗余事件本身不需要配置,因为它是由 request 命令触发的。例如:
[edit policy-options redundancy-policy RLS_MSHIP_POL user@host# set redundancy-events [RELS_MSHIP_CRIT_EV RELS_MSHIP_MANUAL_EV]
- 释放主要角色。
[edit policy-options redundancy-policy policy-name] user@host# set then release-mastership
- 删除静态路由。
[edit policy-options redundancy-policy policy-name] user@host# set then delete-static-route destination (receive | next-hop next-hop) routing-instance routing-instance
- 为策略配置名称。
- 配置冗余事件以确定对等网关何时释放主要角色。
[edit services] user@host# set event-options redundancy-event event-name monitor peer release-mastership
例如:
[edit services] user@host# set event-options redundancy-event PEER_RELS_MSHIP_EV monitor peer release-mastership
- 配置冗余策略,从对等网关获取主要角色并添加静态路由。
- 为策略配置名称。
user@host# edit policy-options redundancy-policy policy-name
例如:
user@host# edit policy-options redundancy-policy ACQU_MSHIP_POL
- 指定获取主要角色的冗余事件。
[edit policy-options redundancy-policy policy-name] user@host# set redundancy-events [event-list]
例如:
[edit policy-options redundancy-policy ACQU_MSHIP_POL] user@host# set redundancy-events PEER_RELS_MSHIP_EV
如果您希望能够运行以手动获取主要角色,
request services redundancy-set redundancy-set trigger redundancy-event event-name <force>请将其包含在 event-name 冗余策略中。冗余事件本身不需要配置,因为它是由 request 命令触发的。例如:
[edit policy-options redundancy-policy ACQU_MSHIP_POL] user@host# set redundancy-events [PEER_RELS_MSHIP_EV ACQU_MSHIP_MANUAL_EV]
- 获取主要角色。
[edit policy-options redundancy-policy policy-name] user@host# set then acquire-mastership
- 添加静态路由。
[edit policy-options redundancy-policy policy-name] user@host# set then add-static-route destination (receive | next-hop next-hop) routing-instance routing-instance
- 为策略配置名称。
- 配置冗余集。
- 为冗余集配置名称。
[edit services] user@host# set redundancy-set redundancy-set
例如:
[edit services] user@host# set redundancy-set 1
- 指定冗余集的冗余组 ID。
[edit services redundancy-set redundancy-set] user@host# set redundancy-group redundancy-group
例如:
[edit services redundancy-set 1] user@host# set redundancy-group 1
冗余组 ID 是通过现有 ICCP 配置层次结构为 ICCP 守护程序 (iccpd) 配置的相同冗余组 ID。例如
iccp { local-ip-addr 10.1.1.1; peer 10.2.2.2 { redundancy-group-id-list 1; liveness-detection { minimum-interval 1000; } } } - 指定释放主要角色的冗余策略和获取主要角色的冗余策略。
[edit services redundancy-set redundancy-set] user@host# set redundancy-policy [redundancy-policy-list]
例如:
[edit services redundancy-set 1] user@host# set redundancy-policy [ACQU_MSHIP_POL RLS_MSHIP_POL]
- 配置冗余集的运行状况检查探测频率(以秒为单位)。
[edit services redundancy-set redundancy-set] user@host# set healthcheck-timer-interval healthcheck-timer-interval
默认设置为 30 秒。
- 配置帮助检查响应的最长等待时间(以秒为单位)。
[edit services redundancy-set redundancy-set] user@host# set hold-time hold-time
范围为 0 到 3600 秒。
- 配置 srd hello 消息的频率(以秒为单位)。
[edit services redundancy-set redundancy-set] user@host# set keepalive keepalive
范围为 1 到 60 秒。
- 为冗余集配置名称。
- 配置路由策略。
- 确定需要与冗余相关的路由更改的信号路由。指定使用的信号路由和路由表。
[edit policy-options condition condition-name} user@host# set if-route-exists signal-route table routing-table
例如:
[edit policy-options condition switchover-route-exists] user@host# set if-route-exists 10.45.45.0/24 table bgp1_table
- 要更改信号路由的本地优先级,请在策略语句中输入该优先级。
[edit policy-options policy-statement policy-name] user@host# set term term from protocol [protocol variables] prefix-list prefix-list condition condition-name then local-preference preference-value accept
- 要更改信号路由的 as 路径前置值,请在策略语句中输入这些值。
[edit policy-options policy-statement policy-name] user@host# set term term from prefix-list prefix-list condition condition-name then as-path-prepend [as-prepend-values] next-hop self accept
- 确定需要与冗余相关的路由更改的信号路由。指定使用的信号路由和路由表。
- 通过将冗余集分配给服务集来配置服务集的冗余。
[edit] user@host# set services service-set service-set-name redundancy-set-id redundancy-set
- 在对等网关上重复这些步骤。
为下一代服务服务集配置单向服务冗余
单向服务冗余为您提供从 gateway1(原始主网关)到 gateway2(原始备用网关)的自动服务切换。不会发生从网关 2 到网关 1 的自动切换。要从网关 2 切换到网关 1,必须执行手动切换。
- 在 gateway1(初始主网关)上,配置一个或多个冗余事件,以监控触发服务切换到备用网关 gateway2 的情况。
- 为冗余事件配置名称。
[edit services] user@gateway1# set event-options redundancy-event event-name
例如:
[edit services] user@gateway1# set event-options redundancy-event RELS_MSHIP_CRIT_EV
- 指定在接口关闭时触发服务切换的任何接口。
[edit services event-options redundancy-event event-name] user@gateway1# set monitor link-down [interface-name]
- 指定进程路由守护程序重新启动请求触发服务切换。
[edit services event-options redundancy-event event-name] user@gateway1# set monitor process routing restart
- 指定进程路由守护程序终止请求触发服务切换。
[edit services event-options redundancy-event event-name] user@gateway1# set monitor process routing abort
- 为冗余事件配置名称。
- 在 gateway1 上,配置冗余策略,当满足冗余事件条件时,释放主角色并删除静态路由。
- 为策略配置名称。
user@gateway1# edit policy-options redundancy-policy policy-name
例如:
user@gateway1# edit policy-options redundancy-policy RLS_MSHIP_POL
- 指定释放主要角色的冗余事件。
[edit policy-options redundancy-policy policy-name] user@gateway1# set redundancy-events [event-list]
例如:
[edit policy-options redundancy-policy RLS_MSHIP_POL] user@gateway1# set redundancy-events RELS_MSHIP_CRIT_EV
如果希望能够运行
request services redundancy-set redundancy-set trigger redundancy-event event-name <force>手动释放主要角色,请将其包含在 event-name 冗余策略中。冗余事件本身不需要配置,因为它是由 request 命令触发的。例如:
[edit policy-options redundancy-policy RLS_MSHIP_POL] user@gateway1# set redundancy-events [RELS_MSHIP_CRIT_EV RELS_MSHIP_MANUAL_EV]
- 释放主要角色。
[edit policy-options redundancy-policy policy-name] user@gateway1# set then release-mastership force
- 删除静态路由。
[edit policy-options redundancy-policy policy-name] user@gateway1# set then delete-static-route destination (receive | next-hop next-hop) routing-instance routing-instance
- 为策略配置名称。
- 在 gateway1 上,配置冗余策略,当您在 gateway1 (
request services redundancy-set redundancy-set trigger redundancy-event event-name <force>) 上执行手动请求时,该策略将从 gateway2 获取主要角色。- 为策略配置名称。
user@gateway1# edit policy-options redundancy-policy policy-name
例如:
user@gateway1# edit policy-options redundancy-policy ACQU_MSHIP_POL
- 指定手动请求使用的冗余事件的名称。
[edit policy-options redundancy-policy policy-name] user@gateway1# set redundancy-events event-name
例如:
[edit policy-options redundancy-policy ACQU_MSHIP_POL] user@gateway1# set redundancy-events ACQU_MSHIP_MANUAL_EV
冗余事件本身不需要配置,因为它是由 request 命令触发的。
- 获取主要角色。
[edit policy-options redundancy-policy policy-name] user@host# set then acquire-mastership
- 为策略配置名称。
- 在 gateway1 上,配置冗余集。
- 为冗余集配置名称。
[edit services] user@gateway1# set redundancy-set redundancy-set
例如:
[edit services] user@gateway1# set redundancy-set 1
- 指定冗余集的冗余组 ID。
[edit services redundancy-set redundancy-set] user@gateway1# set redundancy-group redundancy-group
例如:
[edit services redundancy-set 1] user@gateway1# set redundancy-group 1
冗余组 ID 是通过现有 ICCP 配置层次结构为 ICCP 守护程序 (iccpd) 配置的相同冗余组 ID。例如
iccp { local-ip-addr 10.1.1.1; peer 10.2.2.2 { redundancy-group-id-list 1; liveness-detection { minimum-interval 1000; } } } - 指定释放主要角色的冗余策略和获取主要角色的冗余策略。
[edit services redundancy-set redundancy-set] user@gateway1# set redundancy-policy [redundancy-policy-list]
例如:
[edit services redundancy-set 1] user@gateway1# set redundancy-policy [ ACQU_MSHIP_POL RLS_MSHIP_POL]
- 配置冗余集的运行状况检查探测频率(以秒为单位)。
[edit services redundancy-set redundancy-set] user@gateway1# set healthcheck-timer-interval healthcheck-timer-interval
默认设置为 30 秒。
- 配置帮助检查响应的最长等待时间(以秒为单位)。
[edit services redundancy-set redundancy-set] user@gateway1# set hold-time hold-time
范围为 0 到 3600 秒。
- 配置 srd hello 消息的频率(以秒为单位)。
[edit services redundancy-set redundancy-set] user@gateway1# set keepalive keepalive
范围为 1 到 60 秒。
- 为冗余集配置名称。
- 在网关 1 上,配置路由策略。
- 确定需要与冗余相关的路由更改的信号路由。指定使用的信号路由和路由表。
[edit policy-options condition condition-name} user@gateway1# set if-route-exists signal-route table routing-table
例如:
[edit policy-options condition switchover-route-exists] user@gateway1# set if-route-exists 10.45.45.0/24 table bgp1_table
- 要更改信号路由的本地优先级,请在策略语句中输入该优先级。
[edit policy-options policy-statement policy-name] user@gateway1# set term term from protocol [protocol variables] prefix-list prefix-list condition condition-name then local-preference preference-value accept
- 要更改信号路由的 as 路径前置值,请在策略语句中输入这些值。
[edit policy-options policy-statement policy-name] user@gateway1# set term term from prefix-list prefix-list condition condition-name then as-path-prepend [as-prepend-values] next-hop self accept
- 确定需要与冗余相关的路由更改的信号路由。指定使用的信号路由和路由表。
- 在网关 1 上,通过将冗余集分配给服务集来配置服务集的冗余。
[edit] user@gateway1# set services service-set service-set-name redundancy-set-id redundancy-set
- 在初始备用网关 2 上,配置冗余事件以确定对等网关何时释放主要角色。
[edit services] user@gateway2# set event-options redundancy-event event-name monitor peer release-mastership
例如:
[edit services] user@gateway2# set event-options redundancy-event PEER_RELS_MSHIP_EV monitor peer release-mastership
- 在网关 2 上,配置冗余策略,从对等网关获取主要角色并添加静态路由。
- 为策略配置名称。
user@gateway2# edit policy-options redundancy-policy policy-name
例如:
user@gateway2# edit policy-options redundancy-policy ACQU_MSHIP_POL
- 为对等网关主角色发布事件指定配置的冗余事件。
[edit policy-options redundancy-policy policy-name] user@gateway2# set redundancy-events event-name
例如:
[edit policy-options redundancy-policy ACQU_MSHIP_POL] user@gateway2# set redundancy-events PEER_RELS_MSHIP_EV
- 获取主要角色。
[edit policy-options redundancy-policy policy-name] user@gateway2# set then acquire-mastership
- 添加静态路由。
[edit policy-options redundancy-policy policy-name] user@gateway2# set then add-static-route destination (receive | next-hop next-hop) routing-instance routing-instance
- 为策略配置名称。
- 在 gateway2 上,配置冗余事件以标识对等网关何时请求主角色。
[edit services] user@gateway2# set event-options redundancy-event event-name monitor peer mastership-acquire
例如:
[edit services] user@gateway2# set event-options redundancy-event PEER_MSHIP_ACQU_EV monitor peer mastership-acquire
- 在网关 2 上,配置冗余策略,当网关 1 请求主要角色时,释放主要角色并删除静态路由。
- 为策略配置名称。
user@gateway2# edit policy-options redundancy-policy policy-name
例如:
user@gateway2# edit policy-options redundancy-policy RELS-MSHIP_POL
- 指定配置的冗余事件,用于标识对等网关何时请求主角色。
[edit policy-options redundancy-policy policy-name] user@gateway2# set redundancy-events event-name
例如:
[edit policy-options redundancy-policy RELS-MSHIP_POL] user@gateway2# set redundancy-events PEER_MSHIP_ACQU_EV
- 释放主要角色。
[edit policy-options redundancy-policy policy-name] user@gateway2# set then release-mastership force
- 删除静态路由。
[edit policy-options redundancy-policy policy-name] user@gateway2# set then delete-static-route destination (receive | next-hop next-hop) routing-instance routing-instance
- 为策略配置名称。
- 在 gateway2 上,配置一个或多个冗余事件以监控触发警告的情况。
- 为冗余事件配置名称。
[edit services] user@gateway2# set event-options redundancy-event event-name
例如:
[edit services] user@gateway2# set event-options redundancy-event WARN_EV
- 指定在接口关闭时触发警告的所有接口。
[edit services event-options redundancy-event event-name] user@gateway2# set monitor link-down [interface-name]
- 指定进程路由守护程序重新启动请求触发警告。
[edit services event-options redundancy-event event-name] user@gateway2# set monitor process routing restart
- 指定进程路由守护程序终止请求触发警告。
[edit services event-options redundancy-event event-name] user@gateway2# set monitor process routing abort
- 为冗余事件配置名称。
- 在 gateway2 上,配置广播警告的冗余策略。
- 为策略配置名称。
user@gateway2# edit policy-options redundancy-policy policy-name
例如:
user@gateway2# edit policy-options redundancy-policy WARN_POL
- 指定可触发警告的已配置冗余事件。
[edit policy-options redundancy-policy policy-name] user@gateway2# set redundancy-events [event-list]
例如:
[edit policy-options redundancy-policy WARN_POL] user@gateway2# set redundancy-events WARN_EV
- 广播警告。
[edit policy-options redundancy-policy policy-name] user@gateway2# set then broadcast-warning
- 为策略配置名称。
- 在 gateway2 上,配置冗余集。
- 为冗余集配置名称。
[edit services] user@gateway2# set redundancy-set redundancy-set
例如:
[edit services] user@gateway2# set redundancy-set 1
- 指定冗余集的冗余组 ID。
[edit services redundancy-set redundancy-set] user@gateway2# set redundancy-group redundancy-group
例如:
[edit services redundancy-set 1] user@gateway2# set redundancy-group 1
冗余组 ID 是通过现有 ICCP 配置层次结构为 ICCP 守护程序 (iccpd) 配置的相同冗余组 ID。例如
iccp { local-ip-addr 10.1.1.1; peer 10.2.2.2 { redundancy-group-id-list 1; liveness-detection { minimum-interval 1000; } } } - 指定释放主要角色的冗余策略、获取主要角色的冗余策略以及触发警告的冗余策略。
[edit services redundancy-set redundancy-set] user@gateway2# set redundancy-policy [redundancy-policy-list]
例如:
[edit services redundancy-set 1] user@gateway2# set redundancy-policy [ ACQU_MSHIP_POL RLS_MSHIP_POL WARN_POL]
- 配置冗余集的运行状况检查探测频率(以秒为单位)。
[edit services redundancy-set redundancy-set] user@gateway2# set healthcheck-timer-interval healthcheck-timer-interval
默认设置为 30 秒。
- 配置帮助检查响应的最长等待时间(以秒为单位)。
[edit services redundancy-set redundancy-set] user@gateway2# set hold-time hold-time
范围为 0 到 3600 秒。
- 配置 srd hello 消息的频率(以秒为单位)。
[edit services redundancy-set redundancy-set] user@gateway2# set keepalive keepalive
范围为 1 到 60 秒。
- 为冗余集配置名称。
- 在网关 2 上,配置路由策略。
- 确定需要与冗余相关的路由更改的信号路由。指定使用的信号路由和路由表。
[edit policy-options condition condition-name} user@gateway2# set if-route-exists signal-route table routing-table
例如:
[edit policy-options condition switchover-route-exists] user@gateway2# set if-route-exists 10.45.45.0/24 table bgp1_table
- 要更改信号路由的本地优先级,请在策略语句中输入该优先级。
[edit policy-options policy-statement policy-name] user@gateway2# set term term from protocol [protocol variables] prefix-list prefix-list condition condition-name then local-preference preference-value accept
- 要更改信号路由的 as 路径前置值,请在策略语句中输入这些值。
[edit policy-options policy-statement policy-name] user@gateway2# set term term from prefix-list prefix-list condition condition-name then as-path-prepend [as-prepend-values] next-hop self accept
- 确定需要与冗余相关的路由更改的信号路由。指定使用的信号路由和路由表。
- 在网关 2 上,通过将冗余集分配给服务集来配置服务集的冗余。
[edit] user@gateway2# set services service-set service-set-name redundancy-set-id redundancy-set