6 Replies Latest reply on Sep 29, 2011 2:38 PM by wdfink

    Changing the default datasource for cluster members.

    alexjfisher

      Hi

       

      I understand that the default datasource should not be HSQLDB and this must be changed to something like MySQL or postgres.  When setting up a cluster, should each node have its own local default datasource, or can/should all nodes share a common database on an external server?

       

      In the case of JMS, I have already created a new datasource called JMSDS that is shared between all cluster nodes.  I'm just confused as to what should happen with all the other built-in services that still reference the defaultDS.

       

      I've currently got 4 nodes setup, and if it makes any difference, these are actually configured as 2 clusters of 2 nodes - a recommendation I picked up whilst watching a mod_cluster webinar.  These all share the same JMS persistence database and nothing bad has happened during testing (ie nodes from cluster B don't pick up messages persisted by cluster A).

       

      Many thanks,

      Alex

        • 1. Re: Changing the default datasource for cluster members.
          wdfink

          The cluster nodes should use the same database (for application), otherwise you will have some funny results.

          => calls are spread over the cluster but each node contain other data, e.g. you create a person one node1 and try to get it on node2 (in this database nothing will be known about)

          So you will have very fuzzy effects

           

          Ok, JBossMessaging must use the same DB, the messages are handled with the PostOfficeId of each node for distribution and failover.

           

          One special thing will be the timer service. If you share the same database the timer might fired on each node.

          To avoid this you have to configure the TableName of the ejb-timer different for each node.

          And for me the timer is the only one (except the application) that use the DefaultDS, but I removed some services.

          A simple way to check is to remove the default-ds.xml and check the errors during startup.

          1 of 1 people found this helpful
          • 2. Re: Changing the default datasource for cluster members.
            alexjfisher

            Thanks for your help.

             

            Our application already has it's own datasource pointing to a shared external db.

             

            So, in conclusion, I can use a shared database for the remaining services that depend on defaultDS, but I'll have to tweak the timer service to use a different table name on each node.  From a performance and reliability point of view, might I be better off keeping the defaultDS local?

             

            Many thanks,

            Alex

            • 3. Re: Changing the default datasource for cluster members.
              wdfink

              I don't know exactly.

              But in the past the HSQLDB make sometime trouble and error messages. So I decide to remove it also in test environment because it will be easier to check the database during runtime.

              And because of this I don't know about the performance of HSQLDB.

               

              But do you use the timer excessive? If not the problem will be theoretical

              • 4. Re: Changing the default datasource for cluster members.
                alexjfisher

                I was actually thinking about using local mysql databases.  localhost mysql for the defaultDS, but the application and JBoss messaging each having their own datasource using external DBs.

                 

                Kind Regards,

                Alex

                • 5. Re: Changing the default datasource for cluster members.
                  rhusar

                  Right Alex,  you want to share your database with all JBoss instances so that messaging can use clustered queue and get all failover (HA) and load-balancing features. Otherwise your messages would have to be received only from that one node where they were sent. What do you actually want to keep in your local HSQLDB?

                  • 6. Re: Changing the default datasource for cluster members.
                    wdfink

                    I'm not sure, but I think the overhead of an extra database per node is not necessary because you will not win a lot of performance benefit.