为新一代服务配置机箱间服务冗余
本主题介绍如何为下一代服务配置机箱间服务冗余。本主题包含配置不间断服务冗余(双向自动切换)的过程和单向冗余(仅从原始主服务器到原始备用服务器的自动切换)的过程。
您还可以使用手册请求命令来释放或获取主角色:
request services redundancy-set redundancy-set trigger redundancy-event event-name <force>
该命令会自动触发指定的冗余事件。您必须创建一个配置,将冗余事件分配给释放或获取主角色的冗余策略。您还必须将冗余策略分配给命令中使用的冗余集。
为新一代服务服务集配置不间断服务冗余
发生关键事件时,不间断服务冗余使您可以在路由器之间自动切换服务。从网关 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-path-prepend 值,请在策略语句中输入这些值。
[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 的自动切换。要从 gateway2 切换到 gateway1,您必须执行手册切换。
- 在初始主网关 1 上,配置一个或多个冗余事件,以监控触发服务切换到 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
- 为冗余事件配置名称。
- 在网关 1 上,配置一个冗余策略,当满足冗余事件条件时,该策略将释放主角色并删除冗余路由。
- 为策略配置名称。
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
- 为策略配置名称。
- 在网关 1 上,配置冗余集。
- 为冗余集配置名称。
[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-path-prepend 值,请在策略语句中输入这些值。
[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
- 为策略配置名称。
- 在网关 2 上,配置冗余事件以标识对等网关何时请求主角色。
[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
- 在 gateway2 上,配置一个冗余策略,当 gateway1 请求主角色时,该策略将释放主角色并删除静态路由。
- 为策略配置名称。
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
- 为策略配置名称。
- 在网关 2 上,配置一个或多个冗余事件来监控触发警告的情况。
- 为冗余事件配置名称。
[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
- 为冗余事件配置名称。
- 在网关 2 上,配置广播警告的冗余策略。
- 为策略配置名称。
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
- 为策略配置名称。
- 在网关 2 上,配置冗余集。
- 为冗余集配置名称。
[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-path-prepend 值,请在策略语句中输入这些值。
[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