Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ?
Can Kamailio do loadbalancing between 2 mysql servers which are duplicate ?
Thank you
François BERGANZ
Hello,
On 1/21/10 4:38 PM, BERGANZ François wrote:
Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ?
kamailio does auto-reconnect if the connection is dropped for some reason, e.g., if you restart mysql everything should go on normally when it is back again.
What i do for redundancy is using two replicated mysql servers with shared ip, so when one is down the other takes on the ip and kamailio (re)connects automatically to backup server.
Can Kamailio do loadbalancing between 2 mysql servers which are duplicate ?
For that is maybe better to use the solution developed by mysql specialists, the mysql proxy: http://forge.mysql.com/wiki/MySQL_Proxy
Cheers, Daniel
On 01/21/2010 10:48 AM, Daniel-Constantin Mierla wrote:
Hello,
On 1/21/10 4:38 PM, BERGANZ François wrote:
Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ?
kamailio does auto-reconnect if the connection is dropped for some reason, e.g., if you restart mysql everything should go on normally when it is back again.
I wish the PostgreSQL module did this. It does not.
On 1/21/10 4:53 PM, Alex Balashov wrote:
On 01/21/2010 10:48 AM, Daniel-Constantin Mierla wrote:
Hello,
On 1/21/10 4:38 PM, BERGANZ François wrote:
Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ?
kamailio does auto-reconnect if the connection is dropped for some reason, e.g., if you restart mysql everything should go on normally when it is back again.
I wish the PostgreSQL module did this. It does not.
does it need one? I heard pg fans telling it is rock solid :-)
3.0.0 has this option on the db driver side coming from ser, should be easy to port to k to get it for k modules ... just search for pg_retries in the sources of db_postgress.
Cheers, Daniel
On 01/21/2010 11:09 AM, Daniel-Constantin Mierla wrote:
does it need one? I heard pg fans telling it is rock solid :-)
It is true; it is not necessary for this reason. :-) But sometimes the database must be restarted for administrative purposes.
3.0.0 has this option on the db driver side coming from ser, should be easy to port to k to get it for k modules ... just search for pg_retries in the sources of db_postgress.
http://www.kamailio.org/docs/modules/3.0.x/modules/db_postgres.html
404 Not Found? Adonde se marchó esta página?
Are you saying db_postgres is the module from SER now, not the Kamailio one? Or do I have to use some special other module from modules_s to have this functionality?
On 1/21/10 5:14 PM, Alex Balashov wrote:
On 01/21/2010 11:09 AM, Daniel-Constantin Mierla wrote:
does it need one? I heard pg fans telling it is rock solid :-)
It is true; it is not necessary for this reason. :-) But sometimes the database must be restarted for administrative purposes.
restarted?!?! no reload?
3.0.0 has this option on the db driver side coming from ser, should be easy to port to k to get it for k modules ... just search for pg_retries in the sources of db_postgress.
http://www.kamailio.org/docs/modules/3.0.x/modules/db_postgres.html
404 Not Found? Adonde se marchó esta página?
yep, something strange with this module -- the doc folder is actually named km_doc and therefore the online readme is not created. I did it manually for now, however no much information there.
Are you saying db_postgres is the module from SER now, not the Kamailio one? Or do I have to use some special other module from modules_s to have this functionality?
There is only one db_postgres module, but SIP Router (therefore K 3.0 and SR 3.0) provides two database APIs: - srdb1 - based in intial ser version with some improvements done in K project - srdb2 - newer, implemented for ser 2.0 afaik
srdb2 is better from some aspects, being not sql-centric, but more like get/put interface, supporting as well prepared statements. Therefore is the recommended one for new development, probably several k modules will be updated in the near future.
The good part is that you can have both at the same time, and even better, there are some db modules implementing both, like mysql and postgress (the db modules from "modules/"). If you use these, then you can mix any k or s modules.
Cheers, Daniel
El Jueves, 21 de Enero de 2010, BERGANZ François escribió:
Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ?
Can Kamailio do loadbalancing between 2 mysql servers which are duplicate ?
You could just a MySQL proxy with such capability.
21 jan 2010 kl. 16.38 skrev BERGANZ François:
Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ? Can Kamailio do loadbalancing between 2 mysql servers which are duplicate ?
I've been using mysql proxy for that and it worked fine with kamailio.
/O
El Jueves, 21 de Enero de 2010, Olle E. Johansson escribió:
21 jan 2010 kl. 16.38 skrev BERGANZ François:
Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ? Can Kamailio do loadbalancing between 2 mysql servers which are duplicate ?
I've been using mysql proxy for that and it worked fine with kamailio.
Does such mysql proxy allow prepared statements? They are stored in the server, this is, when the MySQL client connects it creates the prepared statements in the MySQL server. If the MySQL servers restarts it looses the prepared statements so the client must react and re-create them. But in the case of a mysql proxy this task should take place in the proxy itself, right? Do mysql proxy implement it?
Regards.
Iñaki,
On 01/21/2010 04:23 PM, Iñaki Baz Castillo wrote:
Does such mysql proxy allow prepared statements? They are stored in the server, this is, when the MySQL client connects it creates the prepared statements in the MySQL server. If the MySQL servers restarts it looses the prepared statements so the client must react and re-create them. But in the case of a mysql proxy this task should take place in the proxy itself, right? Do mysql proxy implement it?
My understanding is that MySQL proxy is a "low-level" proxy that plumbs data interchange via MySQL's internal binary protocol, not a higher-level representation of the RDBM backend's interface.
It is also my understanding that it creates "sticky" sessions to whatever MySQL server is being interacted with. The meaning of "load balancing" is not that every query or statement is executed on a different server. But I could be wrong.
Cheers,
-- Alex
El Jueves, 21 de Enero de 2010, Alex Balashov escribió:
Iñaki,
On 01/21/2010 04:23 PM, Iñaki Baz Castillo wrote:
Does such mysql proxy allow prepared statements? They are stored in the server, this is, when the MySQL client connects it creates the prepared statements in the MySQL server. If the MySQL servers restarts it looses the prepared statements so the client must react and re-create them. But in the case of a mysql proxy this task should take place in the proxy itself, right? Do mysql proxy implement it?
My understanding is that MySQL proxy is a "low-level" proxy that plumbs data interchange via MySQL's internal binary protocol, not a higher-level representation of the RDBM backend's interface.
The problem is that if MySQL restarts, the client will not realize of it since the client is connected (via TCP or UNIX Socket) to the MySQL proxy, so next query of the client using prepared statements woudl fail as it would invoke a prepared statement that doesn't exist in the server. This is, I expect that the MySQL proxy behaves like a client, more like a M2MUA (MySQL To MySQL User Agent) XDDDDD
It is also my understanding that it creates "sticky" sessions to whatever MySQL server is being interacted with. The meaning of "load balancing" is not that every query or statement is executed on a different server. But I could be wrong.
Humm, not sure about it. When I read about these MySQL proxy some months ago, I remember they can dispath queries to different servers based on the query type (SELECT, INSERt, UPDATE...).
On 01/21/2010 06:37 PM, Iñaki Baz Castillo wrote:
This is, I expect that the MySQL proxy behaves like a client, more like a M2MUA (MySQL To MySQL User Agent) XDDDDD
Ha, ha! Nice. :D
21 jan 2010 kl. 22.23 skrev Iñaki Baz Castillo:
El Jueves, 21 de Enero de 2010, Olle E. Johansson escribió:
21 jan 2010 kl. 16.38 skrev BERGANZ François:
Hello,
I need to know if Kamailio can change Mysql Server if there is a problem with a mysql server ? Can Kamailio do loadbalancing between 2 mysql servers which are duplicate ?
I've been using mysql proxy for that and it worked fine with kamailio.
Does such mysql proxy allow prepared statements? They are stored in the server, this is, when the MySQL client connects it creates the prepared statements in the MySQL server. If the MySQL servers restarts it looses the prepared statements so the client must react and re-create them. But in the case of a mysql proxy this task should take place in the proxy itself, right? Do mysql proxy implement it?
I've never used prepared statements, so I don't know.
The mysql proxy has support for LUA, so with a bit of hacking you can do whatever you want, but I just used the transparent proxy part.
I would suggest that you make sure that the mysql server that is restarted gets the prepared statements before you open it for access from the outside world. I created scripts that stopped access until we knew that a restarted server was in sync with the replication with the rest of the world, which is more or less the same situation.
/O
El Jueves, 21 de Enero de 2010, Olle E. Johansson escribió:
I would suggest that you make sure that the mysql server that is restarted gets the prepared statements before you open it for access from the outside world.
This is not possible. A prepared statement is created by a DB client once per connection. This is: is 4 different clients use the same prepared statements against the same MySQL server, all of them must declare all the prepared statements in their specific connection to the database.
22 jan 2010 kl. 00.33 skrev Iñaki Baz Castillo:
El Jueves, 21 de Enero de 2010, Olle E. Johansson escribió:
I would suggest that you make sure that the mysql server that is restarted gets the prepared statements before you open it for access from the outside world.
This is not possible. A prepared statement is created by a DB client once per connection. This is: is 4 different clients use the same prepared statements against the same MySQL server, all of them must declare all the prepared statements in their specific connection to the database.
You see, I did not know. Then LUA is your best friend. The proxy will hide the fact that it's a new connection to your application, so the proxy in itself needs to take care of it.
/O
I understand all solutions. But for the mysql proxy, we need another server... but if the proxy is down, it is the same problem in fact!
François BERGANZ
-----Message d'origine----- De : users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] De la part de Olle E. Johansson Envoyé : vendredi 22 janvier 2010 08:19 À : Iñaki Baz Castillo Cc : users@lists.kamailio.org Objet : Re: [Kamailio-Users] mysql loadbalancing
22 jan 2010 kl. 00.33 skrev Iñaki Baz Castillo:
El Jueves, 21 de Enero de 2010, Olle E. Johansson escribió:
I would suggest that you make sure that the mysql server that is restarted gets the prepared statements before you open it for access from the outside world.
This is not possible. A prepared statement is created by a DB client once per connection. This is: is 4 different clients use the same prepared statements against the same MySQL server, all of them must declare all the prepared statements in their specific connection to the
database.
You see, I did not know. Then LUA is your best friend. The proxy will hide the fact that it's a new connection to your application, so the proxy in itself needs to take care of it.
/O _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
El Viernes, 22 de Enero de 2010, BERGANZ François escribió:
I understand all solutions. But for the mysql proxy, we need another server... but if the proxy is down, it is the same problem in fact!
Well, I expect that such MySQL proxy could run in same host as Kamailio.
Ah, but alas, not all problems can be solved, or, for that matter, are necessarily worth solving as dictated by the Pareto Principle.
-- Sent from mobile device
On Jan 22, 2010, at 2:38 AM, BERGANZ François <francois@acropolistelecom.ne t> wrote:
I understand all solutions. But for the mysql proxy, we need another server... but if the proxy is down, it is the same problem in fact!
François BERGANZ
-----Message d'origine----- De : users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] De la part de Olle E. Johansson Envoyé : vendredi 22 janvier 2010 08:19 À : Iñaki Baz Castillo Cc : users@lists.kamailio.org Objet : Re: [Kamailio-Users] mysql loadbalancing
22 jan 2010 kl. 00.33 skrev Iñaki Baz Castillo:
El Jueves, 21 de Enero de 2010, Olle E. Johansson escribió:
I would suggest that you make sure that the mysql server that is restarted gets the prepared statements before you open it for access from the outside world.
This is not possible. A prepared statement is created by a DB client once per connection. This is: is 4 different clients use the same prepared statements against the same MySQL server, all of them must declare all the prepared statements in their specific connection to the
database.
You see, I did not know. Then LUA is your best friend. The proxy will hide the fact that it's a new connection to your application, so the proxy in itself needs to take care of it.
/O _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users