H3C 交换机升级说明

发布时间:2019-09-20 07:31:55编辑:auto阅读(1618)

    H3C 命令行升级说明

    下文关于通过命令行升级的内容均以两台设备形成IRF(Intelligent Resilient Framework,智能弹性架构)的情况为例进行介绍。

    • 如果用户升级的是单台设备,忽略有关Standby设备的配置即可;
    • 如果用户升级的IRF中包含两台以上成员设备,重复有关Standby设备的配置即可,实际配置过程中,请根据实际情况修改命令行参数中的成员编号。

    1.1 升级前准备

    • 用户PC通过Telnet或者Console口登录到IRF上,具体步骤略
    • 在任意视图下,执行display irf命令查看IRF信息,掌握本IRF的成员设备数量,各成员设备的角色以及成员编号等信息,对于这些信息的了解将便于执行后续的升级操作。

    <Sysname> display irf
    MemberID   Role   Priority  CPU-Mac         Description
     *+1      Master  5         0023-8927-afdc  ---
       2      Standby 1         0023-8927-af43  ---
    --------------------------------------------------
     * indicates the device is the master.
     + indicates the device through which the user logs in.
     The Bridge MAC of the IRF is: 0023-8927-afdb
     Auto upgrade                : no
     Mac persistent              : 6 min
     Domain ID                   : 0 

    通过以上信息得出IRF中有两台成员设备,Master设备的成员编号为1,Standby设备的成员编号为2。

    • 在用户视图下,执行dir命令逐一查看各成员设备存储介质的剩余空间大小。
    • 查看Master设备的存储介质(Flash)的剩余空间大小

    <Sysname> dir
    Directory of flash:                                                            
    0 -rw-       80264 Aug 23 2013 00:33:57   startup.mdb
    1 -rw-        3523 Aug 23 2013 00:33:56   startup.cfg
    2 -rw-    9959424 Aug 23 2013 16:04:08   boot.bin                                                                              
    3 -rw-    53555200 Aug 23 2013 16:04:08   system.bin                                                                           
    4 drw-           - Aug 23 2013 00:03:07   seclog                            
    5 drw-           - Aug 23 2013 00:03:07   versionInfo                     
    6 -rw-    91273216 Aug 21 2013 09:54:27   backup.bin
    1048576 KB total (897252 KB free) 

    • 查看Standby设备(成员编号为2)的存储介质(Flash)的剩余空间大小。

    <Sysname> dir slot2#flash:/
    Directory of slot2#flash:/
    0 -rw-       80264 Aug 23 2013 00:33:57   startup.mdb
    1 -rw-        3523 Aug 23 2013 00:33:56   startup.cfg
    2 -rw-    13611008 Aug 23 2013 16:04:08   boot.bin                                                                              
    3 -rw-    93871104 Aug 23 2013 16:04:08   system.bin                                                                            
    4 drw-           - Aug 23 2013 00:03:07   seclog                            
    5 drw-           - Aug 23 2013 00:03:07   versionInfo                     
    6 -rw-    91273216 Aug 21 2013 09:54:27   backup.bin n
    1048576 KB total (854397 KB free)

    1.1.2 删除无用文件


    用户可以将各成员设备的存储介质剩余空间大小与待升级启动软件包大小进行对比,如果剩余空间不足,可在用户视图下使用delete命令删除该设备存储介质中的无用软件包,释放存储空间(建议用户删除不再使用的非本次启动使用的软件包)。本次启动使用的软件包可以在任意视图下使用display boot-loader命令查看。

    说明:为了避免配置丢失,请不要删除设备的当前配置文件,设备的当前配置文件可以在任意视图下使用display startup命令查看。
    使用delete /unreserved file-url命令删除软件包,被删除的软件包将被彻底删除,不能再恢复。
    使用delete file-url命令删除软件包,被删除的软件包被保存在回收站中,仍会占用存储空间。如果要彻底删除回收站中的某个废弃软件包,请执行undelete命令恢复回收站里的软件包,再使用delete /unreserved file-url命令彻底删除软件包。

    • 在用户视图下,执行delete命令删除成员设备存储介质中的无用软件包。
    • 删除Master存储介质中的无用软件包。

    <Sysname> delete /unreserved flash:/backup.bin
    The file cannot be restored. Delete flash:/backup.bin?[Y/N]:y
    Deleting the file permanently will take a long time. Please wait...
    Deleting file flash:/backup.bin...Done.

    • 删除Standby存储介质中的无用软件包

    <Sysname> delete /unreserved slot2#flash:/backup.bin
    The file cannot be restored. Delete slot2#flash:/backup.bin?[Y/N]:y
    Deleting the file permanently will take a long time. Please wait...
    Deleting file slot2#flash:/backup.bin...Done.

    ###1.2 下载待升级启动软件包/补丁包到Master设备

    说明:
    在执行升级操作之前,首先要将待升级启动软件包/补丁包下载并保存到Master设备存储介质(Flash)的根目录下。如果待升级启动软件包/补丁包已经保存到Master设备存储介质(Flash)的根目录下,可略过此步。
    通过命令行进行启动软件包/补丁包升级时,启动软件包和补丁包的下载方法相同。用户可以根据所要升级的软件类型,下载正确的待升级启动软件包/补丁包。此处以下载启动软件包(IPE文件)为例进行介绍。

    将待升级启动软件包下载到Master设备存储介质的根目录下的方法有如下几种,用户可以根据具体情况选择一种方法完成下载操作:

    • 以交换机作为FTP客户端方式完成下载
    • 以交换机作为FTP服务器方式完成下载
    • 以交换机作为TFTP客户端方式完成下载
    • 通过USB口完成下载

    1.2.1 以交换机作为FTP客户端方式完成下载

    1. 在用户PC(假设IP地址为10.10.110.1)上运行FTP服务器程序,设置用户名和密码,以及工作路径,并把待升级启动软件包保存在FTP服务器的工作路径下。
    2. 确保用户PC和IRF之间路由可达。
    3. 将待升级启动软件包(以newest.ipe为例)下载到Master存储介质的根目录下。

    在用户视图下,执行ftp命令并根据系统提示输入登录用户名和密码,设备将作为FTP 客户端登录到FTP 服务器。

    <Sysname> ftp 10.10.110.1
    Trying 10.10.110.1...
    Press CTRL+K to abort
    Connected to 10.10.110.1
    220 FTP service ready.
    User(10.10.110.1:(none)):username                       ---输入用户名
    331 Password required for username.
    Password:                                               ---输入用户密码
    230 User logged in

    在FTP客户端视图下,执行get命令将待升级启动软件包从FTP服务器下载到Master存储介质(Flash)的根目录下。

    ftp> get newest.ipe
      227 Entering Passive Mode (10,10,110,1,17,97).
      125 BINARY mode data connection already open, transfer starting for /newest.ipe
      226 Transfer complete.
      32133120 bytes received in 35 seconds (896. 0 kbyte/s)
    ftp> bye
    221 Server closing. 

    1.2.2 通过USB口完成下载

    S6800系列以太网交换机带有USB口,用户可以在用户视图下,执行copy命令把移动存储设备(此处以U盘为例)上的待升级启动软件包拷贝到Master的根目录下。
    将保存有待升级启动软件包(以newest.ipe为例)的U盘插入交换机的USB口。
    将待升级启动软件包从U盘拷贝到交换机的Flash中。

    <Sysname> cd usba:
    <Sysname> dir
    <Sysname> cd flash:/dis
    <Sysname> copy usba:/newest.ipe newest.ipe
    Copy usba:/newest.ipe to flash:/newest.ipe?[Y/N]:y
    Start to copy usba:/newest.ipe to flash:/newest.ipe... Done

    1.3 升级启动软件包/补丁包

    用户可以根据所要升级的软件类型,下载正确的待升级启动软件包,然后选择执行对应的升级操作。

    • 升级启动软件包
    • 安装补丁包

      1.3.1. 升级启动软件包

      指定Master的主用下次启动软件包为newest.ipe

      <Sysname> boot-loader file flash:/newest.ipe slot 1 main
      Verifying image file....Done.
      Images in IPE:
      boot.bin
      system.bin
      This command will set the main startup software images. Continue? [Y/N]:y
      Add images to target slot.
      The images that have passed all examinations will be used as the main startup software images at the next reboot on slot 1.

    逐一指定各Standby均采用与Master相同的主用下次启动软件包(指定完成后,系统会自动将该启动软件包从Master上copy到Standby的存储介质根目录下)

    <Sysname> boot-loader file flash:/newest.ipe slot 2 main
    Verifying image file....Done.
    Images in IPE:
      boot.bin
      system.bin
    This command will set the main startup software images. Continue? [Y/N]:y
    Add images to target slot.
    The images that have passed all examinations will be used as the main startup software images at the next reboot on slot 1.

    在系统视图下,执行irf auto-update enable命令使能IRF系统启动软件包的自动加载功能。

    <Sysname> system-view
    [Sysname] irf auto-update enable
    [Sysname] quit

    说明:
    开启IRF系统启动软件包的自动加载功能,后面执行reboot命令重启IRF时,若某个Standby检测到主用下次启动软件包与Master上的主用下次启动软件包不一致时:
    该Standby自动将Master的当前主用启动软件包copy到自己的存储介质根目录下,并将该软件包设置为自己的下次主用启动软件包;同时使用该启动软件包重启。
    IRF系统启动软件包的自动加载功能主要用于新加入IRF的成员设备的软件版本与Master的软件版本不一致时,新的成员设备自动从Master设备下载启动软件包,并使用新的启动软件包重启,重新加入IRF。

    在任意视图下,执行save命令保存当前配置,防止设备重启而造成配置丢失

    <Sysname> save
    The current configuration will be written to the device. Are you sure? [Y/N]:y
    Please input the file name(*.cfg)[flash:/startup.cfg]
    (To leave the existing filename unchanged, press the enter key):
    flash:/startup.cfg exists, overwrite? [Y/N]:y
    Validating file. Please wait.................
    Saved the current configuration to mainboard device successfully.
    Slot 2:
    Save next configuration file successfully.

    在用户视图下,执行reboot命令重启IRF,完成对启动软件包的升级。

    说明:
    指定Master和各成员设备的下次主用启动软件包后,需要重启设备新的启动软件包才能生效。在重启的过程中,如果启动软件包中的BootRom文件存在更新,系统会提示用户是否升级BootRom基本段和BootRom扩展段。
    升级BootRom文件时,为了避免兼容性问题,建议用户同时升级BootRom基本段和BootRom扩展段。
    如果用户选择不升级BootRom文件,在设备断电后重新上电、通过命令行立即重启或通过命令行定时重启的过程中,系统都将再次提示用户升级BootRom文件,如果用户没有及时作出选择,设备仍将默认升级完整的BootRom文件。

    1.3.2 安装补丁包

    逐一激活Master和Standby上的补丁包system-patch.bin。

    <Sysname> install activate patch flash:/system-patch.bin slot 1
    <Sysname> install activate patch flash:/system-patch.bin slot 2

    查看已激活的软件包(此时可看到补丁包已激活)。

    <Sysname> display install active
    Active packages on slot 1:
      flash:/boot.bin
      flash:/system.bin
      flash:/system-patch.bin
    Active packages on slot 2:
      flash:/boot.bin
      flash:/system.bin
      flash:/system-patch.bin

    确认补丁包更改,以保证补丁包在设备下次重启后仍然有效。

    <Sysname> install commit

    查看已确认更改的软件包(此时可看到补丁包已确认更改)。

    <Sysname> display install committed
    Committed packages on slot 1:
      flash:/boot.bin
      flash:/system.bin
      flash:/system-patch.bin
    Committed packages on slot 2:
      flash:/boot.bin
      flash:/system.bin
      flash:/system-patch.bin

关键字