[DRBD-user] drbd - configuring without secondary in place

Stefan Lesicnik stefan at lsd.co.za
Fri Sep 14 11:35:01 CEST 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Noah Dain wrote:
> On 9/13/07, Noah Dain <noahdain at gmail.com> wrote:
>> On 9/13/07, Stefan Lesicnik <stefan at lsd.co.za> wrote:
>>> Hi,
>>>
>>> I've searched for quite a while and havent been able to find any
>>> solution to a current problem we have.
>>>
>>> I am setting up a HA server and want to use drbd. I have tested drbd and
>>>  it seems to work well.
>>>
>>> The problem comes in that I need to configure our new server with drbd
>>> and have it become the primary, but the secondary wont be available
>>> until i reinstall it, install drbd and copy the drbd.conf file in.
>> I'm doing something similar here.  One machine is up (fresh install),
>> but I'm waiting on another machine to become available before I can
>> make it the secondary.
>>
>> I'm running debian etch (4.0).
>>
>>> I didnt want to do that step all on one day, i had it planned like this
>>>
>>> Install new server
>>> Configure drbd (point to a dummy secondary server?)
>>> Make drbd the primary
>>> Configure new server
>>> Shut down old server
>>> Promote new server to our main server
>>> Configure old server with drbd as failover for new server
>>>
>>> >From what i've seen, i cant seem to promote drbd to primary if it cant
>>> see the secondary. Is this correct?  Any way around this?  Also, it
>>> seems you cant mount /dev/drbd0 if it is not consistant and a drbd primary.
>> you can force it to be the primary with drbdadm.  heartbeat can also
>> be set up to do this.  Although in my situation, I've never had a drbd
>> device show as inconsistant.
>>
>> for the drbd resource(s) in question, I have these settings ( in
>> drbd.conf, obviously ):
>> """
>> startup {
>>         wfc-timeout 10;     ## how long to wait before going ahead
>> without other cluster node
>>         degr-wfc-timeout 20;    ## degraded-cluster at boot timeout
>>     }
>> """
>>
>> Then I had to change the heartbeat script that handles drbd (
>> /etc/ha.d/resource.d/drbddisk ), as it wasn't mounting the drbd
>> device. I changed "sleep 1" to "sleep 5" (it's the only 'sleep'
>> command used in that script).
>>
>> so now on a system startup the drbd init script runs and the drbd
>> device comes up as secondary.  heartbeat then starts and about a
>> minute later it promotes the drbd device(s) to primary and mounts the
>> filesystem.
>>
>> my /etc/ha.d/haresources line looks like this:
>> myserver drbddisk::drbdres0 Filesystem::/dev/drbd0::/drbd/res0::ext3
>>
>> once i get the failover machine online, I may need to tweak the
>> timeout settings and what not.  Afraid I can't be of much more help on
>> that just yet.  I still need to learn the finer points of drbd and
>> heartbeat.
> 
> whoops, almost forgot ha.cf interesting bits:
> """
> keepalive   1
> warntime    10
> deadtime    20
> ## deadtime, but for when system first boots:
> initdead    120
> ## whenever this machine comes online, it grabs all ha resources:
> auto_failback   on
> 
> ## make sure both names are accessible - check /etc/hosts
> node    myserver1
> node    myserver2
> """
> 
> 

Thanks Noah!

Appreciate it. I have managed to force the disk into primary without the
secondary. I am just working on the heartbeat stuff now.

Thanks a lot :)

Stefan





More information about the drbd-user mailing list