Newbie: how to restrict webapp to one JVM? - Websphere

This is a discussion on Newbie: how to restrict webapp to one JVM? - Websphere ; Newbie here. We've got Websphere set up in clustered mode. Unfortunately, one of our webapps needs to be accessed by only a single JVM. (This particular app is writing to a disk file, and if more than one process writes ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Newbie: how to restrict webapp to one JVM?

  1. Newbie: how to restrict webapp to one JVM?

    Newbie here. We've got Websphere set up in clustered mode.
    Unfortunately, one of our webapps needs to be accessed by only a single
    JVM. (This particular app is writing to a disk file, and if more than
    one process writes to that file we get trouble).

    How do we configure things so that only one JVM runs that webapp?

  2. Re: Newbie: how to restrict webapp to one JVM?

    Chris wrote:
    > Newbie here. We've got Websphere set up in clustered mode.
    > Unfortunately, one of our webapps needs to be accessed by only a single
    > JVM. (This particular app is writing to a disk file, and if more than
    > one process writes to that file we get trouble).
    >
    > How do we configure things so that only one JVM runs that webapp?


    Deploy it to the server, not to the cluster.

  3. Re: Newbie: how to restrict webapp to one JVM?

    Open Admin Console,

    Applications -> Installed Applications -> Click on EAR Your Application -> Map modules to servers -> Select your webapp and select the server name from the box and Apply. Sync nodes -> Restart the cluster

  4. Re: Newbie: how to restrict webapp to one JVM?

    When you have a cluster of servers you can only map applications to the entire cluster, you can't map applications to only one server in a cluster.



    The only way you will be able to do this is to create a separate server (not part of a cluster) for this application and map the application to this separate server.



    Another alternative would be to create an MDB app that does the work of writing to the file. This way the web app can still be deployed to a cluster and enjoy the benefit of clustering but send JMS messages to the MDB app to do the file writing. The MDB app would be deployed to a standalone server so it would be the only thing writing to the file. The drawback of this is that writing to the file would be outside the process of handling the web app requests so you would not be able to do things in the web app based on the results of writing to the file. It depends on your use case if this would be a showstopper. You could also do this as a regular session EJB but this would be more difficult from a JNDI lookup perspective and all the clustered copies of the web app would be blocking waiting for the EJB to finish their request to write to the file so you are losing the benefit of running in the cluster in the first place.



    Stuart Smith

    Administration Lead

    Web Age Solutions

    stuart.smith at webagesolutions dot com

+ Reply to Thread