mod_archive_odbc モジュールを追加するために、ejabberd サーバーを MySQL に接続しようとしています。ejabberd 2.1.13 を実行しています。サーバーの残りの部分は、ストレージに mnesia を使用します。最初に DSN アプローチを試みましたが、失敗しました。現在、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>]
モジュール セクションは次のようになります。
{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}]}
データベース セクションは次のようになります。
{odbc_server, {mysql, "localhost", "ejabberd", "ejabberd", "password"}}.
ejabberd ユーザーを使用して、mysql サーバーにローカルおよびリモートで接続できます。
エラーが発生している間のngrepの出力は次のとおりです。
# 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
ネットワーク上の別のコンピューターを介してejabberdユーザーでMySQLに接続した場合のngrep出力は次のとおりです
# 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]
.....
###
MySQL モジュールがインストールされているようです。
(ejabberd@ip-10-179-7-235)1> ejabberd_check:check_database_module(mysql).
ok