DRBD

From Swivel Knowledgebase
Jump to: navigation, search


Overview

DRBD is used by Swivel Active Passive (AP) hardware appliances as an HA solution, whereby only one of the appliances is running Swivel to authenticate users. With the AP appliances Tomcat is only running on the Active appliance, the Passive server does not have Tomcat running. The Active appliance has a Virtual IP address (VIP) bound to it, this moves to the other server if it becomes the Active. The Primary server is usually the Active server, and the Standby server the Passive server.

Two sites may be joined through two A/P pairs using a MySQL database within the Swivel appliances, with data shared between Active members of the sites.


Pre-requisites

Swivel Hardware Appliance 2.x


Which version of the appliance am I running?

See Appliance General FAQ


Active Passive Processes

For an Active Swivel Appliance the CMI will usually show the following processes status:

Tomcat : Running

Heartbeat : Running

Monitor : Running

Database : Running

DRBD : Running


For an Active Swivel Appliance the CMI will usually show the following processes status:

Tomcat : Stopped

Heartbeat : Running

Monitor : Running

Database : Stopped

DRBD : Running


Active Passive Management

AP appliance Swivel Management console should be done through the VIP, unlike A/A appliances. The VIP may also be used for RADIUS authentication, unlike the A/A Appliances. The graphical TURing and Pinpad images can be accessed through the VIP, as the A/A appliances can.


Restart Tomcat on A/P appliances

This is the procedure for restarting Tomcat.

Through the CMI stop mon on the Passive node then the Active Node

Then stop/start/restart tomcat

Then start mon on the Active node then the Passive Node


Failover the Active (Testing the AP Failover)

This will make the Active server Passive, and the Active Server Passive

On the Active server through the CMI stop heartbeat.

The Passive server should become the active server. To return the original sever to Active restart heartbeat.


DRBD status

A/P apliances will list their status in the CMI under DRBD\Status as below

   192.168.0.139                     192.168.0.140
   DRBD Running                        DRBD Running
  
   st:Primary/Secondary                st:Secondary/Primary
   ld:Consistent                       ld:Consistent
   ns:90976                            ns:208896
  
   DRBD disk partition is active     DRBD disk partition is not active


DRBD status can also be viewed from the command line.

/etc/init.d/drbd status

ok

 drbd driver loaded OK; device status:
 version: 0.7.25 (api:79/proto:74)
 GIT-hash: 3a9c7c136a9af8df921b3628129dafbe212ace9f build by mockbuild@v20z-x86-64.home.local, 2009-08-22 12:56:48
  0: cs:Connected st:Secondary/Primary ld:Consistent
     ns:11196 nr:464740 dw:475936 dr:25166 al:2 bm:362 lo:0 pe:0 ua:0 ap:0


 drbd driver loaded OK; device status:
 version: 0.7.25 (api:79/proto:74)
 GIT-hash: 3a9c7c136a9af8df921b3628129dafbe212ace9f build by mockbuild@v20z-x86-64.home.local, 2009-08-22 12:56:48
  0: cs:Connected st:Primary/Secondary ld:Consistent
     ns:464872 nr:11196 dw:50084 dr:475334 al:28 bm:86 lo:0 pe:0 ua:0 ap:0


IP Address change for Active Passive Appliances

See IP Address change for Active Passive Appliances


Known Issues

Please contact Swivel before upgrading.


DRBD troubleshooting

Checking communication

ping -I eth1 -c 5 224.0.0.1

should get a reply when run on a A/P pair


Unknown Status

Where the status is Primary/Unknown or Secondary/Unknown, then the A/P may need to be resolved

Example:

drbd driver loaded OK; device status: version: 0.7.25 (api:79/proto:74) GIT-hash: 3a9c7c136a9af8df921b3628129dafbe212ace9f build by mockbuild@v20z-x86-64.home.local, 2009-08-22 12:56:48 Primary 0: cs:WFConnection st:Primary/Unknown ld:Consistent

  ns:0 nr:0 dw:9862060 al:10 bm:818 lo:0 pe:0 ua:0 ap:0

drbd driver loaded OK; device status: version: 0.7.25 (api:79/proto:74) GIT-hash: 3a9c7c136a9af8df921b3628129dafbe212ace9f build by mockbuild@v20z-x86-64.home.local, 2009-08-22 12:56:48 Standby 0: cs:WFConnection st:Secondary/Unknown ld:Consistent

  ns:0 nr:0 dw:9862060 al:10 bm:818 lo:0 pe:0 ua:0 ap:0


DRBD stop/start and restart

Restart drbd on each of the Swivel server


CMI stop/start

The CMI allows the option to Stop DRBD and to start if stopped.


Command line DRBD options

Restarting drbd

 drbd restart

Stopping drbd

 drbddisk stop

connecting the drbd servers

 drbdadm connect all

Configuring the drbd as a Primary

 drbdadm -- do-what-I-say primary all


DRBD manual mount

DRBD manual mount can be used such as for example clearing mysql bin logs. This needs to be done on only one of the nodes, usually the Primary.

1. Stop all services on both nodes starting with the SECONDARY first.

a. Mon

b. Heartbeat


2. On the Primary, mount the drbd partition manually to gain access to the mysql and/or tomcat.


3. To mount the DRBD partition (normally you do this on primary)

a. /etc/ha.d/resource.d/drbddisk start

b. /etc/ha.d/resource.d/Filesystem /dev/drbd0 /drbd ext3 start


4. Now you can manage the /drbd partition and start/stop mysql and/or tomcat independently of heartbeat.


5. Follow the procedure of clearing the mysql bin-logs etc.


6. To dismount the DRBD partition.

a. /etc/ha.d/resource.d/Filesystem /dev/drbd0 /drbd ext3 stop

b. /etc/ha.d/resource.d/drbddisk stop


7. Now start heartbeat to start tomcat in the normal manor and test.


8. Start mon on primary and then heartbeat and mon on secondary.