在Cumulus模式下安装Cumulus Linux
当交换机在Cumulus模式下运行时、请按照此操作步骤 安装Cumulus Linux (CL)操作系统。
可以在交换机运行Cumulus Linux或ONIE时安装Cumulus Linux (CL)操作系统(请参见 "在ONIE模式下安装")。 |
-
中级Linux知识。
-
熟悉基本文本编辑、UNIX文件权限和进程监控。预安装了各种文本编辑器、包括
vi
和nano
。 -
访问Linux或UNIX Shell。如果您运行的是Windows、请使用Linux环境作为命令行工具与Cumulus Linux进行交互。
-
对于NVIDIA SN2100交换机控制台访问、串行控制台交换机上的波特率要求设置为115200、如下所示:
-
115200 波特
-
8 个数据位
-
1 个停止位
-
奇偶校验:无
-
流量控制:无
-
请注意以下事项:
每次安装Cumulus Linux时、都会擦除并重建整个文件系统结构。 |
累积用户帐户的默认密码为*累积用户*。首次登录到Cumulus Linux时、必须更改此默认密码。在安装新映像之前、请务必更新所有自动化脚本。Cumulus Linux提供了命令行选项、用于在安装过程中自动更改默认密码。 |
-
登录到交换机。
首次登录到交换机时、需要使用的用户名/密码为*累积us*/累积us
sudo
特权。cumulus login: cumulus Password: cumulus You are required to change your password immediately (administrator enforced) Changing password for cumulus. Current password: cumulus New password: <new_password> Retype new password: <new_password>
-
检查Cumulus Linux版本:
net show system
cumulus@cumulus:mgmt:~$ net show system Hostname......... cumulus Build............ Cumulus Linux 4.4.3 Uptime........... 0:08:20.860000 Model............ Mlnx X86 CPU.............. x86_64 Intel Atom C2558 2.40GHz Memory........... 8GB Disk............. 14.7GB ASIC............. Mellanox Spectrum MT52132 Ports............ 16 x 100G-QSFP28 Part Number...... MSN2100-CB2FC Serial Number.... MT2105T05177 Platform Name.... x86_64-mlnx_x86-r0 Product Name..... MSN2100 ONIE Version..... 2019.11-5.2.0020-115200 Base MAC Address. 04:3F:72:43:92:80 Manufacturer..... Mellanox
-
配置主机名、IP地址、子网掩码和默认网关。只有在重新启动控制台/SSH会话后、新主机名才会生效。
一个Cumulus Linux交换机至少可提供一个名为`eth0`的专用以太网管理端口。此接口专用于带外管理。默认情况下、管理接口使用DHCPv4进行寻址。 请勿在主机名中使用下划线(_)、撇号(')或非ASCII字符。 cumulus@cumulus:mgmt:~$ net add hostname sw1 cumulus@cumulus:mgmt:~$ net add interface eth0 ip address 10.233.204.71 cumulus@cumulus:mgmt:~$ net add interface eth0 ip gateway 10.233.204.1 cumulus@cumulus:mgmt:~$ net pending cumulus@cumulus:mgmt:~$ net commit
此命令会同时修改`/etc/hostname`和`/etc/hosts`文件。
-
确认主机名、IP地址、子网掩码和默认网关已更新。
cumulus@sw1:mgmt:~$ hostname sw1 cumulus@sw1:mgmt:~$ ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.233.204.71 netmask 255.255.254.0 broadcast 10.233.205.255 inet6 fe80::bace:f6ff:fe19:1df6 prefixlen 64 scopeid 0x20<link> ether b8:ce:f6:19:1d:f6 txqueuelen 1000 (Ethernet) RX packets 75364 bytes 23013528 (21.9 MiB) RX errors 0 dropped 7 overruns 0 frame 0 TX packets 4053 bytes 827280 (807.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0xdfc00000-dfc1ffff cumulus@sw1::mgmt:~$ ip route show vrf mgmt default via 10.233.204.1 dev eth0 unreachable default metric 4278198272 10.233.204.0/23 dev eth0 proto kernel scope link src 10.233.204.71 127.0.0.0/8 dev mgmt proto kernel scope link src 127.0.0.1
-
设置交换机上的日期、时间、时区和NTP服务器。
-
验证当前时区:
cumulus@sw1:~$ cat /etc/timezone
-
更新到新时区:
cumulus@sw1:~$ sudo dpkg-reconfigure --frontend noninteractive tzdata
-
验证当前时区:
cumulus@switch:~$ date +%Z
-
要使用引导式向导设置时区、请运行以下命令:
cumulus@sw1:~$ sudo dpkg-reconfigure tzdata
-
根据配置的时区设置软件时钟:
cumulus@switch:~$ sudo date -s "Tue Oct 28 00:37:13 2023"
-
将软件时钟的当前值设置为硬件时钟:
cumulus@switch:~$ sudo hwclock -w
-
根据需要添加NTP服务器:
cumulus@sw1:~$ net add time ntp server <cumulus.network.ntp.org> iburst cumulus@sw1:~$ net pending cumulus@sw1:~$ net commit
-
验证系统是否 `ntpd`正在运行:
cumulus@sw1:~$ ps -ef | grep ntp ntp 4074 1 0 Jun20 ? 00:00:33 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 101:102
-
指定NTP源接口。默认情况下,NTP使用的源接口为
eth0
。您可以按如下所示配置其他NTP源接口:cumulus@sw1:~$ net add time ntp source <src_int> cumulus@sw1:~$ net pending cumulus@sw1:~$ net commit
-
-
安装Cumulus Linux 4.5.3:
cumulus@sw1:mgmt:~$ sudo onie-install -a -i http://<web-server>/<path>/cumulus-linux-4.4.3-mlx-amd64.bin
安装程序将开始下载。出现提示时、键入*。
-
重新启动NVIDIA SN2100交换机:
cumulus@sw1:mgmt:~$ sudo reboot
-
安装将自动启动、并显示以下Grub屏幕选项。请勿*选择*。
-
Cumulus-Linux GNU/Linux
-
ONIE:安装操作系统
-
Cumulus-install
-
Cumulus-Linux GNU/Linux
-
-
重复步骤1至4以登录。
-
验证Cumulus Linux版本是否为4.5.3:
net show version
cumulus@sw1:mgmt:~$ net show version NCLU_VERSION=1.0-cl4.4.3u0 DISTRIB_ID="Cumulus Linux" DISTRIB_RELEASE=4.4.3 DISTRIB_DESCRIPTION="Cumulus Linux 4.4.3"
-
创建新用户并将此用户添加到
sudo
组。只有在重新启动控制台/SSH会话后、此用户才会生效。sudo adduser --ingroup netedit admin
cumulus@sw1:mgmt:~$ sudo adduser --ingroup netedit admin [sudo] password for cumulus: Adding user 'admin' ... Adding new user 'admin' (1001) with group `netedit' ... Creating home directory '/home/admin' ... Copying files from '/etc/skel' ... New password: Retype new password: passwd: password updated successfully Changing the user information for admin Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y cumulus@sw1:mgmt:~$ sudo adduser admin sudo [sudo] password for cumulus: Adding user `admin' to group `sudo' ... Adding user admin to group sudo Done. cumulus@sw1:mgmt:~$ exit logout Connection to 10.233.204.71 closed. [admin@cycrh6svl01 ~]$ ssh admin@10.233.204.71 admin@10.233.204.71's password: Linux sw1 4.19.0-cl-1-amd64 #1 SMP Cumulus 4.19.206-1+cl4.4.1u1 (2021-09-09) x86_64 Welcome to NVIDIA Cumulus (R) Linux (R) For support and online technical documentation, visit http://www.cumulusnetworks.com/support The registered trademark Linux (R) is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis. admin@sw1:mgmt:~$
-
登录到交换机。
首次登录到交换机时、需要使用的用户名/密码为*累积us*/累积us
sudo
特权。cumulus login: cumulus Password: cumulus You are required to change your password immediately (administrator enforced) Changing password for cumulus. Current password: cumulus New password: <new_password> Retype new password: <new_password>
-
检查Cumulus Linux版本:
nv show system
cumulus@cumulus:mgmt:~$ nv show system operational applied description ------------------- -------------------- --------------------- hostname cumulus cumulus build Cumulus Linux 5.3.0 system build version uptime 6 days, 8:37:36 system uptime timezone Etc/UTC system time zone
-
配置主机名、IP地址、子网掩码和默认网关。只有在重新启动控制台/SSH会话后、新主机名才会生效。
一个Cumulus Linux交换机至少可提供一个名为`eth0`的专用以太网管理端口。此接口专用于带外管理。默认情况下、管理接口使用DHCPv4进行寻址。 请勿在主机名中使用下划线(_)、撇号(')或非ASCII字符。 cumulus@cumulus:mgmt:~$ nv set system hostname sw1 cumulus@cumulus:mgmt:~$ nv set interface eth0 ip address 10.233.204.71/24 cumulus@cumulus:mgmt:~$ nv set interface eth0 ip gateway 10.233.204.1 cumulus@cumulus:mgmt:~$ nv config apply cumulus@cumulus:mgmt:~$ nv config save
此命令会同时修改`/etc/hostname`和`/etc/hosts`文件。
-
确认主机名、IP地址、子网掩码和默认网关已更新。
cumulus@sw1:mgmt:~$ hostname sw1 cumulus@sw1:mgmt:~$ ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.233.204.71 netmask 255.255.254.0 broadcast 10.233.205.255 inet6 fe80::bace:f6ff:fe19:1df6 prefixlen 64 scopeid 0x20<link> ether b8:ce:f6:19:1d:f6 txqueuelen 1000 (Ethernet) RX packets 75364 bytes 23013528 (21.9 MiB) RX errors 0 dropped 7 overruns 0 frame 0 TX packets 4053 bytes 827280 (807.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0xdfc00000-dfc1ffff cumulus@sw1::mgmt:~$ ip route show vrf mgmt default via 10.233.204.1 dev eth0 unreachable default metric 4278198272 10.233.204.0/23 dev eth0 proto kernel scope link src 10.233.204.71 127.0.0.0/8 dev mgmt proto kernel scope link src 127.0.0.1
-
设置交换机上的时区、日期、时间和NTP服务器。
-
设置时区:
cumulus@sw1:~$ nv set system timezone US/Eastern cumulus@sw1:~$ nv config apply
-
验证当前时区:
cumulus@switch:~$ date +%Z
-
要使用引导式向导设置时区、请运行以下命令:
cumulus@sw1:~$ sudo dpkg-reconfigure tzdata
-
根据配置的时区设置软件时钟:
cumulus@sw1:~$ sudo date -s "Tue Oct 28 00:37:13 2023"
-
将软件时钟的当前值设置为硬件时钟:
cumulus@sw1:~$ sudo hwclock -w
-
根据需要添加NTP服务器:
cumulus@sw1:~$ nv set service ntp default server <cumulus.network.ntp.org> iburst on cumulus@sw1:~$ nv config apply cumulus@sw1:~$ nv config save
-
验证系统是否 `ntpd`正在运行:
cumulus@sw1:~$ ps -ef | grep ntp ntp 4074 1 0 Jun20 ? 00:00:33 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 101:102
-
指定NTP源接口。默认情况下,NTP使用的源接口为
eth0
。您可以按如下所示配置其他NTP源接口:cumulus@sw1:~$ nv set service ntp default listen <src_int> cumulus@sw1:~$ nv config apply
-
-
安装Cumulus Linux 5.4:
cumulus@sw1:mgmt:~$ sudo onie-install -a -i http://<web-server>/<path>/cumulus-linux-5.4-mlx-amd64.bin
安装程序将开始下载。出现提示时、键入*。
-
重新启动NVIDIA SN2100交换机:
cumulus@sw1:mgmt:~$ sudo reboot
-
安装将自动启动、并显示以下Grub屏幕选项。请勿*选择*。
-
Cumulus-Linux GNU/Linux
-
ONIE:安装操作系统
-
Cumulus-install
-
Cumulus-Linux GNU/Linux
-
-
重复步骤1至4以登录。
-
验证Cumulus Linux版本是否为5.4:
nv show system
cumulus@cumulus:mgmt:~$ nv show system operational applied description ------------------- -------------------- --------------------- hostname cumulus cumulus build Cumulus Linux 5.4.0 system build version uptime 6 days, 13:37:36 system uptime timezone Etc/UTC system time zone
-
验证每个节点是否都与每个交换机建立了连接:
cumulus@sw1:mgmt:~$ net show lldp LocalPort Speed Mode RemoteHost RemotePort --------- ----- ---------- ---------------------------------- ----------- eth0 100M Mgmt mgmt-sw1 Eth110/1/29 swp2s1 25G Trunk/L2 node1 e0a swp15 100G BondMember sw2 swp15 swp16 100G BondMember sw2 swp16
-
创建新用户并将此用户添加到
sudo
组。只有在重新启动控制台/SSH会话后、此用户才会生效。sudo adduser --ingroup netedit admin
cumulus@sw1:mgmt:~$ sudo adduser --ingroup netedit admin [sudo] password for cumulus: Adding user 'admin' ... Adding new user 'admin' (1001) with group `netedit' ... Creating home directory '/home/admin' ... Copying files from '/etc/skel' ... New password: Retype new password: passwd: password updated successfully Changing the user information for admin Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y cumulus@sw1:mgmt:~$ sudo adduser admin sudo [sudo] password for cumulus: Adding user `admin' to group `sudo' ... Adding user admin to group sudo Done. cumulus@sw1:mgmt:~$ exit logout Connection to 10.233.204.71 closed. [admin@cycrh6svl01 ~]$ ssh admin@10.233.204.71 admin@10.233.204.71's password: Linux sw1 4.19.0-cl-1-amd64 #1 SMP Cumulus 4.19.206-1+cl4.4.1u1 (2021-09-09) x86_64 Welcome to NVIDIA Cumulus (R) Linux (R) For support and online technical documentation, visit http://www.cumulusnetworks.com/support The registered trademark Linux (R) is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis. admin@sw1:mgmt:~$
-
添加供管理员用户访问的其他用户组
nv
命令:cumulus@sw1:mgmt:~$ sudo adduser admin nvshow [sudo] password for cumulus: Adding user 'admin' to group 'nvshow' ... Adding user admin to group nvshow Done.
请参见 "NVIDIA用户帐户" 有关详细信息 …