3 Replies Latest reply on Jun 17, 2008 4:14 PM by Brian Stansberry

    2 instances/machine; redhat init script

    Bob Brown Newbie

      I have looked at $JBOSS_HOME/bin/jboss_init_redhat.sh.

      This seems inadequate if one wants to have 2 JBoss instances/machine...

      It can easily be copied/hacked to run $JBOSS_HOME/bin/run.sh -c config for each separate instance.

      BUT I can't see how the code for stop/status can relate to WHICH instance to stop/report status on.

      Is this a bug/need for enhancement?

      Has there anyone out there who has solved this and is willing to contribute their solution?

      I have a REALLY BAD/hacky solution (can't post now...code is at work, I'm at home) I use twiddle.sh/probe.sh.

      I probably could use something like kill `ps axw | grep config | cut ...` for 'stop' but not for 'status'...

      This applies to 4.0.5GA and 4.2...., as far as I can see.

      Thoughts/comments/suggestions gratefully accepted.

      Cheers,

      Alph

        • 1. Re: 2 instances/machine; redhat init script
          Andrew Replogle Newbie

          If you've setup multiple instances per machine and you know your rmi port per instance (I use bindings.xml to specify this) then you can do shutdown.sh -s jnp://localhost:

          ie. shutdown.sh -s jnp://localhost:1099 && shutdown.sh -s jnp://localhost:1199 etc


          Hope this helps.


          Andrew

          • 2. Re: 2 instances/machine; redhat init script
            Jason R. Coombs Newbie

            I ran into this problem also, but I'm only running one instance. I want to run it behind Apache, and I have other Tomcat instances running on the machine, so using the recommendation from http://wiki.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOneMachine, I set up my instance to run on an internal IP address. Unfortunately, as you encountered, the scripts don't handle status or stop when the instance IP is specified.

            I fixed the issue with 'stop' by including the -s parameter to the Shutdown call.

            In particular, I added two lines during the setup phase of jboss_init_redhat.sh:


            #if JBOSS_HOST specified, use -b to bind jboss services to that address
            JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}

            #if JBOSS_HOST is specified, the stop command also requires a server parameter
            JBOSS_STOP_SERVER=${JBOSS_HOST:+"-s $JBOSS_HOST"}

            #define the classpath for the shutdown class
            JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}


            and then I included ${JBOSS_STOP_SERVER} in the JBOSS_CMD_STOP following --shutdown:

            JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown ${JBOSS_STOP_SERVER}"}


            This works. Apparently, if the RMI port is never specified, it need not be included in the shutdown URI.

            I suggest this be added to the released scripts, as it does not affect users who do not specify JBOSS_HOST and it only behaves better if the user does specify JBOSS_HOST.

            Regards,
            Jason