Mailing List Archive

Re: Slakware Episode 3
Am Son, 04 Jun 2000 schriebst Du:
>I think I dont understand anythink about drbd ;)
>I dont use heartbeat at this moment ( second step ;) )
>When I've launched the 2 drbd on the servers, all is OK ( with failure, but
>Ok ;):
>
>node 1 and node2 , www and mail have both :
>MASTER_NODE=www:7788
>SLAVE_NODE=mail:7788
>OPTIONS="-r 500"
>SIZE=0
>PROTOCOL=C
>MASTER_IF=192.168.150.3
>SLAVE_IF=192.168.150.4
>MASTER_DEVICE=/dev/nb0
> SLAVE_DEVICE=/dev/nb0
>MASTER_PARTITION=/dev/hdb1
> SLAVE_PARTITION=/dev/hdb1
>MASTER_MNTPOINT=/var/spool/mail
>SLAVE_MNTPOINT=/var/spool/mail
>
>When I launch the both drbd I have on proc/drbd :
>
>www:/etc/rc.d/init.d# cat /proc/drbd
>version : 55
>
>0: cs:Connected st:Secondary ns:0 nr:0 dw:0 dr:0 of:0
>
>on the BOTH node on Secondary state... first strange think.. then I try to
>correct that:

This is ok. DRBD does not know by itself, on which machine you are
going to run the service.

>www:/drbdsetup /dev/nb0 PRI
>
>At this time, I was thinking that drbd was like RAID 1 so, if i change
>somethink on the /var/spool/mail/ on the node1 that will be also changed on
>the node2:
>

Yes, that's right.
( You know http://www.complang.tuwien.ac.at/reisner/drbd/uman.html ?)

But probabely the FS on www is writing the changed blocks a bit later
to the device (e.g. 5 seconds later the directory entry, 30 seconds later
the data blocks, see uman.html!)

>www:/var/spool/mail# touch blah
>

Do you have the Filesystems mounted simultaniously ?
That's not working, because the FS on mail is not rereading the
device, it's using it's cache! Therefore the FS on mail does
not see the blah file.

>mail:/var/spool/mail# ls
>lost+found
>mail:/var/spool/mail#
>
>That dont seems to work..., and the value in /proc/drbd dont change...is it
>normal?

try:

1) connect the device pair. (drbd script)
2) chose one node to run the service (e.g. sendmail)
2a) Switch the device on that node into primary state (on www)
2b) Mount the FS on the device (on www)
2c) Run the service (Modify the content of the FS) (on www)

3) See how mirroring is working
3a) Stop the service (www)
3b) unmount the FS (www)
3c) Switch the device into secondary state (www)

4) Repeate 2a - 2c on the other machine. (on mail)

FYI 2a-2c == datadisk start
3a-3c == datadisk stop


-Philipp
Re: Re: Slakware Episode 3 [ In reply to ]
> >www:/drbdsetup /dev/nb0 PRI
> >
> >At this time, I was thinking that drbd was like RAID 1 so, if i change
> >somethink on the /var/spool/mail/ on the node1 that will be also changed
on
> >the node2:

It is not really a RAID 1 as you can only write on a disk at a time ...
*** I hope you are not trying to do load balancing for your mail service ??
***
If yes it is not simple but I can give you idea ..

On the other hand, I think the network RAID-1 expression must have confused
more than my tiny brain.
It would be a go idea to explain on the documentation that you can not write
on the slave node,
and that after a mount read-only the filesystem won't be updated, even if
the underlying information are.

Thomas
RE: Re: Slakware Episode 3 [ In reply to ]
Ok all is working here.. with heartbeat also, on Slackware and on Debian...
Thank to all ;)
Some questions left, like:
Why must we do
./datadisk drbd0 start
iinstead than :
./datatdisk /dev/nb0 start ? That should be more logical (for me ;) cause
aall the references to the ressources in ./drbd and in the config files are
with /dev/nb[0 -..] and the only time we have to use drbd0 is with the
datadisk script...
And can we read and mount ( readonly) the slave fs or not? cause when I
tried, all seems ok: On the read only slave fs, I can see all change with 1
second delay when i modify the master fs and I had no strange beahvior
for the moment..) as it's said in
http://www.complang.tuwien.ac.at/reisner/drbd/uman.html
Cause if the "double-read" works, we can do load-balancing with a read only
filesystem, a apache webserver for example ..
For the "Slack and Debian" adaptation, should I use the CVS, or only the
tarball for the moment (or both ;) ?

Alexandre
Re: Re: Slakware Episode 3 [ In reply to ]
> And can we read and mount ( readonly) the slave fs or not? cause when I
> tried, all seems ok: On the read only slave fs, I can see all change with
1
> second delay when i modify the master fs and I had no strange beahvior
> for the moment..) as it's said in

Look at the file timestamp you will see all is not alright.
Furthermore the inode table can be cached in memory on the slave as the FS
is mounted RO.
You can so have surprises ...

Thomas
RE: Re: Slakware Episode 3 [ In reply to ]
On Tue, 6 Jun 2000, Alexandre Aellig wrote:

> Ok all is working here.. with heartbeat also, on Slackware and on Debian...
> Thank to all ;)
> Some questions left, like:
> Why must we do
> ./datadisk drbd0 start
> instead than :
> ./datatdisk /dev/nb0 start ?

We are using /dev/nbX because of a shortcomming in the 2.2.x Kernels
(see http://www.complang.tuwien.ac.at/reisner/drbd/tech.html)

With the 2.4.X Kernels drbd will have it's own major number and
therefore it's own /dev/drbdX (or whatever they will be called with
devfs) entries.

> That should be more logical (for me ;) cause
> all the references to the ressources in ./drbd and in the config files are
> with /dev/nb[0 -..] and the only time we have to use drbd0 is with the
> datadisk script...

and /proc/drbd :)

> And can we read and mount ( readonly) the slave fs or not? cause when I
> tried, all seems ok: On the read only slave fs, I can see all change with 1
> second delay when i modify the master fs and I had no strange beahvior
> for the moment..) as it's said in

Well let's think of an example:
Let's say the FS on the slave is holding some inodes in memory, because
the where recently accessed.
Now you are deleteing that file on the master and creating some new
files on the master, and by accident this new files are allocating the
space of the old file.
Now you are accessing the old file on the slave again (it's inode
is still in secondary's RAM, but it's not longer on the secondary's
disk!). Also the datablocks are gone!!

My experience:
==============
ext2 is a "rock solid" FS and will print out a lot of error messages
in such a case, but it will not crash the machine.
ReiserFS The chances to see a crach are quite good :( .


> http://www.complang.tuwien.ac.at/reisner/drbd/uman.html
> Cause if the "double-read" works, we can do load-balancing with a read only
> filesystem, a apache webserver for example ..

Well, I am dreaming of an server-less-distributed FS, using two
phase commits, UDP multicasts, tunable redundancy on directory level
etc... ...offering flocks and Unix's file semantics.
Still looking for an sponsor :)

> For the "Slack and Debian" adaptation, should I use the CVS, or only the
> tarball for the moment (or both ;) ?

Please send me your modifications per email first. We will see
how they fit into the picture.

-Philipp
Re: Re: Slakware Episode 3 [ In reply to ]
Hi!

) >MASTER_NODE=www:7788
) >SLAVE_NODE=mail:7788
) >MASTER_IF=192.168.150.3
) >SLAVE_IF=192.168.150.4

Just a small correction: if you are using only one device and one
network interface in each machine, things will work fine with the setup
as above. BUT for your own good you might want to place the port
definitions (:7788) in the *_IF variables. That's where they will be
searched for when you set those variables. So:

MASTER_NODE=www
SLAVE_NODE=mail
MASTER_IF=192.168.150.3:7788
SLAVE_IF=192.168.150.4:7788

is what you need.

Cheers! :)
Fábio
( Fábio Olivé Leite -* ConectivaLinux *- olive@example.com[.br] )
( PPGC/UFRGS MSc candidate -*- Advisor: Taisy Silva Weber )
( Linux - Distributed Systems - Fault Tolerance - Security - /etc )