Search This Blog

Monday, January 25, 2016

Multitenancy in WebLogic 12c Part -6 Partition Domain Control

Controlling means starting the partition and shutdown the partition that we have created in the earlier post. Here my exploration on the two important WLST functions:

  1. startPartitionWait
  2. forceShutdownPartitionWait

Starts the given partition and waits until the partition reaches the requested state that is RUNNING state. To run this command the partition must already exist. Therefore startPartitionWait should not be used in the edit session.

The forceShutdownPartitionWait command will Shutdown the given partition and waits until the partition state reaches the SHUTDOWN state. Same rule works for this command as well, the partition must be exists to control it.

Prerequisites:

  1. Configure Security Realm
  2. Create Users & Groups for Partition domain
  3. Configure Virtual Target
  4. Creating Partition Domain
  5. Configure IDD for Partition
  6. Partition Control (start/stop using WLST)

Here I've prepared the customized script for stop, start and restart all the partitions in the domain.
# This script will start the partition

def startPartition(partitionName):
        print "Staring the partition :"+ partitionName
        partitionBean=cmo.lookupPartition(partitionName)
        startPartitionWait(partitionBean)

def startAllPartitions():
        print "Starting all partitions ..."
        startPartition('Corporate_partition')
        startPartition('Online_partition')

def stopPartition(partitionName):
        print "Stoping the partition :"+ partitionName
        partitionBean=cmo.lookupPartition(partitionName)
        forceShutdownPartitionWait(partitionBean)

def stopAllPartitions():
        print "Starting all partitions ..."
        stopPartition('Corporate_partition')
        stopPartition('Online_partition')


def main():
        connect("weblogic","welcome1","t3://192.168.33.100:6100")

        print "Partition Control Menu..."
        print "==========================="
        print "1. Start all partitions"
        print "2. Shutdown all partitions"
        print "3. Restart all partitions"
        control=input("Enter your control choice: ")

        if control==1:
                startAllPartitions()
        elif control==2:
                stopAllPartitions()
        elif control==3:
                stopAllPartitions()
                startAllPartitions()
        else:
                print "invalid option..."
        disconnect()


main()

The execution goes as shown below...
Starting Partition using WLST

Partition state RUNNING
Stop the Partition with menu option 2

Stop Partition using WLST
Double check the same on the WebLogic Admin console:

Shutdown Partitions on WebLogic Admin Console

No comments:

Facebook Blogger Plugin: By RNHckr.com

Post a Comment

Please write your comment here

Popular Posts