交换机集群管理
理解交换机集群的配置及原理。
某校园网的网络规模很大,仅交换机就有几十台,对于这个网络的管理和维护,网络管理员感到比较复杂,并且需要较多的IP地址(每台1个IP地址),因此打算采用交换机集群技术简化网络的管理并节省IP地址。现要在交换机上做适当配置来实现多台交换机的集群管理,从而提高管理效率。
本实验以交换机S3550-24(2台)和S2126G (2台)为例,在下面的拓扑图中分别标记为Switch-1,Switch-2,Switch-3,Switch-4 。
使网络管理员通过一台交换机(命令交换机)和一个IP地址就可对多台交换机进行配置和管理。
2126G (2台)、S3550-24(2台)
第一步:配置交换机Switch-1为集群命令交换机,并定义集群名称
Switch-1(config)# cluster run !打开集群功能。此命令可选,因为交换机默认是打开的
Switch-1(config)# cluster enable clus0 1 !配置Switch-1为集群命令交换机,并创建集群clus0,定义命令交换机的序号为1,范围为0—19
Switch-1(config)#cluster discovery hop-count 5 !设置集群发现跳数为5,缺省是3,范围是1—7
验证测试:验证集群配置
Switch-1#show cluster !显示交换机所属集群的基本信息
Cluster: clus0
Total number of members: 1
Status: 0 members are unreachable
Time of last status change: 0d:0h:0m:0s
Cluster timer: 12
Cluster holdtime: 120
Cluster discovery hop count: 5
Switch-1#show cluster candidates
MAC Name Hop LcPort UpSN UpMAC UpPort
-------------- ------------- --- ------- ---- -------------- -------
00d0.f8ef.9d08 Switch-4 2 Fa0/23 00d0.f8ff.4642 Fa0/23
00d0.f8fe.1e48 Switch-3 1 Fa0/23 1 00d0.f8ff.4e1f Fa0/23
00d0.f8ff.4642 Switch-2 1 Fa0/24 1 00d0.f8ff.4e1f Fa0/24
第三步:将候选交换机Switch-2和Switch-3、Switch-4加入到集群中
Switch-1(config)#cluster member 2 mac-address 00d0.f8ff.4642 password star
!
加入成员交换机Switch-2,并设置密码为star
Switch-1(config)#cluster member 3 mac-addres 00d0.f8fe.1e48 password star
!加入成员交换机Switch-3,并设置密码为star
Switch-1(config)#cluster member 4 mac-addres 00d0.f8ef.9d08 password star
!加入成员交换机Switch-4,并设置密码为star
验证测试:验证成员交换机配置
Switch-1#show cluster members
SN MAC Name Hop State LcPort UpSN UpMAC UpPort
-- -------------- ------------- --- -------- ------- ---- -------------- -------
1 00d0.f8ff.4e1f Switch-1 0 up
2 00d0.f8ff.4642 Switch-2 1 up Fa0/24 1 00d0.f8ff.4e1f Fa0/24
3 00d0.f8fe.1e48 Switch-3 1 up Fa0/23 1 00d0.f8ff.4e1f Fa0/23
4 00d0.f8ef.9d08 Switch-4 2 up Fa0/23 2 00d0.f8ff.4642 Fa0/23
Switch-1# rcommand 2 !从命令交换机登录到成员交换机2
Switch-3# rcommand commander ! 从成员交换机3登录到命令交换机
l
对集群配置一个IP地址即可对整个集群进行管理;
l
只有候选交换机才能加入到集群中;
l
将交换机加入集群的另一种方式是用命令:Switch-1(config)#cluster commander-address {MAC地址} [ member number name name ] ,此命令在候选交换机上配置,其中MAC地址是命令交换机的MAC地址,number是候选交换机的序号,name是集群名称。
Switch-1#show running-config ! 显示命令交换机Switch-1的配置
Building configuration...
Current configuration : 415 bytes
!
version 1.0
!
hostname Switch-1
enable secret level 1 5 $2,1u_;C3&-8U0H
enable secret level 15 5 $2knAxB^3glowNq&4h`@IOrJQimLMp]K
!
interface Vlan 1
ip address 172.16.1.1 255.255.255.0
!
cluster enable clus0 1
cluster discovery hop-count 5
cluster member 4 mac-address 00d0.f8ef.9d08
cluster member 3 mac-address 00d0.f8fe.1e48
cluster member 2 mac-address 00d0.f8ff.4642
end
Switch-2#show running-config ! 显示成员交换机Switch-2的配置
Building configuration...
Current configuration : 169 bytes
!
version 1.0
!
hostname Switch-2
enable secret level 15 5 $2>H.Y*T3;C,tZ[V4
!
cluster commander-address 00d0.f8ff.4e1f member 2 name clus0
end
Switch-3#show running-config ! 显示成员交换机Switch-3的配置
Building configuration...
Current configuration : 227 bytes
!
version 1.0
!
hostname Switch-3
enable secret level 1 5 $2glowNq3eh`@IOr4fimLMp]QcknAxB^
enable secret level 15 5 $21X)sv'3H.Y*T7+4,tZ[V/,Q+S(\W&-
!
cluster commander-address 00d0.f8ff.4e1f member 3 name clus0
end
Switch-4#show running-config ! 显示成员交换机Switch-4的配置
Building configuration...
Current configuration : 227 bytes
!
version 1.0
!
hostname Switch-4
enable secret level 1 5 $2'dfimL3t{bcknA47zyglowQ-aeh`@I
enable secret level 15 5 $2,|7zyg3&-/-aeh4'~1'dfiQ+.t{bck
!
cluster commander-address 00d0.f8ff.4e1f member 4 name clus0
end