Hi All,
First off - thank you for this module.
I have configured two redundant DB sources in my kamailio confiuration. The DB's are accessed from Kamailio for redundancy pruposes. Kamailio and the primary DB are on the same hardware node. The secondary DB is on a remote host. If Kamailio is up and both MySQL DB's are up, the config works like a charm. If the primary or the secondary DB becomes unreachable while Kamailio is up, the config handles the exception and all works well.
However, if any of the DB servers becomes unreachable and Kamailio is restarted, Kamailio can no longer start.
Below is an excerpt from my config file:
# -- sqlops params modparam("sqlops","sqlcon","pridb=>mysql://root:@localhost/db_table") modparam("sqlops","sqlcon","secdb=>mysql://root:@192.168.1.231/db_table")
/var/log/messages
Jun 26 06:16:00 test-ser /sbin/kamailio[20217]: ERROR:db_mysql:db_mysql_new_connection: driver error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Jun 26 06:16:00 test-ser /sbin/kamailio[20217]: ERROR:core:db_do_init: could not add connection to the pool Jun 26 06:16:00 test-ser /sbin/kamailio[20217]: ERROR:sqlops:sql_connect: failed to connect to the database [pridb] Jun 26 06:16:00 test-ser /sbin/kamailio[20217]: ERROR:core:init_mod_child: failed to initializing module sqlops, rank 1 Jun 26 06:16:00 test-ser /sbin/kamailio[20217]: ERROR:core:main_loop: init_child failed for UDP listener
What is the proper way of using multiple database servers with Kamailio?
Thanks in advance.
--JR
On Dienstag, 30. Juni 2009, logivoip@gmail.com wrote:
I have configured two redundant DB sources in my kamailio confiuration. The DB's are accessed from Kamailio for redundancy pruposes. Kamailio and the primary DB are on the same hardware node. The secondary DB is on a remote host. If Kamailio is up and both MySQL DB's are up, the config works like a charm. If the primary or the secondary DB becomes unreachable while Kamailio is up, the config handles the exception and all works well.
Hi JR,
ok, fine so far.
However, if any of the DB servers becomes unreachable and Kamailio is restarted, Kamailio can no longer start. [..]
It seems that the module want to check if its can reach all configured databases during startup. This is probably required just to make sure that the user did not make a mistake in the configuration, the DBs are reachable and so on.
What is the proper way of using multiple database servers with Kamailio?
May i ask what kind of functionality you miss? I'd think that you need at least one DB during startup for the server, to be used from sqlops. One possibility would be to add later a new connection to the module, for example with a FIFO command when it gets available, but this is not implemented at the moment.
Instead of handling the outage of DBs in the kamailio server another option would be to implement a failover setup (heartbeat+drdb for example) on the DB level, or use a clustering solution (e.g. mysql cluster).
Henning