如何阻止ejabberd使用失忆症 [英] How to stop ejabberd from using mnesia

查看:101
本文介绍了如何阻止ejabberd使用失忆症的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立一个程序,以将数据库从崩溃的服务器恢复到新服务器。我的服务器将Ejabberd作为XMPP服务器运行,我将其配置为使用postgresql而不是mnesia-或我认为。

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.

我的过程类似于转储内容原始数据库,运行新服务器,使用psql还原数据库的内容,然后运行系统。但是,当我再次尝试运行Ejabberd时遇到崩溃:

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

中的
这里我以为我的系统正在运行PostgreSQL,尽管我似乎仍在使用Mnesia。我有几个问题:

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


  1. 如何确保未使用记忆障碍?

  2. 如何我可以将所有ejabberd活动转移到PGSQL吗?

这是我的ejabberd.cfg文件中的模块部分:

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,  []}
 ]}.

我想念什么?

我我以为崩溃是由于Ejabberd使用了mnesia数据库造成的,并且由于它与PGSQL DB不同步,因此无法正常运行-但也许我在这里完全偏离了轨道,并且会喜欢一些指导。

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.

编辑:解决了一个问题。由于我使用的是亚马逊云,因此我需要对ERLANG_NODE进行硬编码,因此不会由主机名定义(主机名在重新启动时会更改)。这使我的ejabberd运行起来,但是我仍然想停止使用mnesia,我想知道ejabberd的哪一部分仍在使用它,如何找到它。

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.

推荐答案

上周我个人已经了解了有关ejabberd的信息。

I've personally learnt some about ejabberd this last week.

如果您正在运行除mnesia以外的任何数据库,则不是所有的模块例如,即使您已将服务器配置为使用postgress,mod_admin_extra仍将继续与mnesia db一起使用。

If you are running any DB other than mnesia, then not all modules that you have running will actually communicate with it.

因此,如果您要通过mod_admin_extra提供的额外命令(和其他模块)来添加/删除花名册/用户,那么您将不得不寻找其他方法。

For instance, mod_admin_extra will continue to work with the mnesia db, even after you have configured the server to work with postgress. So if you're doing alot of your adding/removing roster/users via the extra commands that mod_admin_extra provide (and other modules), then you're going to have to find some other way to do it.

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

Basically, there is no way to have ejabberd stop using the mnesia db at all, it will always use it for some sort of processing.

这篇关于如何阻止ejabberd使用失忆症的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆