Can different virtual hosts use different mnesia databases?

I have a development environment with two different applications that use ejabberd. I would like there to be a different virtual host for each application (easy enough), but I would also like each virtual host to have its own mnesia database.

I see from the guide on the commercial site that this is quite possible and straightforward when using different database solutions (MySQL, say), but I cannot find an example of this with mnesia.

Is this possible?

Any comments / feedback are appreciated.

jc

No need to configure Mnesia system

johnideal wrote:

I have a development environment with two different applications that use ejabberd. I would like there to be a different virtual host for each application (easy enough), but I would also like each virtual host to have its own mnesia database.

I see from the guide on the commercial site that this is quite possible and straightforward when using different database solutions (MySQL, say), but I cannot find an example of this with mnesia.

As you noticed, when using an external *SQL storage for a vhost, it is required to define a database for each vhost. This is due to the database architecture implemented in ejabberd, which is inherited from jabberd1.

However, when using the default internal Mnesia storage for a vhost, there is no need to define or configure anything about the storage. ejabberd will use the same database for all vhosts, taking care to identify each record with the vhost name.

So don't worry, just define in ejabberd.cfg your vhosts like this and start using them:

{hosts, ["host1.example.com", "host2.example.com"]}.
Syndicate content