DO NOT CONNECT THE CABLES YET.
NOTE: Stack-port 0/1 of SWA must be connected to Stack-port 0/2 of SWB and Stack-port 0/1 of SWB to Stack-port 0/2 of SWA
I used Xgigaethernet as an example of stacking port.
Step 1. Create and configure logical stack ports on the switches and physical ports to them. REPEAT PROCESS IN SWB
[SWA]interface stack-port 0/1
[SWA-stack-port0/1]port interface XGigabitethernet 0/0/1 enable
[SWA-stack-port0/1]q
[SWA]interface stack-port 0/2
[SWA-stack-port0/1]port interface XGigabitethernet 0/0/1 enable
[SWA-stack-port0/1]q
Step 2. Configure the Stack ID and priority of Switches to implement the Master-standby relationship. (In this example SWA is the master)
The default priority of a switch is 100
[SWA]stack slot 0 priority 200
[SWB]stack slot 0 renumber 1 >>>> Change the Stack ID from 0 to 1
Step 3. Save your configuration then TURN OFF both the switches. CONNECT THE STACK CABLES properly then TURN ON SWA and SWB.
Step 4. Verify if stack is successful. The result should be like this.
<SWA>dis stack
Stack mode: Service-port
Stack topology type: Ring
Stack system MAC: XXXX-XXXX-XXXX
MAC switch delay time: 10 min
Stack reserved VLAN: 4093
Slot of the active management port: --
Slot Role MAC Address Priority Device Type
-------------------------------------------------------------
0 Master XXXX-XXXX-XXXX 200 S5720-52X-SI-AC
1 Standby YYYY-YYYY-YYYY 100 S5720-52X-SI-AC