Menu

Liferay 6.1 / MySQL / HA-JDBC

Help
dbrondy
2013-01-06
2013-01-16
  • dbrondy

    dbrondy - 2013-01-06

    Hello Paul,

    We are trying to setup a two liferay / MySQL servers configuration using HA-JDBC to replicate data (simple fault tolerant architecture). We have two servers, each one running Tomcat 7 + liferay 6.1 CE GA2 and a standalone MySQL server (INNODB) containing the "liferay" database and the "jcr" jackrabbit JSR content database.
    HA-JDBC has been configured such a way that by default each liferay portal access its own server (balancing with prefered weight for each server). We are using the last stable version of HA-JDBC, the one with the old configuration grammar (as the 2.1 seems in beta version).
    It's more or less running well but we are facing some strange things:
    - when the two MySQL servers are up, a liferay portal instance starts perfectly and we can see the eventual alignment done by HA-JDBC, however, when we stop one MySQL instance, the liferay portal is no more running. The http requests hang, and we have to restart the liferay portal.
    - when restarting in degraded mode (only one MySQL instance), the liferay portal is very very long to perform queries..
    - finally, we didn't succeed in configuring the JGroups part of HA-JDBC, we are facing some Exceptions linked to the stack format (old/new version) that is used...

    I'm currently at home, but tomorrow, I will try to provide you better traces and configuration files as I understand my problem really needs some files to be joined ;-)

    Anyway, I was wondering if you already heard about people using HA-JDBC in such Liferay architecture ? We don't want something very complicated with clustered db or something more heavy. The principle of HA-JDBC really seems easy and sufficient for our first use.

    Tks for you feedback,
    Happy new year,
    denis

     

    Last edit: dbrondy 2013-01-06
  • Paul Ferraro

    Paul Ferraro - 2013-01-07

    I don't know of anybody specifically using HA-JDBC w/Liferay, but from HA-JDBC's perspective, the use case is not unique. The key points to consider:
    How does Liferay generate unique IDs? Does it use MySQL identity columns? Be aware that support for this in HA-JDBC is expensive in distributable mode. HA-JDBC acquires distributed exclusive locks per table for each insert statement. Effectively, only 1 writer thread per cluster can insert into a given table at a time. Competing threads will wait. The implementation of this is flawed in 2.0.x (it would result in deadlocked threads), and was improved dramatically in 2.1.
    How does Liferay configure connection pooling? I'm assuming it uses a pool of HA-JDBC connections. How does it validate connections from the pool?
    * You eventually need to get distributable mode working - as your use case will not function correctly without it - and can lead to out of sync databases.

    As far as why your portal server hangs when you stop one of your databases, I suspect the connection pooling configuration is to blame. Fortunately, liferay is open source, so we should be able to determine why its hanging. The connections returned by the pool should always be HA-JDBC connections - and consequently should never be invalid. I'd have to see what its failure detection mechanism is doing.

    As far as which HA-JDBC version to use, I would recommend 2.1. Yes, it's in beta, but that's mostly because I have a couple more features to add before I move to a release candidate. At this point, it should be at least as stable as 2.0.x. Personally, I don't have the time to maintain the aged 2.0.x branch any longer.

     
  • dbrondy

    dbrondy - 2013-01-13

    Hello Paul,
    Sorry for the late replay but many thanks for your advised answer.

    I'm currently updating to the 2.1 beta3 version. It is not working now but.. I'm getting an error that states "no driver found". I configured the ha-jdbc driver in the tomcat context and referenced it in the portal-ext properties file of liferay (xxx.jndi.name). I think I've something to configure (JPA ?) or somethings else (I'm quite newbie with Tomcat/spring/hibernate) because I found this kind of error on google and even on this forum. I will try to figure out what is the problem. However, ha-jdbc works for the jackrabbit JSR API, only the connection to liferay database are not ready for now. So it's quite ready.

    I will keep you informed about the results.
    Thanks again for your support and congratulations for ha-jdbc, we really like the principle.

    denis

     
  • Paul Ferraro

    Paul Ferraro - 2013-01-16

    I'd be happy to help you debug the liferay connectivity, but I'll need detailed stack traces first.
    Let me know if you encounter any other issues.

     

Log in to post a comment.