One mnesia short of a cluster.

Hi There,

I'm having trouble getting a second ejabberd node online; when I start up the second node for the first time, it clobbers the that nodes' mnesia configuration. That's the short version of my story.

The longer version follows. I've successfully setup ejabberd on the first node; that worked fine. I setup mnesia on the second node following the instructions in the Installation & Operation guide, which also worked fine. (At this point ejabberd is still only running on the first node, I'm only configuring mnesia on the second.) When I'm done, mnesia appears on both erlang nodes see each other and everything's happy. I can stop and start the second erlang node (still without ejabberd) and verify mnesia's still happy. But the first time I start ejabberd, it reconfigures mnesia's local configuration to act as a single node.. after that any attempt to connect with that mnesia configuration without ejabberd fails with complains about corruption.

I think I'm missing something obvious here.. so it would be wonderful if someone can point me in the right direction. Here's some [hopefully] useful information: I'm running ejabberd 0.9.1 and erlang 5.4.8 on both nodes. One of the is a FreeBSD machine, and I've used ejabberd 0.9.1_1 from the ports collection. The other is an vintage RedHat box with both erlang and ejabberd compiled from source. The command line I'm using to setup mnesia on the second node is:

# HOME=/var/run/ejabberd erl -sname ejabberd -mnesia dir \"/var/spool/ejabberd\" -mnesia extra_db_nodes "['ejabberd@firstnode']" -s mnesia

(The first time.) On future runs, I only need:

# HOME=/var/run/ejabberd erl -sname ejabberd -mnesia dir \"/var/spool/ejabberd\"

To start ejabberd, my script uses:

exec erl -sname ejabberd -s ejabberd -ejabberd config \"/etc/ejabberd/ejabberd.cfg\" log_path \"/var/log/ejabberd/ejabberd.log\" \
-sasl sasl_error_logger \{file,\"$SASL_LOG\"\} -mnesia dir \"/var/spool/ejabberd\" -noshell -detached

(Which was not stolen from FreeBSD, why do you ask?)

Any words of wisdom would be appreciated.. thanks in advance,

Geoff

followup

On closer inspection, it looks like it might be a permissions issue in the spool directory. I was configuring the mnesia database as root, but running ejabberd as its own user.

I'm currently upgrading erlang and ejabberd to the latest versions, and I'll try again.

Thanks,

Geoff

Syndicate content