0

I am implementing session replication in my application. This is old application. I made all changes and now need to test the server switch and confirm that the objects in session is properly carried to another server in server list.

I have 1 Admin server and 2 managed servers. So the cluster is made of 2 managed server.

while testing I have to always bounce the server and test the flow of my application. This process is very time consuming. So I am looking for any other way to sway a server in and out of cluster
during runtime. I asked on Oracle support website , but they said only way to bounce the server.

  1. How can I write a script for this?
  2. Is there a parameter in weblogic or wlproxy plugin config file that help in this switch.

Your help is appreciated.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
AmitG
  • 519
  • 6
  • 19
  • Please tag more carefully. You tagged this as [tag:cluster-analysis] (aka: clustering, a data mining technique). When adding tags, you really should check the description to not pick the wrong ambiguous "clustering", when you actually meant [tag:load-balancing] or something like that. – Has QUIT--Anony-Mousse Apr 24 '13 at 09:17

2 Answers2

0

using Weblogic scripting tool (WLST) in script mode, you can write a script to automate the shutdown / startup of the managed server that you would like to remove temporarily from the cluster.

you create a file with .py extension which will contain the weblogic commands that you would like to run.

shutdown.py:

connect('username','password','t3://adminIP:port')
shutdown('servername')
disconnect()

startup.py:

connect('username','password','t3://adminIP:port')
start('servername') 
disconnect()

to run the script from commandline:

java weblogic.WLST c:\myscripts\shutdown.py

you can put this line in a shell/batch script.

Another way is to write a Java program or an ANT script to invoke the commands using the weblogic.jar file that comes with weblogic.

0

If you were to change the state of a weblogic managed server from running to admin mode then also you can test the session replication.

You can do this from admin console by selecting the managed server and going to control tab and changing the state of the server to Admin. You can change it back to running from the same place.

Using WLST you can use the commands suspend and resume

http://docs.oracle.com/cd/E11035_01/wls100/server_start/server_life.html http://docs.oracle.com/cd/E14571_01/web.1111/e13813/quick_ref.htm

suspending and resuming managed servers is quicker than shutting it down and restarting it again.

I have tested this at my end and it works fine, ie when I change the state to admin, my request goes to another managed server and the session is also replicated.

I have used the sample WLS cluster replication example available in wls installation.

SridharS
  • 893
  • 4
  • 8