Add stack:
SW1
int stack-p 0/1
port int g0/0/8 enable
int stack-p 0/2
port int g0/0/7 enable
quit
stack slot 0 priority 200
SW2
int stack-p 0/1
port int g0/0/7 enable
int stack-p 0/2
port int g0/0/8 enable
quit
stack slot 0 renumber 1
save & reboot, and then plug stack cable(SW1 g0/0/8 to SW2 g0/0/8, SW1 g0/0/7 to SW2 g0/0/7)
Delete stack:
SW1
int stack-p 0/1
shut int g0/0/8
undo port int g0/0/8 enable
int stack-p 0/2
shut int g0/0/7
undo port int g0/0/7 enable
quit
stack slot 0 priority 100
SW2
int stack-p 1/1
shut int g1/0/7
undo port int g1/0/7 enable
int stack-p 1/2
shut int g1/0/8
undo port int g1/0/8 enable
quit
stack slot 1 renumber 0