1 2 3 Previous Next 30 Replies Latest reply: Mar 3, 2012 5:26 AM by Wolf-Dieter Fink RSS

clustering, first approach

Newbie

i have read the clustering jboss 5.1 manual.

i don't understand how the database works inside the cluster: i know it must be a shared DB and unique. But where it is located and how every node can access to it? In my mind i think about a DB inside every folder .../jboss/server/node-nth ( every one a copy of the /all server ) and every access for the n-th node is done towards his own DB.

do i need to set any property to work correctly?

 

Thank you.

  • 1. clustering, first approach
    Wolf-Dieter Fink Master

    A DB is, in most cases, a RDBMS e.g. Oracle, MySQL ....

    You persist data from each JBoss application to this DB. Each instance of the cluster must have the same *-ds.xml configuration for this application to have the same data.

     

    If you use a local database (or a DB instance for each JBoss) your clustered application will produce some funny results because of the different underlying data.

  • 2. clustering, first approach
    Newbie

    I read in the guide about a file name something like "hsql-ds.xml".

     

    However i'm using the defualt jboss DB, hypersonic, without modifying a single thing. Can i suppose to work properly without configuring any file? And where i can find this -ds.xml config file inside my jboos_distr path?

     

    thk u

  • 3. clustering, first approach
    Wolf-Dieter Fink Master

    You're right,

    the hypersonicDB is configured with hsql-ds.xml (see .../deploy) AND it is a local database, but you should never use it in a productional environment !!

    If you start a production system you should replace the hsqldb with mysql, oracle or what you want, for example configuration see docs/examples/jca.

     

    By default only the ejb-timer and JMS (up to JBoss5) will use the DefaultDS (hsql-ds), you might replace the hsql-ds.xml with a xxx-ds.xml and use the DefaultDS JNDI name or you change the DefaultDS name within the JBoss configuration.

     

    You will find descriptions for this within the JBoss wiki pages.

  • 4. clustering, first approach
    Newbie

    i'm actually using JBOSS 6 and it doesn't contain that file; anyway i'm reading a JBOSS 5 guide because i can't find a 6 one.

    ...and i'm developing a project for my course of study, so it's ok to use the default hypersonic. I want to keep things simple.

     

    I hope everything is ok as it is now.

  • 5. clustering, first approach
    Wolf-Dieter Fink Master

    Sorry, the hsql connector is defined in .../server/default/deploy/hsqldb-ds.xml

     

    I change it because for me mysql (or other RDBMS) is better to use and to look into during JBoss is started.

    Also it is easier if you try to have a cluster.

     

    So it is very easy to change DefaultDS, only replace the hsqldb-ds.xml with one of the examples and adapt it to your DB isntallation.

     

    If you don't worry about the restrictions of HSQLDB it should be ok to stay with it

  • 6. Re: clustering, first approach
    Newbie

    Sorry for bothering more, but i'm really stucked!!!

     

    I'm building a cluster, or better, i'm trying following this guide: http://docs.jboss.org/jbossclustering/cluster_guide/5.1/html/clustering-intro.chapt.html#clustering-quickstart ( but using jboss 6 ).

     

    I got errors when run -c node1

    • -b 192.168.0.101 ( can't use this or others ip, only the default ip that is 127.0.0.1 or subsequently; i don't understand why )
    • -Djboss.messaging.ServerPeerID=1 ( i get a warn starting up a second node in my cluster:

    "There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if

    a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node."

    So it seems that configuring the ID means nothing for my cluster ).

     

    Anyway using -b 127.0.0.1 and 127.0.0.2 and different IDs for 2 nodes don't solve my "same node id" problem! Both my nodes are a copy of the /all folder ( server ), named "node1" and "node2". So i tryed changing the ports instead of the ID ( also if I would prefer to set IP address for every node in my cluster rather than ports ) but i didn't solved the problem.

     

    I will paste the console output for the first and the second node running them using the 3rd method in the guide, same IP: Scenario 3: Two Nodes on a Single, Non-Multihomed, Server

     

     

     

     

    FIRST NODE:

     

    C:\JBoss_releases\jboss-6.0.0.Final\bin>run -c node1 -D jboss.messaging.ServerPeerID=1 -D jboss.service.binding.set=ports-default

     

    15:07:33,685 INFO  [JMXConnector] starting JMXConnector on host 127.0.0.1:1090

     

    15:07:36,670 INFO  [WebService] Using RMI server codebase: http://127.0.0.1:8083/

    15:07:36,694 INFO  [ClusterPartition] Initializing partition DefaultPartition

    15:07:37,202 INFO  [JGroupsTransport] Starting JGroups Channel

    15:07:37,255 INFO  [JChannel] JGroups version: 2.11.0.GA

    15:07:37,581 WARN  [Configurator] UDP property timer.num_threads was deprecated and is ignored

    15:07:38,006 INFO  [STDOUT]

    15:07:38,008 INFO  [STDOUT] -------------------------------------------------------------------

    15:07:38,010 INFO  [STDOUT] GMS: address=127.0.0.1:1099, cluster=DefaultPartition-HAPartition, physical address=127.0.0.1:55200

    15:07:38,011 INFO  [STDOUT] -------------------------------------------------------------------

     

    15:07:40,224 INFO  [HANamingService] Started HAJNDI bootstrap; jnpPort=1100, backlog=50, bindAddress=/127.0.0.1

    15:07:40,274 INFO  [DetachedHANamingService$AutomaticDiscovery] Listening on /127.0.0.1:1102, group=230.0.0.4, HA-JNDI address=127.0.0.1:1100

     

    15:07:41,331 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:

    15:07:42,244 INFO  [QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v1.8.3) 'JBossQuartzScheduler' with instanceId 'NON_CLUSTERED'

      Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.

      NOT STARTED.

      Currently in standby mode.

      Number of jobs executed: 0

      Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.

      Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

     

    15:07:42,244 INFO  [StdSchedulerFactory] Quartz scheduler 'JBossQuartzScheduler' initialized from an externally opened InputStream.

    15:07:42,245 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.8.3

    15:07:42,246 INFO  [QuartzScheduler] Scheduler JBossQuartzScheduler_$_NON_CLUSTERED started.

    15:07:42,701 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'

     

    15:07:43,983 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 32s:276ms

     

     

    15:09:32,309 INFO  [org.jboss.ha.framework.server.ClusterPartition.lifecycle.DefaultPartition] New cluster view for partition DefaultPartition (id: 1, delta: 1, merge: false) : [127.0.0.1:1099, 127.0.0.1:1199]

    15:09:32,311 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] Received new cluster view: [127.0.0.1:1099|1] [127.0.0.1:1099, 127.0.0.1:1199]

    15:09:32,312 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.DefaultPartition] I am (127.0.0.1:1099) received membershipChanged event:

    15:09:32,313 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.DefaultPartition] Dead members: 0 ([])

    15:09:32,315 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.DefaultPartition] New Members : 1 ([127.0.0.1:1199])

    15:09:32,316 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.DefaultPartition] All Members : 2 ([127.0.0.1:1099, 127.0.0.1:1199])

    15:09:35,698 WARN  [org.hornetq.core.cluster.impl.DiscoveryGroupImpl] There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node.

     

     

     

    SECOND NODE:

     

    C:\JBoss_releases\jboss-6.0.0.Final\bin>run -c node2 -D jboss.messaging.ServerPeerId=2 -D jboss.service.binding.set=ports-01


    15:09:32,146 INFO  [STDOUT] -------------------------------------------------------------------

    15:09:32,147 INFO  [STDOUT] GMS: address=127.0.0.1:1199, cluster=DefaultPartition-HAPartition, physical address=127.0.0.1:55300

    15:09:32,149 INFO  [STDOUT] -------------------------------------------------------------------

     

    15:09:32,902 ERROR [AbstractKernelController] Error installing to Start: name=HAJNDI state=Create: java.rmi.server.ExportException: Port already in use: 1201; nested exception is:

            java.net.BindException: Address already in use: JVM_Bind

         

    Caused by: java.net.BindException: Address already in use: JVM_Bind

     

    15:09:33,822 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:


    15:09:34,863 INFO  [QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v1.8.3) 'JBossQuartzScheduler' with instanceId 'NON_CLUSTERED'

      Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.

      NOT STARTED.

      Currently in standby mode.

      Number of jobs executed: 0

      Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.

      Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

     

    15:09:34,864 INFO  [StdSchedulerFactory] Quartz scheduler 'JBossQuartzScheduler' initialized from an externally opened InputStream.

    15:09:34,865 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.8.3

    15:09:34,866 INFO  [QuartzScheduler] Scheduler JBossQuartzScheduler_$_NON_CLUSTERED started.

    15:09:35,325 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'

     

    15:09:36,415 WARN  [org.hornetq.core.cluster.impl.DiscoveryGroupImpl] There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node.


    15:09:36,575 ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

     

    DEPLOYMENTS IN ERROR:

      Deployment "HAJNDI" is in error due to the following reason(s): java.net.BindException: Address already in use: JVM_Bind

     

     

    This way my cluster is alive but if i try to connect via Browser to node 1 and node 2 i get two different session that shares some datas ( inconsistency problems!!! ) stored in session memory and they can't see at all the DB modifications done through the other node.


    My target is to run my ear project in a cluster composed of 4 nodes ( with different IPs, like 192.168.1.101 - 102 - 103 - 104 ) and test if it works fine during node crash ( sessions replication, shared DB, ... ).

     

    I wonder also if it's necessary to use a load balancer: i tryed to use apache + mod_jk following the same guide, cap 8 ( http://docs.jboss.org/jbossclustering/cluster_guide/5.1/html/clustering-http.html#clustering-http-modjk ). But if yesterday the apache 2.2 service started, today it doesn't start at all! I tryed to restart win7, shut down an other software that uses port 80, uninstall and reinstall apache with the  single user conf ( port 8080 ), change the port in the conf file to 85, ....There's no way! error code 1 during service start.

     

    thank you a lot for the help

  • 7. Re: clustering, first approach
    Wolf-Dieter Fink Master

    Hi,

    first of all, please avoid posting of logfiles. You should attach it (pls. edit your previous post to avoid scroll hell )

     

    The bind problem looks like that you have a second (third) running instance with ports-01 setting.

     

    The different IP's must be configured within the IP-Properties of the networkadapter, you must use the extended properties button.

    I think it will  not work if you have DNS activated.

  • 8. Re: clustering, first approach
    Newbie

    the post has been updated, with some new amazing things!!! pls read it again.

     

    i'm sure i have only the 2 istance running.

     

    ...and i totaly don't get what to do when you say: "The different IP's must be configured within the IP-Properties of the networkadapter, you must use the extended properties button."

  • 9. Re: clustering, first approach
    Wolf-Dieter Fink Master

    What about if you start node2 first???

     

    The '-D jboss.messaging.ServerPeerId' is for JBoss5, I forgot that you use 6 let me have a short look ...

     

    The different IP's you have to configure Windows for this.

    Open the Network Dialog for your Networkadapter, look for IPv4 open the 'Properties' dialog klick the 'Advanced' button and configure aditional (virtual) IP addresses for this interface.

    After that the -b parameter should work for these addresses.

  • 10. Re: clustering, first approach
    Wolf-Dieter Fink Master

    I think there is a configuration in deploy/hornertq/hornetq-configuration.xml for this, but I'm not sure.

    The message points to some broadcast address, maybe the broadcast-groupname but as I say I'm not sure.

     

    Maybe an other community member know the answer

  • 11. Re: clustering, first approach
    Newbie

    I can try with Jboss 5.1.0 if you think it's easier to start the cluster.

  • 12. Re: clustering, first approach
    Wolf-Dieter Fink Master

    It's not easier but I suppose there is more knowlege by me and other community members

     

    Other option is to remove hornetQ from deployment if you do not use JMS.

  • 13. Re: clustering, first approach
    Newbie

    downloaded Jboss 5.1

    tryed to launch the cluster following the guide without modify anything that the guide doesn't say -> FAIL!!!

     

    so what's the problem? at this point i think it can't be Jboss or the guide that don't work and if i'm not wrong the only other element involved in running Jboss is the Virtual machine.

     

    So i guess there's something missing in my JVM config...but i really don't know if i need, and how, to config JVM to run Jboss cluster.

  • 14. Re: clustering, first approach
    Wolf-Dieter Fink Master

    Could you post the boot.log and server.log of both instances?

    If you start the jboss without any change it should work. Did you try this?

1 2 3 Previous Next