Config-Syncについて | サイバーエージェント 公式エンジニアブログ

こんにちは。
"ケーブル作成からEdgeルータ設定まで"カッシーです。
私はNW担当なので今回はCiscoのDC向けスイッチNexusで使用可能になったConfig-Syncを

紹介します。


■config-syncとは
機器冗長をとっている場合にactive側に投入した設定をstandby側に同期させることをいいます。


これまではNexusを導入したときの初期コンフィグをactiveとstandbyの両機器に投入していたので

手間がかかってました。(弊社のNexusコンフィグは5500lineくらい)
そこでこの手間を省く為に次回導入時から使用してみようかと思い検証したので紹介します。


■構成図


サイバーエージェント 公式エンジニアブログ


■事前設定(sctive/standby両機器に設定が必要)
・cfs(cisco fabric Service)配信を有効にします。

Ameba1(config)# cfs ipv4 distribute


・config-syncモードに入ります。
Ameba1# config sync
Ameba1(config-sync)#


・スイッチプロファイルを作成します。
Ameba1(config-sync)# switch-profile ameba

Ameba1(config-sync-sp)#


・同期対象のスイッチIPを設定します。
Ameba1(config-sync-sp)# sync-peers destination xxx.xxx.xxx.xxx


・設定を確認します。
Ameba1# sh switch-profile status

switch-profile : ameba
----------------------------------------------------------

Start-time: 891706 usecs after Fri Jul 1 16:57:43 2011
End-time: 955788 usecs after Fri Jul 1 16:57:48 2011

Profile-Revision: 1
Session-type: Initial-Exchange
Session-subtype: Init-Exchange-All
Peer-triggered: No
Profile-status: Sync Success

Local information:
----------------
Status: Commit Success
Error(s):

Peer information:
----------------
IP-address: xxx.xxx.xxx.xxx
Sync-status: In sync
Status: Commit Success
Error(s):


Sync-statusがIn syncになっていればOKです。(stanby側も確認)


■コンフィグ同期

では同期させてみます。
今回はinterfaceのdescriptionを同期させてみます。


・active側にコンフィグ投入します。
Ameba1# config sync

Ameba1(config-sync)# switch-profile ameba
Ameba1(config-sync-sp)# int ethernet 1/21
Ameba1(config-sync-sp-if)# description ##sync-test##


・投入したコンフィグが有効か確認します。
Ameba1(config-sync-sp)# verify
Verification Successful


・投入したコンフィグを確認します。
Ameba1(config-sync)# sh switch-profile ameba buffer

switch-profile : ameba
----------------------------------------------------------
Seq-no Command
----------------------------------------------------------
1 interface Ethernet1/21
1.1 description ##sync-test##



・commitして設定を同期させます
Ameba1(config-sync-sp)# commit
Verification successful...
Proceeding to apply configuration. This might take a while depending on amount of configuration in buffer.
Please avoid other configuration changes during this time.
Commit Successful


・同期されたか確認します
●active側
Ameba1# sh run int ethernet 1/21

!Command: show running-config interface Ethernet1/21
!Time: Fri Jul 1 17:25:47 2011

version 5.0(3)N1(1c)

interface Ethernet1/21
description ##sync-test##


●standby側
Ameba2# sh run int ethernet 1/21

!Command: show running-config interface Ethernet1/21
!Time: Fri Jul 1 17:26:25 2011

version 5.0(3)N1(1c)

interface Ethernet1/21
description ##sync-test##


active/standby両機器にdescriptionが設定されています。


■まとめ
今回の検証で簡単に同期させられる事がわかったので今後導入してみようかと考えています。
(同期するときにCPUの使用率が若干上がります)


あと同期した設定については片側だけでコンフィグを消去しようとしても消去出来ません。

Ameba2# conf t
Ameba2(config)# int ethernet 1/21
Ameba2(config-if)# no description
Error: Command is not mutually exclusive

つまり、
・初期コンフィグについては同期モードで設定
・運用時のコンフィグ追加については通常通りの設定
という運用にしておけば初期コンフィグを誤って消去する事はないということです。