6 Replies Latest reply on Jul 6, 2016 4:20 PM by sukesh r

    Multiple Domain Controlers with single JBoss(EAP 6.4.5) Installation

    sukesh r Newbie

      Hello,

       

      Is there a way to create multiple domain controllers with single JBoss installation, reason is we have two applications using same domain.xml and when ever we do app server config( adding JDBC resources, MQ resources) we need to bounce the complete domain.

      In this case the other application is getting effected, to avoid this we thought if we have multiple domain controllers with single installations( we tested backup domain controller option with separate installation successfully).

       

      OS: Red Hat Enterprise Linux Server release 6.7 (Santiago)

      JBoss: EAP 6.4.5 GA

      I followed below steps to create multiple domain controllers:

       

      1). copied complete domain folder and renamed it to domain1

      2). under JBOSS_HOME/bin directory , created another set of domain1.conf and domain1.sh

           changed JBOSS_LOG_DIR, JBOSS_BASE_DIR, JBOSS_CONF_DIR references

           changed management port to  29999

           changed native http port to 29990

      3). Tried to start domain controller with below command:

           ./domain1.sh --domain-config=/apps/jboss/jboss-eap-6.4.0/domain1/configuration/domain.xml --host-config=/apps/jboss/jboss-eap-6.4.0/domain1/configuration/host

         and getting below error.

        15:31:17,711 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.7.Final-redhat-1

        15:31:17,859 INFO  [org.jboss.as.process.Host Controller.status] (main) JBAS012017: Starting process 'Host Controller'

        [Host Controller] 15:31:18,779 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.7.Final-redhat-1

        [Host Controller] 15:31:18,941 ERROR [stderr] (main) java.lang.IllegalStateException: JBAS014805: Could not get main file: /apps/jboss/jboss-eap-6.4.0/domain1/configuration/host. Specified files must be relative to the configuration dir: /apps/jboss/jboss-eap-6.4.0/domain/configuration

        [Host Controller] 15:31:18,942 ERROR [stderr] (main)    at org.jboss.as.controller.persistence.ConfigurationFile.determineMainFile(ConfigurationFile.java:168)

        [Host Controller] 15:31:18,943 ERROR [stderr] (main)    at org.jboss.as.controller.persistence.ConfigurationFile.<init>(ConfigurationFile.java:95)

        [Host Controller] 15:31:18,944 ERROR [stderr] (main)    at org.jboss.as.host.controller.HostControllerEnvironment.<init>(HostControllerEnvironment.java:372)

        [Host Controller] 15:31:18,945 ERROR [stderr] (main)    at org.jboss.as.host.controller.Main.determineEnvironment(Main.java:452)

        [Host Controller] 15:31:18,945 ERROR [stderr] (main)    at org.jboss.as.host.controller.Main.boot(Main.java:131)

        [Host Controller] 15:31:18,946 ERROR [stderr] (main)    at org.jboss.as.host.controller.Main.create(Main.java:126)

        [Host Controller] 15:31:18,947 ERROR [stderr] (main)    at org.jboss.as.host.controller.Main.main(Main.java:115)

        [Host Controller] 15:31:18,947 ERROR [stderr] (main)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        [Host Controller] 15:31:18,948 ERROR [stderr] (main)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        [Host Controller] 15:31:18,949 ERROR [stderr] (main)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        [Host Controller] 15:31:18,949 ERROR [stderr] (main)    at java.lang.reflect.Method.invoke(Method.java:606)

        [Host Controller] 15:31:18,950 ERROR [stderr] (main)    at org.jboss.modules.Module.run(Module.java:312)

       

      Not sure where I am missing the references or is it possible at all to create multiple domain controllers with single JBoss installation

       

      If  any one has successfully  created multiple domain controllers with single JBoss Installation, please list the complete steps here.

       

      I really appreciate your help, thank you in advance !

       

      Regards,

      Sukeshpeddolla

        • 1. Re: Multiple Domain Controlers with single JBoss(EAP 6.4.5) Installation
          Amit Nijhawan Newbie

          Please run the below command:

          ./domain1.sh -Djboss-domain.base.dir=/home/aa/Desktop/Jboss-Practice-EAP6/Domain/domain1/ --domain-config=domain.xml --host-config=host.xml

           

          Regards,

          -A

          • 2. Re: Multiple Domain Controlers with single JBoss(EAP 6.4.5) Installation
            Martin Choma Expert

            Can't be your problem solved with server-groups? You are able to restart only one server-group at the moment - no need to restart whole domain.

            • 3. Re: Multiple Domain Controlers with single JBoss(EAP 6.4.5) Installation
              sukesh r Newbie

              Amit, Thank you  for your suggestion. It worked with below command.

              ./domain1.sh -Djboss-domain.base.dir=/apps/jboss/jboss-eap-6.4.0/domain1/ -Djboss.domain.config.dir=/apps/jboss/jboss-eap-6.4.0/domain1/configuration/ --domain-config=domain.xml --host-config=host.xml

               

              now the second domain controller is up and running with 29990 and 29999 ports

               

              But if i want to connect jboss-cli for domain1(second domain controller), what needs to be done ..?

               

              I have set of jboss-cli1.xml and jboss-cli1.sh, when i try to run jboss-cli1.sh, it is still trying to connect to the base "domain"(9999) not the "domain1"(29999)

               

              I checked the references and couldn't find any, is there any way to connect to jboss-cli1.sh by passing run time parameters..?

               

              Thanks,

              Sukesh

              • 4. Re: Multiple Domain Controlers with single JBoss(EAP 6.4.5) Installation
                Amit Nijhawan Newbie

                Please run the below command:

                ./jboss-cli.sh -c --controller=127.0.0.1:29999

                • 5. Re: Multiple Domain Controlers with single JBoss(EAP 6.4.5) Installation
                  sukesh r Newbie

                  Amit, thank you ! It worked and i was able to create multiple domain controllers with single jboss installation.

                   

                  Tested on both Primary and slave hosts, adding all the steps here which could be useful for others.

                   

                  Multiple Domain Controllers setup with single JBoss Installation:

                   

                   

                  on JBoss Primary Node:

                   

                   

                  1). Login to the Target JBoss server

                   

                   

                  2). mkdir -p /tmp/deploy/backups/`date +"%m-%d-%y`

                   

                   

                  3). cd /apps/jboss

                   

                   

                  4). tar -cvzf /tmp/deploy/backups/`date +"%m-%d-%y`/jboss-eap-6.4.0.tgz jboss-eap-6.4.0/*

                   

                   

                  5). chmod 000 /tmp/deploy/backups/`date +"%m-%d-%y`/jboss-eap-6.4.0.tgz

                   

                   

                  6). cd /apps/jboss/jboss-eap-6.4.0

                   

                   

                  7). cp -r domain domain1 (creating another set of domain folder)

                   

                   

                  8). cd /apps/jboss/jboss-eap-6.4.0/domain1

                      Make the chnages to domain.xml and host.xml

                                                                

                      (Note: change the profile name, server group, member name, hostname, ips accordingly)

                   

                   

                  9). cd /apps/jboss/jboss-eap-6.4.0/bin

                   

                   

                  10). cp domain.sh domain1.sh

                   

                   

                  11). cp domain.conf domain1.conf

                   

                   

                  12). vi domain1.sh

                       change from

                    JBOSS_BASE_DIR="$JBOSS_HOME/domain

                    to

                    JBOSS_BASE_DIR="$JBOSS_HOME/domain1

                    

                    chnage from

                    DOMAIN_CONF="$DIRNAME/domain.conf

                    to

                    DOMAIN_CONF="$DIRNAME/domain1.conf

                    save

                    

                  13). start domain

                       cd /apps/jboss/jboss-eap-6.4.0/bin

                    ./domain1.sh -Djboss-domain.base.dir=/apps/jboss/jboss-eap-6.4.0/domain1/ -Djboss.domain.config.dir=/apps/jboss/jboss-eap-6.4.0/domain1/configuration/ --domain-config=domain.xml --host-config=host.xml &

                       make sure domain1 up and looks good

                    

                  14). connect to jbosscli

                       cd /apps/jboss/jboss-eap-6.4.0/bin

                    ./jboss-cli.sh -c --controller=ip:29999

                    make sure to connect successfully

                    exit

                   

                   

                  15). Login to JBoss admin console

                       http://hostname:29990/console

                      

                  on JBoss Slave Node:

                  1). Login to the Target JBoss server

                   

                   

                  2). mkdir -p /tmp/deploy/backups/`date +"%m-%d-%y`

                   

                   

                  3). cd /apps/jboss

                   

                   

                  4). tar -cvzf /tmp/deploy/backups/`date +"%m-%d-%y`/jboss-eap-6.4.0.tgz jboss-eap-6.4.0/*

                   

                   

                  5). chmod 000 /tmp/deploy/backups/`date +"%m-%d-%y`/jboss-eap-6.4.0.tgz

                   

                   

                  6). cd /apps/jboss/jboss-eap-6.4.0

                   

                   

                  7). cp -r domain domain1 (creating another set of domain)

                   

                   

                  8). cd /apps/jboss/jboss-eap-6.4.0/domain1

                      Make the chnages to  host.xml             

                     (Note: change the profile name, server group, member name, hostname, ips accordingly)

                   

                   

                  9). cd /apps/jboss/jboss-eap-6.4.0/bin

                   

                   

                  10). cp domain.sh domain1.sh

                   

                   

                  11). cp domain.conf domain1.conf

                   

                   

                  12). vi domain1.sh

                       change from

                    JBOSS_BASE_DIR="$JBOSS_HOME/domain

                    to

                    JBOSS_BASE_DIR="$JBOSS_HOME/domain1

                    

                    chnage from

                    DOMAIN_CONF="$DIRNAME/domain.conf

                    to

                    DOMAIN_CONF="$DIRNAME/domain1.conf

                    save

                    

                  13). start domain

                       cd /apps/jboss/jboss-eap-6.4.0/bin

                    ./domain1.sh -Djboss-domain.base.dir=/apps/jboss/jboss-eap-6.4.0/domain1/ -Djboss.domain.config.dir=/apps/jboss/jboss-eap-6.4.0/domain1/configuration/ --host-config=host.xml &

                       make sure domain1 up and looks good

                   

                   

                  on JBoss Primary node:

                    

                  1). Verify /apps/jboss/jboss-eap-6.4.0/domain1/log/hostcontroller.log and make sure all the slave nodes registered with primary node

                   

                   

                  2).  start servers

                       connect to jbosscli

                      ./jboss-cli.sh -c --controller=ip:29999

                    :start-servers()

                   

                  3). verify the /apps/jboss/jboss-eap-6.4.0/domain1/log/"server"/server.log on all servers

                   

                   

                  4). if you want to add user to domain1, run below command

                   

                   

                      ./add-user.sh -dc  /apps/jboss/jboss-eap-6.4.0/domain1/configuration/

                  • 6. Re: Multiple Domain Controlers with single JBoss(EAP 6.4.5) Installation
                    sukesh r Newbie

                    Amit, servers started fine with above settings, but some times we are seeing the below error in server,log.

                     

                    data/content/0d/b162f14f559819e595215439385e6d8a83dc4f is obsolete and will be removed


                    it is happening some times, found below thread on that, but this wasn't much useful. And again we have to deploy the same code remove the above error.


                    https://developer.jboss.org/thread/252308?start=0&tstart=0


                    it is happening with newly created domain, previous one works absolutely fine.


                    Any thoughts ..?