2

I'm trying to establish a procedure for restoring my database from a crashed server to a new server. My server is running Ejabberd as an XMPP server, and I configured it to use postgresql instead of mnesia - or so I thought.

My procedure goes something like "dump the contents of the original DB, run the new server, restore the contents of the DBs using psql, then run the system". However, when I try running Ejabberd again I get a crash:

=CRASH REPORT==== 3-Dec-2010::22:05:00 ===
  crasher:
    pid: <0.36.0>
    registered_name: []
    exception exit: {bad_return,{{ejabberd_app,start,[normal,[]]},
                                 {'EXIT',"Error reading Mnesia database"}}}
      in function  application_master:init/4

Here I was thinking that my system is running on PostgreSQL, while it seems I was still using Mnesia. I have several questions:

  1. How can I make sure mnesia is not being used?
  2. How can I divert all the ejabberd activities to PGSQL?

This is the modules part in my ejabberd.cfg file:

{modules,
 [
  {mod_adhoc,    []},
  {mod_announce, [{access, announce}]}, % requires mod_adhoc
  {mod_caps,     []},
  {mod_configure,[]}, % requires mod_adhoc
  {mod_ctlextra, []},
  {mod_disco,    []},
  {mod_irc,      []},
  {mod_last_odbc,     []},
  {mod_muc,      [
      {access, muc},
      {access_create, muc},
      {access_persistent, muc},
      {access_admin, muc_admin},
      {max_users, 500}
     ]},
  {mod_offline_odbc,  []},
  {mod_privacy_odbc,  []},
  {mod_private_odbc,  []},
  {mod_pubsub,   [ % requires mod_caps
      {access_createnode, pubsub_createnode},
      {plugins, ["default", "pep"]}
     ]},
  {mod_register, [
      {welcome_message, none},
      {access, register}
     ]},
  {mod_roster_odbc,   []},
  {mod_stats,    []},
  {mod_time,     []},
  {mod_vcard_odbc,    []},
  {mod_version,  []}
 ]}.

What am I missing?

I am assuming the crash is due to the mnesia DB being used by Ejabberd, and since it's out of sync with the PGSQL DB, it cannot operate correctly - but maybe I'm totally off track here, and would love some direction.

EDIT: One problem solved. Since I'm using amazon cloud, I needed to hardcode the ERLANG_NODE so it won't be defined by the hostname (which changes on reboot). This got my ejabberd running, but still I wish to stop using mnesia, and I wonder what part of ejabberd is still using it and how can I found it.

4

3 回答 3

2

上周我亲自了解了一些关于 ejabberd 的信息。

如果您正在运行 mnesia 以外的任何数据库,那么并非您运行的所有模块都会与它进行实际通信。

例如,mod_admin_extra 将继续与 mnesia db 一起使用,即使您已将服务器配置为使用 postgress。因此,如果您通过 mod_admin_extra 提供的额外命令(和其他模块)进行大量添加/删除名册/用户,那么您将不得不找到其他方法来做到这一点。

基本上,根本没有办法让 ejabberd 停止使用 mnesia db,它总是将它用于某种处理。

于 2011-03-08T08:07:27.757 回答
0

根据您的应用程序,您很可能不需要 ejabberd.cfg 文件中列出的 90% 的模块。最基本的:

  • mod_roster_odbc
  • mod_offline_odbc
  • mod_register

有关更多 ejabberd 提示,请参阅:

http://www.quora.com/What-are-some-tricks-to-scale-ejabberd

于 2011-02-26T17:41:20.723 回答
0

看起来您错过了需要在其上使用 _odbc 重命名的模块之一,即 mod_pubsub _> mod_pubsub_odbc

这里

可能还值得查看 /var/lib/ejabberd 目录,看看有哪些 DCD/DCL 文件,据我了解,这些文件是 mnesia 的 db 文件。然后,您可以尝试确定是否需要配置任何其他模块以指向 MySQL。

于 2011-02-24T10:19:52.520 回答