labunix's blog

labunixのラボUnix

vSRX-HAのフェイルオーバ、フェイルバック動作を確認する。

■vSRX-HAのフェイルオーバ、フェイルバック動作を確認する。
 仮想マシンなので、GUIから該当のNICを「disconnect」します。

labunix@vSRX-node0> show version           
node0:
--------------------------------------------------------------------------
Hostname: vSRX-node0
Model: firefly-perimeter
JUNOS Software Release [12.1X47-D20.7]

node1:
--------------------------------------------------------------------------
Hostname: vSRX-node1
Model: firefly-perimeter
JUNOS Software Release [12.1X47-D20.7]

{primary:node0}

■rethをRG1に所属するよう設定変更
 ここでA/A構成の検証が急に面倒になったので、Active/Passive形式に変更する。
 「preempt」と「interface-monitor」を追加。

labunix@vSRX-node0> show configuration | display set | match redundan | no-more
set chassis cluster redundancy-group 0 node 0 priority 200
set chassis cluster redundancy-group 0 node 1 priority 100
set chassis cluster redundancy-group 1 node 0 priority 200
set chassis cluster redundancy-group 1 node 1 priority 100
set chassis cluster redundancy-group 1 preempt
set chassis cluster redundancy-group 1 interface-monitor ge-7/0/3 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/3 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/4 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-7/0/4 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-7/0/5 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/5 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/6 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-7/0/6 weight 255
set interfaces ge-0/0/3 gigether-options redundant-parent reth0
set interfaces ge-0/0/4 gigether-options redundant-parent reth2
set interfaces ge-0/0/5 gigether-options redundant-parent reth0
set interfaces ge-0/0/6 gigether-options redundant-parent reth0
set interfaces ge-7/0/3 gigether-options redundant-parent reth0
set interfaces ge-7/0/4 gigether-options redundant-parent reth2
set interfaces ge-7/0/5 gigether-options redundant-parent reth0
set interfaces ge-7/0/6 gigether-options redundant-parent reth0
set interfaces reth0 redundant-ether-options redundancy-group 1
set interfaces reth1 redundant-ether-options redundancy-group 1
set interfaces reth2 redundant-ether-options redundancy-group 1
set interfaces reth3 redundant-ether-options redundancy-group 1
set interfaces reth4 redundant-ether-options redundancy-group 1

{primary:node0}

■fxp0がダウンすると、マネージメントポートからログイン出来なくなるが、
 fxp1を介した「request routing-engine login node 1」によるログインは可能。
 また、fxp0がダウンしたままでも、「Monitor-failures」が
 [None] --> [IF] --> [IF CS] --> [None]と遷移するが、
 クラスタ構成には影響は無い様子。
 fxp0が再リンクアップすると、アラームがクリアされて、
 マネージメントポートからログイン出来るようになる。

labunix@vSRX-node1> show interfaces fxp0 terse 
Interface               Admin Link Proto    Local                 Remote
fxp0                    up    up  
fxp0.0                  up    up   inet     172.16.76.204/24

{secondary:node1}

# fxp0 Link Down
labunix@vSRX-node1> show interfaces fxp0 terse 
Interface               Admin Link Proto    Local                 Remote
fxp0                    up    down
fxp0.0                  up    down inet     172.16.76.204/24

{disabled:node1}

labunix@vSRX-node0> request routing-engine login node 1    

--- JUNOS 12.1X47-D20.7 built 2015-03-03 21:53:50 UTC
{disabled:node1}

labunix@vSRX-node1> show log chassisd | last 1 | no-more    
Dec 27 03:49:25 LCC: send: red alarm set, device Routing Engine 0, reason Host 0 fxp0 : Ethernet Link Down
                                        
{secondary:node1}

labunix@vSRX-node1> show chassis cluster status | last 7 | no-more 
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 0
node0  200      primary        no      no       None           
node1  100      disabled       no      no       None           

Redundancy group: 1 , Failover count: 0
node0  200      primary        yes     no       None           
node1  0        disabled       yes     no       IF             
                                        
{disabled:node1}

# fxp1 Link Up
labunix@vSRX-node1> show log chassisd | last 2 | no-more    
Dec 27 03:49:25 LCC: send: red alarm set, device Routing Engine 0, reason Host 0 fxp0 : Ethernet Link Down
Dec 27 03:50:20 LCC: send: red alarm clear, device Routing Engine 0, reason Host 0 fxp0 : Ethernet Link Down
                                        
{secondary:node1}

labunix@vSRX-node0> show chassis cluster status | last 7 | no-more 
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 1
node0  200      primary        no      no       None           
node1  100      secondary      no      no       None           

Redundancy group: 1 , Failover count: 1
node0  200      primary        yes     no       None           
node1  0        secondary      yes     no       IF CS          
                                        
{primary:node0}

labunix@vSRX-node0> show chassis cluster status | last 7 | no-more    
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 1
node0  200      primary        no      no       None           
node1  100      secondary      no      no       None           

Redundancy group: 1 , Failover count: 1
node0  200      primary        yes     no       None           
node1  100      secondary      yes     no       None           
                                        
{primary:node0}

■コントロールリンクであるfxp1がダウンすると、statusは「lost」となる。
 マネージメントポートが正常ならsshでログイン出来る。

# fxp1 Link Down
labunix@vSRX-node1> show log chassisd | last 3 | no-more    
Dec 27 04:01:45 LCC: SIGWINCH handler
Dec 27 04:01:46 LCC: ch_pepsi_lcc_disable_state_handler: Cluster is not disabled: 0 or lcc: 0x8a7a100
Dec 27 04:02:48 LCC: ch_tnp_connect: Could not connect to SCC .. retrying (errno 65), tnp addr 0xf100001, port 1010

{ineligible:node1}

labunix@vSRX-node0> show chassis cluster status | last 7 | no-more 

Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 1
node0  200      primary        no      no       None           
node1  0        lost           n/a     n/a      n/a            

Redundancy group: 1 , Failover count: 1
node0  200      primary        yes     no       None           
node1  0        lost           n/a     n/a      n/a            
                                        
{primary:node0}

labunix@vSRX-node0> request routing-engine login node 1 
node1: No route to host
node1: No route to host

{primary:node0}

labunix@vSRX-node1> show interfaces terse fxp1 
Interface               Admin Link Proto    Local                 Remote
fxp1                    up    down
fxp1.0                  up    down inet     130.16.0.1/2    
                                   tnp      0x2100001       

{ineligible:node1}

labunix@vSRX-node1> show chassis cluster status | last 7 | no-more 
                                        
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 0
node0  0        lost           n/a     n/a      n/a            
node1  100      ineligible     no      no       None           

Redundancy group: 1 , Failover count: 0
node0  0        lost           n/a     n/a      n/a            
node1  100      ineligible     yes     no       None           
                                        
{ineligible:node1}

■コントロールリンクfxp1が再度リンクアップしても、以下のメッセージが出て、
 statusはdisableのまま。
 「request routing-engine login node 1」でのログインは出来る様になる。

labunix@vSRX-node1> 
Message from syslogd@vSRX-node1 at Dec 27 04:10:31  ...
vSRX-node1 vSRX-node1 PFEMAN: Shutting down , PFEMAN Resync aborted! No peer info on reconnect or master rebooted?  

labunix@vSRX-node1> show log chassisd | match "Dec 27 04:10:31"  
Dec 27 04:10:31 LCC: DEBUG: ch_lcc_scc_ipc_connect
Dec 27 04:10:31 LCC: At LCC 1 ch_lcc_scc_ipc_connect(): connect succeeded after 35 retries
Dec 27 04:10:31 LCC: ch_signal_proc: Sent signal 1 to ksyncd, pid=1121

{disabled:node1}

labunix@vSRX-node1> show chassis cluster status | last 7 | no-more 
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 0
node0  200      primary        no      no       None           
node1  100      disabled       no      no       None           

Redundancy group: 1 , Failover count: 0
node0  200      primary        yes     no       None           
node1  100      disabled       yes     no       None           
                                        
{disabled:node1}

labunix@vSRX-node0> show chassis cluster status | last 7 | no-more    
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 1
node0  200      primary        no      no       None           
node1  100      disabled       no      no       None           

Redundancy group: 1 , Failover count: 1
node0  200      primary        yes     no       None           
node1  100      disabled       yes     no       None           
                                        
{primary:node0}

■node1のfxp1リンクが再リンクアップ時に自動復旧する場合は以下とする。
 仕組みは簡単で、再リンクアップ時に「Sent signal 1 to ksyncd」として、
 自動的に再起動が走る。

bunix@vSRX-node0> show configuration | display set | match recovery
set chassis cluster control-link-recovery

# fxp1 Link Down
labunix@vSRX-node1> show log chassisd | last 2 | no-more
Dec 27 04:16:19 LCC: SIGWINCH handler
Dec 27 04:16:20 LCC: ch_pepsi_lcc_disable_state_handler: Cluster is not disabled: 0 or lcc: 0x8a7a100

labunix@vSRX-node0> show chassis cluster status | last 7 | no-more 
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 1
node0  200      primary        no      no       None           
node1  0        lost           n/a     n/a      n/a            

Redundancy group: 1 , Failover count: 3
node0  200      primary        yes     no       None           
node1  0        lost           n/a     n/a      n/a            
                                        
{primary:node0}

labunix@vSRX-node1> show chassis cluster status | last 7 | no-more 
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 0
node0  0        lost           n/a     n/a      n/a            
node1  100      ineligible     no      no       None           

Redundancy group: 1 , Failover count: 0
node0  0        lost           n/a     n/a      n/a            
node1  100      ineligible     yes     no       None           
                                        
{ineligible:node1}

# fxp1 Link Up

labunix@vSRX-node1> 
Message from syslogd@vSRX-node1 at Dec 27 04:18:39  ...
vSRX-node1 vSRX-node1 PFEMAN: Shutting down , PFEMAN Resync aborted! No peer info on reconnect or master rebooted?  
                                                                               
*** FINAL System shutdown message from root@vSRX-node1 ***                   

System going down IMMEDIATELY

labunix@vSRX-node1> show log chassisd | match "04:18:40"    
Dec 27 04:18:40 LCC: DEBUG: ch_lcc_scc_ipc_connect
Dec 27 04:18:40 LCC: At LCC 1 ch_lcc_scc_ipc_connect(): connect succeeded after 119 retries
Dec 27 04:18:40 LCC: ch_signal_proc: Sent signal 1 to ksyncd, pid=1121

{hold:node1}


■データリンクfab1のリンクダウン
 RTO(Run Time Object)メッセージは、セッション情報などが含まれる。
 RTOはファブリックリンク(セッション、ルートなど)を介して同期する。
 ファブリックリンクが1本ならRTOと実データの両方を流し、
 2本なら、RTO、実データは別々となる。
 ファブリックリンクは、特に設定を加えることなく常にモニターされていて、
 再リンクアップすると、自動的に復旧する。

labunix@vSRX-node0> show chassis cluster interfaces | match fab    

Fabric link status: Up
Fabric interfaces: 
    fab0    ge-0/0/2           Up   / Up  
    fab0   
    fab1    ge-7/0/2           Up   / Up  
    fab1   

{primary:node0}


labunix@vSRX-node0> show chassis cluster interfaces | match fab    

Fabric link status: Up
Fabric interfaces: 
    fab0    ge-0/0/2           Up   / Up  
    fab0   
    fab1    ge-7/0/2           Down / Up  
    fab1   

{primary:node0}

labunix@vSRX-node0> show chassis cluster interfaces | match fab    

Fabric link status: Down
Fabric interfaces: 
    fab0    ge-0/0/2           Up   / Down
    fab0   
    fab1    ge-7/0/2           Down / Down
    fab1   

{primary:node0}

labunix@vSRX-node0> show chassis cluster status | last 7 | no-more 
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 1
node0  200      primary        no      no       None           
node1  0        secondary      no      no       FL             

Redundancy group: 1 , Failover count: 1
node0  200      primary        yes     no       None           
node1  0        ineligible     yes     no       FL             
                                        
{primary:node0}

labunix@vSRX-node0> show chassis cluster interfaces | match fab    

Fabric link status: Up
Fabric interfaces: 
    fab0    ge-0/0/2           Up   / Up  
    fab0   
    fab1    ge-7/0/2           Up   / Up  
    fab1   

{primary:node0}

labunix@vSRX-node0> show chassis cluster status | last 7 | no-more    
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 1
node0  200      primary        no      no       None           
node1  100      secondary      no      no       None           

Redundancy group: 1 , Failover count: 1
node0  200      primary        yes     no       None           
node1  100      secondary      yes     no       None           
                                        
{primary:node0}

labunix@vSRX-node1> show interfaces fab[01] | match "Last flapped" 
  Last flapped   : 2015-12-26 23:04:32 JST (05:21:28 ago)
  Last flapped   : 2015-12-27 04:24:09 JST (00:01:51 ago)

{secondary:node1}

■reth0に所属するge-7/0/3のリンクダウン
 セカンダリなので、ge-7/0/3は普通にダウンして普通に復旧する。

labunix@vSRX-node1> show interfaces ge-7/0/[0-9]* terse | match down 
ge-7/0/3                up    down
ge-7/0/3.0              up    down aenet   

{secondary:node1}

labunix@vSRX-node1> show chassis cluster status | last 7 | no-more      
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 0
node0  200      primary        no      no       None           
node1  100      secondary      no      no       None           

Redundancy group: 1 , Failover count: 0
node0  200      primary        yes     no       None           
node1  0        secondary      yes     no       IF             
                                        
{secondary:node1}

labunix@vSRX-node1> show interfaces reth0 terse | match down            

{secondary:node1}
labunix@vSRX-node1> show interfaces reth0 terse                 
Interface               Admin Link Proto    Local                 Remote
reth0                   up    up  
reth0.0                 up    up   inet     192.168.152.205/24

{secondary:node1}

labunix@vSRX-node1> show interfaces ge-[07]/0/3 | match "Last flapped" 
  Last flapped   : 2015-12-27 03:40:58 JST (00:48:58 ago)
  Last flapped   : 2015-12-27 04:28:33 JST (00:01:23 ago)

{secondary:node1}

■node0のge-0/0/3がダウンするとセカンダリにフェイルオーバして
 node1がprimaryとなる。
 再リンクアップ時には、「preempt」と「interface-monitor」により
 自動的にフェイルバックしてnode0がprimaryとなる。
 この動作は「redundancy-group」単位で行われるので、
 「redundancy-group」が複数あると、結果的にA/A動作となるが、
 A/P動作でもA/A動作でも基本的に片系が稼働系ということになる。

# ge-0/0/3 Link Down
labunix@vSRX-node1> show interfaces ge-[07]/0/3 | match "Last flapped" 
  Last flapped   : 2015-12-27 04:30:28 JST (00:00:08 ago)
  Last flapped   : 2015-12-27 04:28:33 JST (00:02:03 ago)

{secondary:node1}

labunix@vSRX-node0> show interfaces ge-0/0/[0-9]* terse | match down               
ge-0/0/3                up    down
ge-0/0/3.0              up    down aenet

{primary:node0}

labunix@vSRX-node1> show chassis cluster status | last 7 | no-more    
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 0
node0  200      primary        no      no       None           
node1  100      secondary      no      no       None           

Redundancy group: 1 , Failover count: 1
node0  0        secondary      yes     no       IF             
node1  100      primary        yes     no       None           
                                        
{secondary:node1}

# ge-0/0/3 Link Up
labunix@vSRX-node1> show interfaces ge-[07]/0/3 | match "Last flapped" 
  Last flapped   : 2015-12-27 04:32:04 JST (00:00:26 ago)
  Last flapped   : 2015-12-27 04:28:33 JST (00:03:57 ago)

{secondary:node1}

labunix@vSRX-node1> show interfaces ge-0/0/[0-9]* terse | match down    

{secondary:node1}

labunix@vSRX-node1> show chassis cluster status | last 7 | no-more    
 
Cluster ID: 1
Node   Priority Status         Preempt Manual   Monitor-failures

Redundancy group: 0 , Failover count: 0
node0  200      primary        no      no       None           
node1  100      secondary      no      no       None           

Redundancy group: 1 , Failover count: 2
node0  200      primary        yes     no       None           
node1  100      secondary      yes     no       None           
                                        
{secondary:node1}