0

I'm trying to connect our ejabberd server to MySQL to add the mod_archive_odbc module. We're running ejabberd 2.1.13. The rest of the server uses mnesia for storage. I tried the DSN approach first, but that failed. I'm currently getting this error in erlang.log:

=PROGRESS REPORT==== 24-Sep-2013::13:50:27 ===
          supervisor: {local,ejabberd_sup}
             started: [{pid,<0.777.0>},
                       {name,'ejabberd_mod_archive_odbc_chat.hostname.com'},
                       {mfargs,
                           {mod_archive_odbc,start_link,
                               ["chat.hostname.com",
                                [{database_type,"mysql"},
                                 {default_auto_save,true},
                                 {enforce_default_auto_save,false},
                                 {default_expire,infinity},
                                 {enforce_min_expire,0},
                                 {enforce_max_expire,infinity},
                                 {replication_expire,31536000},
                                 {session_duration,1800},
                                 {wipeout_interval,86400}]]}},
                       {restart_type,permanent},
                       {shutdown,1000},
                       {child_type,worker}]
=CRASH REPORT==== 24-Sep-2013::13:50:36 ===   crasher:
    initial call: mod_archive_odbc:init/1
    pid: <0.777.0>
    registered_name: 'ejabberd_mod_archive_odbc_chat.hostname.com'
    exception exit: {aborted,{no_exists,[sql_pool,"chat.hostname.com"]}}
      in function  gen_server:terminate/6
    ancestors: [ejabberd_sup,<0.37.0>]

This is what the modules section looks like:

  {mod_archive_odbc, [{database_type, "mysql"},
                      {default_auto_save, true},
                      {enforce_default_auto_save, false},
                      {default_expire, infinity},
                      {enforce_min_expire, 0},
                      {enforce_max_expire, infinity},
                      {replication_expire, 31536000},
                      {session_duration, 1800},
                      {wipeout_interval, 86400}]}

This is what the database section looks like:

{odbc_server, {mysql, "localhost", "ejabberd", "ejabberd", "password"}}.

I can connect to the mysql server locally and remotely using the ejabberd user as well.

Here is the ngrep output while the errors occur:

# ngrep port 3306
interface: eth0 (10.179.7.192/255.255.255.192)
filter: (ip or ip6) and ( port 3306 )
^Cexit
0 received, 0 dropped

# ngrep -d lo port 3306
interface: lo (127.0.0.0/255.0.0.0)
filter: (ip or ip6) and ( port 3306 )
^Cexit
0 received, 0 dropped

Here is ngrep output if I connect to MySQL with the ejabberd user via another computer on the network

# ngrep port 3306
interface: eth0 (10.179.7.192/255.255.255.192)
filter: (ip or ip6) and ( port 3306 )
####
T 10.179.7.235:3306 -> XX.XXX.XXX.XXX:55909 [AP]
  J....5.5.32.....xxpKb-VK...................UKXV(a2rh6r].mysql_native_password.
##
T XX.XXX.XXX.XXX:55909 -> 10.179.7.235:3306 [AP]
  >...................................ejabberd....).p.P..lt=BTK..w..
##
T 10.179.7.235:3306 -> XX.XXX.XXX.XXX:55909 [AP]
  ...........
#
T XX.XXX.XXX.XXX:55909 -> 10.179.7.235:3306 [AP]
  !....select @@version_comment limit 1
#
T 10.179.7.235:3306 -> XX.XXX.XXX.XXX:55909 [AP]
  .....'....def....@@version_comment............................MySQL Community Server (GPL).........
##
T XX.XXX.XXX.XXX:55909 -> 10.179.7.235:3306 [AP]
  .....
###

The MySQL module appears to be installed:

(ejabberd@ip-10-179-7-235)1> ejabberd_check:check_database_module(mysql).
ok
4

1 回答 1

2

The problem was the changes I was making were not being updated within the actual service. Another question, How to uninstall odbc for Ejabberd?, and the comments above by @giavac made me realize that apparently the configuration file is not always authoritative for the configuration.

Specifically, I fixed my problem by adding this line:

override_local.
于 2013-09-26T14:46:50.610 回答