How to best use a distributed disk_log?

Shawn Pearce spearce@REDACTED
Sun Feb 8 02:47:55 CET 2004


I'm having trouble figuring out the manual for disk_log.

What I'm trying to do is setup a 3 node network:

	a@REDACTED - log to local disk
	b@REDACTED - log to local disk (mirror)
	c@REDACTED - log to remote

I want to open up a disk_log under one name, and have two copies of
the log created, one on a@REDACTED and one on b@REDACTED  I want c@REDACTED to be 'diskless'
and have its logs sent to a@REDACTED and b@REDACTED

I'm trying to setup a "safe" log in that I have two copies on two
different machines, and my network of diskless nodes can safely send
their data off to the two mirrors.  I don't want to use Mnesia, for many
reasons, one of which is that if b@REDACTED is down, I still want to be able
to log to a@REDACTED  When b@REDACTED comes back up, I don't expect the logs to be
merged or anything, but I do expect all new data to get sent to both
a@REDACTED and b@REDACTED

I've tried playing with the {distributed} parameter to disk_log:open
and just keep getting weird states in my network.  This is what I think
I should be doing:

	a@REDACTED:
		disk_log:open([{name, n}, {file, "mylog1"},
			{distributed, ['b@REDACTED']}])

	b@REDACTED:
		disk_log:open([{name, n}, {file, "mylog2"},
			{distributed, ['a@REDACTED']}])

	c@REDACTED:
		disk_log:open([{name, n}, {distributed, ['a@REDACTED', 'b@REDACTED']})

But I'm getting weird network splits, data doesn't always seem to log
to the right places, and what if a@REDACTED isn't available when b@REDACTED tries
to open the log?  Even if I detect this and skip adding it to the
distributed option, how do I then add it later once the log is opened?

I'm going to explore this more tonight, but I'm doing it by trial
and error...  :-)

-- 
Shawn.



More information about the erlang-questions mailing list