聽說 Juniper 的 switch 不正常斷電會掛掉
最近看到有 auto-snapshot 可以解決這問題
後面設定請看一下命令提示字元是 “>” 還是 “#” 去選擇你的模式
操作模式
ssh 過去打 cli 進入 command line interface 模式 (提示字元是”>”)
root@ex2200-04:RE:0% cli
{master:0}
root@ex2200-04>
打 configure 進入設定模式 (提示字元是”#”)
root@ex2200-04> configure
Entering configuration mode
{master:0}[edit]
root@ex2200-04#
檢查 primary / backup OS 版本是否相同
要用 auto-snapshot 之前要確定兩個磁區的版本是相同的
用 show system snapshot media internal 查詢 primary 和 backup 版本是否相同
root@ex2200-04> show system snapshot media internal
fpc0:
-------------------------------------------------------------
Information for snapshot on internal (/dev/da0s1a) (primary)
Creation date: Jan 1 00:09:57 2010
JUNOS version on snapshot:
jdocs-ex: 15.1R5.5
junos : ex-15.1R5.5
junos-ex-2200: 15.1R5.5
jweb-ex: 15.1R5.5
jweb-ex-app: 15.1A3
Information for snapshot on internal (/dev/da0s2a) (backup)
Creation date: Feb 12 13:49:03 2015
JUNOS version on snapshot:
jbase : ex-12.3R9.4
WARNING: snapshot format is incompatible with the software currently running 。
{master:0}
root@ex2200-04>
這樣看來兩邊的版本不同 需要同步一下
使用 request system snapshot slice alternate 做同步
root@ex2200-04> request system snapshot slice alternate
System may go unstable if module traces or syslog mesages are enabled during snapshot.
It is recommended to disable all debug logging.
Do you wish to continue? [yes,no] (no) yes
fpc0:
--------------------------------------------------------------------------
Formatting alternate root (/dev/da0s2a)...
Copying '/dev/da0s1a' to '/dev/da0s2a' .. (this may take a few minutes)
The following filesystems were archived: /
{master:0}
root@ex2200-04>
再檢查一次
root@ex2200-04> show system snapshot media internal
fpc0:
--------------------------------------------------------------------------
Information for snapshot on internal (/dev/da0s1a) (primary)
Creation date: Dec 13 21:01:45 2016
JUNOS version on snapshot:
jdocs-ex: 15.1R5.5
junos : ex-15.1R5.5
junos-ex-3300: 15.1R5.5
jweb-ex: 15.1R5.5
jweb-ex-app: 15.1A3
Information for snapshot on internal (/dev/da0s2a) (backup)
Creation date: Jan 6 20:28:09 2017
JUNOS version on snapshot:
jdocs-ex: 15.1R5.5
junos : ex-15.1R5.5
junos-ex-3300: 15.1R5.5
jweb-ex: 15.1R5.5
jweb-ex-app: 15.1A3
{master:0}
root@ex2200-04>
弄了幾台有遇到 error: timeout waiting for response from fpc0 的, 不過後來重開就正常了
用 show system auto-snapshot 檢查 auto-snapshot 狀態
root@ex2200-04> show system auto-snapshot
Auto-snapshot Configuration: Disabled
Auto-snapshot State: Disabled
{master:0}
root@ex2200-04>
Auto-snapshot Configuration 表示有沒有啟用
Auto-snapshot State 表示目前是否正在做 snapshot
進 configure 模式 用 set system auto-snapshot 開啟 auto-snapshot
root@ex2200-04> configure
root@ex2200-04# set system auto-snapshot
{master:0}[edit]
root@ex2200-04#
記得設定完成後需要 commit 出去 才有用
root@ex2200-04# commit
configuration check succeeds
commit complete
{master:0}[edit]
root@ex2200-04#
exit 退出設定模式 檢查是否啟用 auto-snapshot
root@ex2200-04# exit
root@ex2200-04> show system auto-snapshot
Auto-snapshot Configuration: Enabled
Auto-snapshot State: Disabled
{master:0}
root@ex2200-04>
搞定收工
ref:
Abilitare l’auto-snapshot su Juniper EX2200 con Junos 12.3
Juniper TechLib: auto-snapshot
Juniper TechLib: show system auto-snapshot
Juniper Ex Series first configure set
Warning message seen in ‘show system snapshot’ after upgrading Junos from 12.3 to 13.2x and later