Results 1 to 7 of 7

Thread: Running two instances of DM Server

  1. #1
    Join Date
    Dec 2006
    Posts
    18

    Default Running two instances of DM Server

    I tried to run two instances of Spring DM Server (2.0.1.RELEASE) on the same machine. Everything is OK except the shutdown does not work properly.

    Here is what I did:
    1. Made a copy of the whole installation.
    2. Searched for any kind of the port number specifications. I found them in dmk.sh and some files under config directory. I changed those ports so that two instances would not clash.
    3. Started both instances with their corresponding startup.sh scripts. Looked good.
    4. Called shutdown.sh on the second (altered) instance. The first instance shut down instead, the second one was still running.

    Is there a solution to this? Am I missing some port number or parameter?

    The same problem exists in 1.0.2 version, I hoped it would be fixed in 2.0.1.

  2. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    Did you pass the same -jmxport parameter to both startup.sh and shutdown.sh?
    Glyn Normington
    SpringSource

  3. #3
    Join Date
    Dec 2006
    Posts
    18

    Default

    No, I did not use explicit "-jmxport" argument.
    Instead, in the second instance of the server, I changed dmk.sh script to set it to a different value by default:

    if [ -z "$JMX_PORT" ]
    then
    JMX_PORT=29875
    fi

    I thought it should properly apply to both startup and shutdown.

  4. #4
    Join Date
    Dec 2006
    Posts
    18

    Default

    Glyn,

    I now looked at dmk.sh, and I believe that it has a problem. I am not sure if the
    com.springsource.kernel.shutdown.ShutdownClient class has a problem too, I don't have the source code.

    The JMX_PORT property is not applied to the stop command at all.
    I tried to fix the script, but I don't know how to pass the port number to the ShutdownClient. Obviously the

    -Dcom.sun.management.jmxremote.port=$JMX_PORT

    is for the server, not client.

    I hope that port number 9875 is not hard-coded in the ShutdownClient .

    Please let me know what is the story.

    Thanks,

    Leonid

  5. #5
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    If you specify the -jmxport option to shutdown.sh then it is parsed by ShutdownClient, so if you must change the scripts, you'll need to add "-jmxport 29875" to the options passed to ShutdownClient.
    Glyn Normington
    SpringSource

  6. #6
    Join Date
    Dec 2006
    Posts
    18

    Default

    Thanks Glyn, that works.

    I actually figured it out before reading your reply. However, I preferred to slightly fix the dmk.sh script, to make it transparent:

    1. I moved the default JMX_PORT setting outside of the "if" statement, so it will apply for the stop command also.
    2. Added "-jmxport $JMX_PORT" to the ShutdownClient invocation.

  7. #7
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    Glad you're sorted.
    Glyn Normington
    SpringSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •