Monday, February 22, 2010
Ant Script to start server and deploy application
Thursday, February 4, 2010
Deployment Plan
We can override the values of the deployement descriptors at the runtime using plan.xml. Following are the steps which can be followed to override context-root of the application specified in the weblogic.xml:
1) My weblogic.xml looks as follows:
I want to change the context-root from virtual to TestApp at runtime.
2) Create a deployment plan using weblogic.PlanGenerator as follows:
java weblogic.PlanGenerator -all -plan Plan.xml Virtual.war
This will generate Plan.xml outside the archived application.
3) Plan.xml contains the values which can be overridden in the deployment descriptor at runtime. We can override the value of context-root at runtime as follows:
4) Now deploy the application using weblogic.Deployer as follows:
java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password weblogic -redeploy -name Virtual -source Virtual.war -targets AdminServer -plan Plan.xml
5) Test the application using the following URL:
http://localhost:7001/TestApp
Default URL of application:
http://localhost:7001/Virtual
At runtime the value of context-root was overridden to TestApp.
Cluster Unicast messaging mode
WLS10.x onwards there are 2 messaging modes of cluster: Unicast and Multicast. According to the following document Unicast is the recommended messaging mode though there have been many issues reported.
http://download-llnw.oracle.com/docs/cd/E11035_01/wls100/cluster/features.html
a) In Unicast messaging mode, cluster members are split into groups and every group has a group leader. Cluster members communicate to the group leader when they need to send a broadcast message which is usually the heartbeat message. When the cluster members detect the failure of a group leader, the next oldest member becomes the group leader. All group leaders are connected to each other.
b) The frequency of communication in unicast mode is similar to the frequency of sending messages on multicast port.
Unicast messaging mode Model:
Unicast Configuration:
Default Network Channel:
While creating a cluster choose Unicast as the messaging mode. If we leave the ‘Unicast broadcast channel’ blank then default listening port of the server is used if no channel is configured.
Config.xml looks like follows when default network channel is in use:
In the standard out of managed servers we will get the following message:
This means that the default channel will listen all the protocols.
Custom Network Channel:
For customer Network channels to be used with Unicast we need to create Network Channel by the same name under each server in cluster from Protocol > Channels
We can create custom network channels for different protocols. Protocol used by unicast is cluster-broadcast for communication. Use this custom channel name in the Unicast broadcast channel.
NOTE: For example, If you are configuring Network channel for different protocols say http, t3,iiop etc then cluster-broadcast will be one of the common protocol which will be default be configured along with other protocols. Hence, custom channel created for http, t3, iiop can be used as unicat broadcast channel.
Config.xml will have the following information where Channel-0 is the custom Network channel.
While configuring channels other things that have that have to be taken care:
1) Listen Address, Listen port: If this is left blank then the server’s listen address will be taken as default address and port
2) External Address, External port: This is the address of firewall or loadbalancer if there is any.
3) HTTP enabled for this protocol: If you want that all http requests should be listen by the protocol for which network channel is configured then we need to keep this checked
4) Outbound Enabled: If this channel is going to listen to outbound traffic then this has to be checked
Refer: http://download.oracle.com/docs/cd/E15051_01/wls/docs103/config_wls/network.html#wp1058979
Unicast Debug Flag:
-Dweblogic.debug.DebugUnicastMessaging
Testing Unicast connectivity
In Unicast, we do not have any utility check network issues. We can suggest the customer to change the messaging mode to Multicast and check for network issues if there are any using the multicast utility
Multicast or IP multicast is a simple broadcast technology that enables multiple applications to subscribe to a given IP address and port number and listen for messages. The IP/port combination is setup when the cluster is defined and server instances uses multicast for JNDI updates andcluster heartbeats. So using java utils.MulticastTest -n server1 -a 224.x.x.x –p 9001 We just check whether all the Nodes
available in the Cluster is able to communicate or not. It is actually testing at the N/W level.