[Users] Mysql reconnect problem

Dimo begeragus at gmail.com
Wed Dec 20 10:55:14 CET 2006


Well that is just it,
with hot reconnect I would not need a restart to make it work once the
db is up. The openser will start working as soon as the db comes up,
keeping the time between db server comming online and openser becoming
operational minimal (no startup time and retry timeouts).
Maybe i don't understand well the hot reconnect principle but that is
how i imagined it.

Anyway it is just an idea, not so critical and ofcource can be done in
external monitoring program. I was just wondering if anyone else would
find it useful.

Best,
Dimo

On 12/19/06, samuel <samu60 at gmail.com> wrote:
> I don't understant why would you start an openser server that requires
> database information without this information. Isn't it better to have
> some aplication testing the database and restarting openser so when it
> starts it can work??
>
> Samuel.
>
> 2006/12/19, Dimo <begeragus at gmail.com>:
> > Thanks Christian,
> > I believe this will be very useful. We already use monit for other
> > tasks so it makes sense.
> >
> > I just want to get some opinions if it will be useful for others if
> > this was implemented in the openser logic also. Maybe a config
> > parameter saying "ignore db connection errors on startup", so people
> > can decide whether they want this behavior or prefer openser to die
> > upon no db.
> >
> > Best,
> > Dimo
> >
> >
> > On 12/18/06, Christian Schlatter <cs at unc.edu> wrote:
> > > Dimo wrote:
> > > > Hi,
> > > > It works great, thanks!
> > > >
> > > > Now that there is hot reconnect is there a possiblity to make ser
> > > > start without a database running? I am thinking about a scenario where
> > > > there is a network loss and my redundant opensers are restarting and
> > > > the database is restarting too but with some lag. In this scenario at
> > > > the moment of openser starting, the db is unavailable but it comes up
> > > > in 1-2 seconds after that. I guess hot reconnect will make things work
> > > > so there will not be the need to have the database online at the
> > > > moment of starting openser.
> > > > At present i cannot make ser start if there is a module requiring a db
> > > > and the db server is down.
> > >
> > > I had the same issue and solved it by using one of those process
> > > monitoring tools. In particular I'm using the monit tool that tries to
> > > start the openser process(es) several times at a given interval. So if
> > > for some reason the DB, in my case mysql-cluster, is not ready, monit
> > > will wait a minute and try to start openser again. After a complete
> > > cluster shutdown it normally takes quite a while for the cluster to come
> > > up again.
> > >
> > > This is how my monitrc looks like:
> > >
> > > set logfile syslog facility log_daemon
> > >
> > > set httpd port 888
> > >          ssl enable
> > >          pemfile /etc/monit/monit.pem
> > >          allow rtc:"xxx"
> > >
> > > check process openser with pidfile /var/run/openser/openser.pid
> > >          start program = "/etc/init.d/openser start"
> > >          stop program = "/etc/init.d/openser stop"
> > >          if 3 restarts within 4 cycles then timeout
> > >          group sipserver
> > >
> > > check process mediaproxy with pidfile /var/run/mediaproxy.pid
> > >          start program = "/etc/init.d/mediaproxy start"
> > >          stop program = "/etc/init.d/mediaproxy stop"
> > >          if 3 restarts within 4 cycles then timeout
> > >          group sipserver
> > >
> > > check process ami_proxy with pidfile /var/run/ami_proxy.pl.pid
> > >          start program = "/etc/init.d/ami_proxy start"
> > >          stop program = "/etc/init.d/ami_proxy stop"
> > >          if 3 restarts within 4 cycles then timeout
> > >          group sipserver
> > >
> > > check process mysqld with pidfile /var/run/mysqld/mysqld.pid
> > >          group database
> > >
> > >
> > > - Christian
> > >
> > >
> > > >
> > > > Best,
> > > > Dimo
> > > >
> > > >
> > > >
> > > > On 12/12/06, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
> > > >> Hi Dimo,
> > > >>
> > > >> yes, there is a mechanism for hot reconnect to the mysql server. By
> > > >> default it is turned on.
> > > >> see:
> > > >>     http://www.openser.org/docs/modules/1.2.x/mysql.html#AEN68
> > > >>
> > > >> regards,
> > > >> bogdan
> > > >>
> > > >> Dimo wrote:
> > > >>
> > > >> > Hi All,
> > > >> > I have a problem with openser reconnecting to my redundant mysql
> > > >> > servers which hold the openser database.
> > > >> >
> > > >> > The database servers are in a cluster and if one fails the other takes
> > > >> > over its IP address.
> > > >> > In openser however the connection to the database is established only
> > > >> > (i think) at the beginning.
> > > >> > So when openser is running and one of my sql servers drops, and the
> > > >> > other takes over the IP, i  get an error in openser saying that the
> > > >> > mysql connection does not exist.
> > > >> >
> > > >> > Is there a way to make openser reconnect to mysql automatically
> > > >> > without restarting it or some other way I can make this work?
> > > >> >
> > > >> > Best,
> > > >> > Dimo
> > > >> >
> > > >> > _______________________________________________
> > > >> > Users mailing list
> > > >> > Users at openser.org
> > > >> > http://openser.org/cgi-bin/mailman/listinfo/users
> > > >> >
> > > >>
> > > >>
> > > >
> > > > _______________________________________________
> > > > Users mailing list
> > > > Users at openser.org
> > > > http://openser.org/cgi-bin/mailman/listinfo/users
> > >
> > >
> > >
> > >
> >
> > _______________________________________________
> > Users mailing list
> > Users at openser.org
> > http://openser.org/cgi-bin/mailman/listinfo/users
> >
>




More information about the sr-users mailing list