3 Replies Latest reply on Apr 26, 2014 1:17 PM by doughboss

    Remote Deploys to Load Balanced environment

    doughboss

      Hi All,

       

      Currently, my project has a load balanced environment and we can deploy fine to each node individually, no problem.  We have accomplished this using the jboss-as-maven plugin, and it works quite nicely.

       

      However,  I cannot figure out how to deploy to more than one node at a time.  Triggering a deploy for each node is not ideal, especially since we try to do a full build at deploy time to confirm that the unit tests and selenium tests come back without errors.  We currently use jenkins to schedule and deploy.  I cannot figure out how to have push button deploys to the full environment.  Any advice?  ideas?  preferably quick fixes

       

      Below is the plugin snippet that accomplishes the single node deploy (with redactions):

       

      <plugin>

          <groupId>org.jboss.as.plugins</groupId>

          <artifactId>jboss-as-maven-plugin</artifactId>

          <version>7.2.Final</version>

          <configuration>

            <hostname>server-name-${node}.ext.com</hostname>

            <port>9999</port>

            <username>xxxxxxxx</username>

            <password>pppppppp</password>

            <name>service-name</name>

            <filename>service-name.war</filename>

            <skip>false</skip>

           </configuration>

           <executions>

              <execution>

              <id>deploy-jar</id>

              <phase>install</phase>

              <goals>

                <goal>deploy</goal>

              </goals>

           </execution>

          </executions>

      </plugin>

       

       

      Thank you in advance

        • 1. Re: Remote Deploys to Load Balanced environment
          wdfink

          What if you use a domain?

          You can have a couple of servers at different hosts and only connect to the domain-controller deploy your app once and the controller distribute it to all the different servers as configured.

           

          See Domain Setup - JBoss AS 7.1 for more details and ask if you still have questions

          1 of 1 people found this helpful
          • 2. Re: Remote Deploys to Load Balanced environment
            ctomc

            Also you can take a look at deployment plans

            • 3. Re: Remote Deploys to Load Balanced environment
              doughboss

              Thank you for the replies.  The domain host would be perfect and that was our original infrastructure.  However, these decisions are not in my control and they have opted for standalone instances controlled by an apache load balancer instead of the domain controller for jboss.  I think the idea is that they host many different environments and want to be able to support tomcat and other servers with the same architecture, instead of using jboss exclusively.

               

              In any event, I can't use it, but you are correct to suggest that solution

               

              In case it helps someone else, the solution I was able to work out (though it needs a whole lot more testing) is very similar to my original solution.  It turns out you can throw the configuration element for jboss-as-maven plugin inside the execution tags, so I can configure the endpoint for each execution element.  I was not able to find any posts or examples suggesting this approach and stumbled across it blindly, so in case it helps anyone else, see below:

               

              <build>

              <plugins>

              <plugin>

              <groupId>org.jboss.as.plugins</groupId>

              <artifactId>jboss-as-maven-plugin</artifactId>

                <version>7.2.Final</version>

                <executions>

                  <execution>

                    <configuration>

                      <hostname>server1.ext.com</hostname>

                      <port>9999</port>

                      <username>uuuuuuuuuuu</username>

                      <password>pppppppppp</password>

                      <name>service</name>

                      <filename>service.war</filename>

                      <skip>false</skip>

                    </configuration>

                    <id>deploy-jar</id>

                    <phase>install</phase>

                    <goals>

                      <goal>deploy</goal>

                    </goals>

                  </execution>

                  <execution>

                    <configuration>

                    <hostname>server2.ext.com</hostname>

                    <port>9999</port>

                    <username>uuuuuuu</username>

                    <password>pppppppp</password>

                    <name>services</name>

                    <filename>services.war</filename>

                    <skip>false</skip>

                      </configuration>

                        <id>deploy-jar2</id>

                        <phase>install</phase>

                        <goals>

                          <goal>deploy</goal>

                        </goals>

                      </execution>

                    </executions>

                  </plugin>

                </plugins>

              </build>