10 Replies Latest reply on Jul 17, 2008 3:47 PM by diegobowen

    Shutting down diff JBOSS IP aliases Instances on one Machine

    diegobowen

      I have multiple instances of JBoss running on a single machine via IP aliases. For a background on this please refer to:

      http://wiki.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOneMachine

      Although not mentioned as one of the possible solutions in the above article, using IP aliases seemed to work. The problem is how do I stop a certain JBOSS instance? For example I have three IP aliases:
      X.X.X.200, X.X.X.201 and X.X.X.202
      each running a running a different server configuration on the same machine.

      $JBOSS_HOME/bin/run.sh -c server1 -b X.X.X.200
      $JBOSS_HOME/bin/run.sh -c server1 -b X.X.X.201
      $JBOSS_HOME/bin/run.sh -c server1 -b X.X.X.201

      All three are running per a "ps -ef | grep jboss". On the JBoss site there is info for shutting down different instances if the different instances are using different ports with the "shutdown" command however I couldnt find anything for my situation. In addition to that, the shutdown commands options seem not to support any references to a particular IP address. Please help. Thanks

        • 1. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
          peterj

          Try:

          ./shutdown.sh -S -s X.X.X.200:1099

          • 2. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
            diegobowen

            Thanks for the suggestion however I attempted that already with the following results:

            -bash-3.00$ ./shutdown.sh -S -s XX.XX.XX.200:1099
            Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console
            at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:97)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)


            -bash-3.00$ ps -ef | grep jboss

            webadmin 28793 28768 0 Jul16 ? 00:00:58 /usr/local/java/bin/java -Dprogram.name=run.sh -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/usr/local/jboss/jboss-as/lib/endorsed -classpath /usr/local/jboss/jboss-as/bin/run.jar:/usr/local/java/lib/tools.jar org.jboss.Main -c project1 -b X.X.XX.200

            Where "project1" is just a copy of $JBOSS_HOME/server/default.

            Thanks

            • 3. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
              peterj

              If you got a "Failed to authenticate" error, then you connected successfully to the server through the port. It looks like you locked down the jmx invoker, so you will have to also provide the userid and password on the command line:

              ./shutdown.sh -S -s XX.XX.XX.200:1099 -u userid -p password

              • 4. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
                diegobowen

                Thanks it makes sense however I'm new to JBoss...is there a properties file that holds the default userid and passwords for the default server...kinda similar to tomcat? Thanks

                • 5. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
                  peterj

                  What version of JBossAS are you using? Also, are you using JBossAS or JBossEAP? EAP is available only from the support site if you purchase a subscription.

                  Anyway, JBossAS does not have the jmx invoker locked down. If it is locked down, you or someone else must have locked it down. In that case I would not know the exact file (if any) to look at.

                  If you have JBossEAP, jmx invoker is locked down out-of-the-box, but there are no user ids set up out-of-the-box so there is no way to log in. The default configuration for JBossEAP uses the jmx-console-users.properties files in the server/xxx/conf/props directory to store the user id an password.

                  • 6. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
                    diegobowen

                    Thanks again...I'm using: jboss-eap-4.3


                    I looked there:

                    -bash-3.00$ cat jmx-console-users.properties
                    # A sample users.properties file for use with the UsersRolesLoginModule
                    #admin=admin
                    -bash-3.00$



                    -bash-3.00$ ./shutdown.sh -S -s X.X.X.200 -u admin -p admin
                    Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=admin, securityDomain=jmx-console
                    at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:97)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)





                    Thanks

                    • 7. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
                      peterj

                      Look back at my post, this line:

                      PeterJ wrote:
                      If you have JBossEAP, jmx invoker is locked down out-of-the-box, but there are no user ids set up out-of-the-box so there is no way to log in.


                      You have verified this statement.

                      • 8. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
                        diegobowen

                        I did the following:

                        I disabling Authentication for JMX Invoker by commenting out the security interceptor passthrough:

                        server/$CONFIG/deploy/jmx-invoker-service.xml

                        Located the mbean section with the class org.jboss.jmx.connector.invoker.InvokerAdaptorService. In that section comment out the line that relates to authenticated users:



                        <!-- Uncomment to require authenticated users -->

                        <!-- Interceptor that deals with non-serializable results -->




                        Started back up the JBOSS default instance on a IP address aliases...gave it sometime to start up then did the following:

                        ./shutdown.sh -S -s X.X.X.200

                        tailing the later I received a "shutdown complete" Halting VM.


                        So it seemed to work...Being new here to JBoss what if any are the ramifications? Is this the recommended way to go?


                        • 9. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
                          peterj

                          Um, why didn't you simply uncomment the "admin=admin" line in the properties file? And change the password, while you were at it. Or add another line with a different user/password?

                          Turning off the jmx invoker security means that anyone can run the shutdown command, or use jmx console to mess around with the app server. Not recommended in a production environment.

                          • 10. Re: Shutting down diff JBOSS IP aliases Instances on one Mac
                            diegobowen

                            I"m going to use this in a dev env not production. Thanks for all your help!!!