[jdev] jabberd's question: how to run MySQL Server on another host?

张达来 bowlong at sztelecom.com
Wed May 25 06:41:37 CDT 2005


AS Jabberd2's Documentation say, it is possible to run the jabberd server
and the MySQL server on two different servers. I have configured the sm.xml
and the c2s.xml as following:
<!-- MySQL driver configuration -->
      <mysql>
        <!-- Database server host and port -->
        <host>10.1.11.17</host> <!--the host where mysql server is
running-->
        <port>3306</port>

        <!-- Database name -->
        <dbname>jabberd2</dbname>

        <!-- Database username and password -->
        <user>jabberd2</user>
        <pass>secret</pass>

        <!-- Transaction support. If this is commented out, transactions
             will be disabled. This might make database accesses faster,
             but data may be lost if jabberd crashes.

             This will need to be disabled if you are using a MySQL
             earlier than v3.23.xx, as transaction support did not appear
             until this version. -->
        <transactions/>
      </mysql>

I can access the mysql server's data via command line like:
>mysql -h 10.1.11.17 -u jabberd2 -p 

But when I start the jabberd, the following debug info will show:
 [root at szjabber jabberd]# ../../bin/jabberd -D
JBRD: debug on
JBRD: version(2.0s4)
JBRD: config_dir(/usr/local/etc/jabberd)
JBRD: LaunchJob: router -> /usr/local/bin/router -c
/usr/local/etc/jabberd/rout
r.xml -D
JBRD: LaunchJob: resolver -> /usr/local/bin/resolver -c
/usr/local/etc/jabberd/
esolver.xml -D
JBRD: LaunchJob: sm -> /usr/local/bin/sm -c /usr/local/etc/jabberd/sm.xml -D
JBRD: LaunchJob: s2s -> /usr/local/bin/s2s -c /usr/local/etc/jabberd/s2s.xml
-D
JBRD: LaunchJob: c2s -> /usr/local/bin/c2s -c /usr/local/etc/jabberd/c2s.xml
-D
SM  : WARN: Debugging not enabled.  Ignoring -D.
ERROR: sm died.  Shutting down server.
JBRD: Got a signal... pass it on.
JBRD: It was a TERM.  Shut it all down!
[root at szjabber jabberd]#

And when I change the mysql host back to "localhost", it can works very
well. And the database on 10.1.11.17 was migrated from "locahost", so it
couldn't be the matter.

I found the following information on
http://jabberd.jabberstudio.org/2/docs/section04_4.html,
It says,
N Note: Default MySQL Socket 
Jabberd 2 stable 3 connects to the MySQL server socket at /tmp/mysql.sock.
The default socket when installing MySQL from source is
/var/lib/mysql/mysql.sock. You will need to create a symlink to
/tmp/mysql.sock if it does not exist: 
      ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock   

If you are unsure as to where your MySQL server socket is, consult your
MySQL configuration file (usually located in /etc/my.cnf or
/etc/mysql/my.cnf). 

I'm puzzled that when the MySQL server is running on a remote host, how can
the jabberd find the "mysql.sock" to connect? So I think it may be the
reason why jabberd can't work. Is there anybody who can tell me how the
solved the problem? Is there any ways to create a "mysql.sock" on the
"localhost" which points to the mysql server running on a remote machine?

Thanks a lot.







...





More information about the JDev mailing list