Thursday, April 3, 2014

Re-Targeting the singleton Applications to a single OSB node through WLST script

Re-Targeting the singleton Applications to a single OSB node through WLST script

While setting up a OSB cluster environment some of the singleton applications should be targeted to a single node in the cluster.Also we have to make sure these applications are targeted to the active OSB node in the cluster.

The below WLST script will help us to re-target the singleton applications to a single active OSB node.

ReTargetSingletontoActiveNode.py

adminURL='t3://localhost:8080
adminUserName='weblogic'
adminPassword=welcome1
connect(adminUserName, adminPassword, adminURL)

runtime()
edit()
startEdit()

print "Targeting Intiated..."

cd('/AppDeployments/ALSB Domain Singleton Marker Application')
set('Targets',jarray.array([], ObjectName))
set('Targets',jarray.array([ObjectName('com.bea:Name=OSB2,Type=Server')], ObjectName))
print "Targeted the Domain Singleton Marker Application to OSB2..."

cd('/AppDeployments/ALSB Cluster Singleton Marker Application')
set('Targets',jarray.array([], ObjectName))
set('Targets',jarray.array([ObjectName('com.bea:Name=OSB2,Type=Server')], ObjectName))
print "Targeted the Cluster Singleton Marker Application to OSB2..."

cd('/AppDeployments/Message Reporting Purger')
set('Targets',jarray.array([], ObjectName))
set('Targets',jarray.array([ObjectName('com.bea:Name=OSB2,Type=Server')], ObjectName))
print "Targeted the Message Reporting Purger to OSB2..."

activate()
exit()


No comments:

Post a Comment