5 Replies Latest reply on Feb 2, 2012 2:47 AM by jaikiran

    Master-Slave deployment

    vithun.v

      I wanted to try out my application in master slave mode. i.e., one active deployment would be running at once.

       

      I tried to google for the document that speaks about this particular configuration in JBOSS AS 7.1, I couldn't find one. So i made an assumption that, starting two servers, one with host-master.xml and the other with host-slave.xml would do the trick.

       

      I started the servers with the following host configuration (just modified the original file a bit, blue highlight shows the diff)

       

      host-master.xml

       

      <?xml version='1.0' encoding='UTF-8'?>

      <host name="master" xmlns="urn:jboss:domain:1.1">

          <management>

              <security-realms>

                  <security-realm name="ManagementRealm">

                      <authentication>

                          <properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>

                      </authentication>

                  </security-realm>

              </security-realms>

              <management-interfaces>

                  <native-interface security-realm="ManagementRealm">

                      <socket interface="management" port="9999"/>

                  </native-interface>

                  <http-interface security-realm="ManagementRealm">

                      <socket interface="management" port="9990"/>

                  </http-interface>

              </management-interfaces>

          </management>

       

          <domain-controller>

             <local/>

          </domain-controller>

          <interfaces>

              <interface name="management">

                  <inet-address value="192.168.27.220"/>

              </interface>

          </interfaces>

      </host>

       

      host-slave.xml

       

       

      <?xml version='1.0' encoding='UTF-8'?>

      <host name="slave1" xmlns="urn:jboss:domain:1.1">

          <management>

              <security-realms>

                  <security-realm name="ManagementRealm">

                      <authentication>

                          <properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>

                      </authentication>

              <server-identities>

                  <secret value="YWRtaW4xMjM="/>

              </server-identities>

                  </security-realm>

              </security-realms>

              <management-interfaces>

                  <native-interface security-realm="ManagementRealm">

                      <socket interface="management" port="9999"/>

                  </native-interface>

              </management-interfaces>

          </management>

          <domain-controller>

             <remote host="192.168.27.220" port="9999" security-realm="ManagementRealm"/>

          </domain-controller>

          <interfaces>

              <interface name="management">

                  <inet-address value="192.168.27.149"/>

              </interface>

              <interface name="public">

                 <inet-address value="127.0.0.1"/>

              </interface>

          </interfaces>

           <jvms>

              <jvm name="default">

                <heap size="64m" max-size="256m"/>

             </jvm>

           </jvms>

          <servers>

              <server name="server-one" group="main-server-group"/>

              <server name="server-two" group="other-server-group">

                  <!-- server-two avoids port conflicts by incrementing the ports in

                       the default socket-group declared in the server-group -->

                  <socket-bindings port-offset="150"/>

              </server>

          </servers>

      </host>

       

       

      I started the server without any content in the servers and then after the servers started, i deployed a WAR file using jboss-admin console. I could see that the content, though added on both machines, its active only in slave and master doesn't take charge when I trun the slave down.

       

      Was the assumption i made wrong. I just wanted it to behave like how it would if i had deployed in deploy-hasingleton folder in AS 5.

       

      Sorry if I'd done anything stupid.

       

      If would be really happy to know when i can see the completed cluster document online .

        • 1. Re: Master-Slave deployment
          vithun.v

          Sorry. I'd missed the server list in host-master.xml .. the following lines had to be added in the same.

          ......

                 <jvms>

                  <jvm name="default">

                    <heap size="64m" max-size="256m"/>

                 </jvm>

               </jvms>

              <servers>

                  <server name="server-one" group="main-server-group"/>

                  <server name="server-two" group="other-server-group">

                      <!-- server-two avoids port conflicts by incrementing the ports in

                           the default socket-group declared in the server-group -->

                      <socket-bindings port-offset="150"/>

                  </server>

              </servers>

          ....

           

           

          Why is this not there in the default host-master.xml which comes along with the package? any reason??

          • 2. Re: Master-Slave deployment
            wdfink

            The domain mode is nothing about cluster and ha-singleton.

            It is only a management domain, that mean that you have a single point of administration.

             

            All deployments are provided for a 'server-group', if you deploy an application to main-server-group all servers in that group will deploy that app.

            Read [1] to understand the domain mode.

             

            ha-singleton is AFAIK not available within the current implementation.

            1 of 1 people found this helpful
            • 3. Re: Master-Slave deployment
              vithun.v

              Thanks ..

              I had a hint that  I was terribley wrong somewhere!!

               

              It would be great if you can let me know when ha-singleton is expected to arrive. Once it arrives, what would be the mechanism to deploy a singleton.

               

              Once again.. thanks a ton for the clarification.

              • 4. Re: Master-Slave deployment
                wdfink

                You should read the release nodes and/or admin manual if there is a new release.

                Normally nobody will watch old threads and post such answers it will be too much

                • 5. Re: Master-Slave deployment
                  jaikiran

                  VITHUN VENGOPALAN wrote:

                   

                   

                  It would be great if you can let me know when ha-singleton is expected to arrive. Once it arrives, what would be the mechanism to deploy a singleton.

                  It's already there in 7.1.0.CR1b https://community.jboss.org/message/645789#645789. But note that it's not the EJB @Singleton. In AS7, a HA singleton is backed by a JBoss MSC service. The testcase in that other thread has some details, but yes I agree that there isn't documentation around this. I guess we'll have the documentation once 7.1.0.Final is released.