users
[Top] [All Lists]

Re: [cinjug-users] Displaying which JVM in a cluster.

To: users@xxxxxxxxxx
Subject: Re: [cinjug-users] Displaying which JVM in a cluster.
From: "Edward Sumerfield" <esumerfd@xxxxxxxxxxxxxx>
Date: Sun, 19 Aug 2007 08:25:00 -0400
Delivered-to: mailing list users@xxxxxxxxxx
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=uAE10LBSmwt7dSFVjGvWcX55IgyGOMhx3337WROEM6DA/sFx1XaMtzma7du8kLj8vBGQdEi50/pNTwpQrknJ6G7uol3g9Ueye2HZ9dQ8jiMWkkwJ84pVAbjYRCe3fjyfJ9PVuJWr49oRGmQ+VTVUBt6JdNEBFu2FA9CQUA9Tigg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=DJ8pjIT23ZFRAK16ijaVHsNOLtqr/FtzODw809Rb7u06tXu40ZlSbUaiVfAYtI8TepaFqPoFbIRTNpfNMa7hYPjBN3wjUnRPzYyldObUForUUQG9ws8aZ2q+lqrP8Aw7MiJjPT0Duxk7BwnPwCLfls7eEcTo+9xQgGWSXAeflkE=
In-reply-to: <OF07628B8B.5234E28C-ON8525733A.0068C018-8525733A.0069AA76@xxxxxxxxxxxxxxxx>
Mailing-list: contact users-help@xxxxxxxxxx; run by ezmlm
References: <OF07628B8B.5234E28C-ON8525733A.0068C018-8525733A.0069AA76@xxxxxxxxxxxxxxxx>
Reply-to: esumerfd@xxxxxxxxxxxxxx
Sender: esumerfd@xxxxxxxxx
You could use the hostname of the current machine and the directory
that the jars are loaded from.

This means you don't need to pass anything in to the jvm, Matt's
system property solution would work fine but adds an admin overhead of
editing every app server installation with extra jvm configuration
parameters.

The problem is the second jvm on the same machine, the hostname is an
easyone. I don't believe that there is anyway to get the port that
your process is listening on without getting into jni.

Depending on your app server it will be deloying your jars into some
relatively well known directory structure. So jboss goes to
server/[confname]/work ... or something like that. You should be able
to do

    Url myJar = this.getClass().getClassLoader().getResource();

Then you can parse the "confname" from the url and you have a name for
the deployment and with the hostname you should have enough for you
log messages to indicate where things are happening.

On 8/17/07, ENapier@xxxxxxxxxxxxxxxx <ENapier@xxxxxxxxxxxxxxxx> wrote:
>
>
> Hi all,
>
> We've got a clustered environment of two physical machines, each with two
> JVMs. Mirroring and magic dust yields a total of four identical JVMs and
> application trees. Same URL, different ports, but that's hidden under the
> covers.
>
> Occasionally we (the developers) find ourselves wanting to know which JVM is
> providing a particular instance of an app. Does anybody know of any way we
> can retrieve an ID, port designation, etc to let us know this information?
>
> Thanx,
> Ed Napier
> Senior IT Specialist
> Shared Services - Web
> UNIFI Information Technology
> 513-595-2451


-- 
Ed

<Prev in Thread] Current Thread [Next in Thread>