cancel
Showing results for 
Search instead for 
Did you mean: 

HELP: How to assign an application to a single server node???

Former Member
0 Kudos

Hello,

Our J2EE application is not cluster aware (contains static variables for instance), and must be deployed in a multi-server node environment.

For the application to be run correctly, it must be assigned to a single dedicated server node. Using the Visual Administrator, I am able to start the app on a single server node, simply not 'including' the other available server nodes.

However, as soon as the SAP server is restarted, it deploys and starts the application on all available server nodes, causing the application to malfunction....

Does anyone know how to tell the deploy&start process, that my application must only be deployed to and started on a single server node?

(I'm aware that for web requests, the Web Dispatcher can be used for this pupose). My application is, however, not (only) a web application....

Thanx in advance!!

David.

Accepted Solutions (0)

Answers (1)

Answers (1)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi David,

first of all, there is no way to make your application run only on a single node, and usually you need some really nasty tricks to write an app that needs to do so. Static variables are OK, as server nodes run in different processes and thus should not interfere.

However, there is a trick to make your application single noded:

This works via the NetWeaver locking system ([com.sap.engine.services.applocking|http://help.sap.com/javadocs/NW04S/current/en/index.html] also [interesting|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b0/db751790264341aa4fea7f0286dec6/frameset.htm]), or for those who know ABAP, the enqueue lock.

What does it do? First of all, this has nothing to do with databases, it's an independant locking system that locks nothing elses but strings, basically by convention.

How does it work?

Your program should set such a lock (in reality a basic string sent to the locking service) right in the beginning and handle eventual exception by just stopping to execute. As all instances of the program try to set the same lock, only one will get through. All others stop executing. And you're done.

You also might check whether [logon groups|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a9/775a421b5ec153e10000000a1550b0/frameset.htm] might help you. (I doubt it because this is mainly for pure web apps)

However, be sure you really understand what you are doing and you really have the single service case.

Let me know if that helped!

Regards,

Benny