Until WebLogic 9.2 the only communication mode available between the Cluster members of your WebLogic domain is ‘Multicast’. Starting with WebLogic 10.0, Oracle in addition to MultiCast, supports communication between the Cluster members using Unicast. Quick definitions of Unicast and Multicast from Wikipedia.
Unicast:
Unicast messaging is used for all network processes where a private or unique resource is requested making most networking traffic Unicast in form. Unicast is used where two way connections are needed to complete the network transaction.
Multicast:
Multicast addressing is a network technology for the delivery of information to a group of destinations simultaneously using the most efficient strategy to deliver the messages over each link of the network only once, creating copies only when the links to the multiple destinations split.
I believe, support for Unicast is a very important feature. Although Multicast is efficient when compared to Unicast, it causes a network configuration overhead where your Network Administrator need to dedicate a Multicast address. Also, when using Multicast you should make sure the end points or systems that don’t want the information have to be shielded from receiving these unwanted multicast broadcast messages.
Recently we have automated our Cluster configuration creations to Unicast messaging mode. In this post I would like to share wlst scripts and some guidelines to follow when using Unicast. Assuming you already have a domain, let us create a Cluster definition. First connect to the server and start an edit session
connect(uname,pwd,url)
edit()
startEdit()
theCluster = cmo.createCluster(‘mycluster’)
theCluster.setClusterMessagingMode(‘unicast’);
It is recommended to use a custom broadcast channel instead of the default.
theCluster.setClusterBroadcastChannel(‘myclusterChannel’);
Now let’s create a basic managed server and add that to the cluster. We will configure a Network access point for the managed server that will be used for communicating with other managed servers in the cluster.
msSvr = cmo.createServer(“ms1”)
msSvr.setListenAddress(“msMachine”)
msSvr.setListenPort(8001)
msSvr.setCluster(theCluster)
cd(‘/Servers/ms’)
cmo.createNetworkAccessPoint(‘myclusterChannel’)
cd(‘/Servers/ms/NetworkAccessPoints/myclusterChannel’)
cmo.setListenPort(8002)
cmo.setPublicPort(-1)
cmo.setEnabled(true)
if you would like to secure conmmunication between the servers
cmo.setProtocol(‘cluster-broadcast-secure’)
Now make sure you enable the Outbound communication for this channel, otherwise your managed server will not be able to communicate with other managed servers in the cluster.
cmo.setOutboundEnabled(true)
I have pasted the entire working script below that you can use to create a 2 Node Cluster that uses Unicast messaging mode on a custom Network channel.
def init():
connect(uname,pwd,url)
edit()
startEdit()def createCluster(clusterName):
theCluster = cmo.createCluster(clusterName)
theCluster.setClusterMessagingMode(‘unicast’);
# It is recommended to use a custom broadcast channel instead of default
theCluster.setClusterBroadcastChannel(‘myclusterChannel’);
return theClusterdef createMS(msname, port, mname, channelPort, clusterBean):
msSvr1 = cmo.createServer(msname)
msSvr1.setListenAddress(mname)
msSvr1.setListenPort(port)
msSvr1.setCluster(clusterBean)
cd(‘/Servers/’+msname)
cmo.createNetworkAccessPoint(‘myclusterChannel’)
cd(‘/Servers/’+msname+’/NetworkAccessPoints/myclusterChannel’)
# if you want secure conmmunication between the servers
cmo.setProtocol(‘cluster-broadcast-secure’)
cmo.setListenPort(channelPort)
cmo.setPublicPort(-1)
cmo.setEnabled(true)
# This is very very important
cmo.setOutboundEnabled(true)
cd(‘/’)def run():
init()
bean = createCluster(‘mycluster’)
createMS(“ms1″,8001,”ms1Machine”,8002,bean)
save()
activate()run()
Tags: Clustering
Hi Satya,
Is there an offline equivalent to this script, especially for the part that creates network accesspoints?
Do we need two channel ports if we have 2 managed servers?
Thanks,
Chandra
Chandra,
No, I don't have one, but if I come across one I will post it here.
You can use the default channel that uses the regular managed server port for cluster communication. But it is recommended that you have a different network channel for cluster communications.
One additional piece to ensure is that the session replication and load balancing does not break when using unicast in a secure weblogic environment. For that set the secure replication enabled to true on the cluster MBean. I feel oracle should fix this so the server would automatically enable secure replication when using a secure default protocol.
see the post at my blog TechVibe
Hi Satya,
Is there a place to find any specifics on how to setup a Unicast channel and when or if you need to .
From this example it is unclear to me how that is set up. I am familiar with what is needed for a multicast IP. WLS doc has not been too helpful for this , nor has WLS support.
Thanks
EdP.
Yes, setOutboundEnabled(true) is very important. By default, WL console doesn’t check this checkbox. You have to make sure you check it at Channel creation time. Otherwise, you need go to “Advanced” area to check it.
We have 4 managed servers in one cluster. But we had complain about session replication issue. I noticed 2 servers have “Frequently” drop out, and 2 have “Occasional” drop out. Looking at groups for cluster, I saw one MS has 4 servers in its group, two MS have 3 servers in the group, and one MS only has 2 servers. We are going to raise cluster debugging level to check the reason. However, what we observed if we use Default channel, it works better. So, we are not sure yet if there is a problem with customized channel for Unicast.
May I ask why you are saying “It is recommended to use a custom broadcast channel…”? Any technical reason for that?
Cheers,
Hi Satya,
Previously we can monitor multicast messages when we use multicast messaging to the cluster. Now we are using Unicast messaging mode, So how can monitor or view unicast messages. Please reply to this comment satya.
Cheers,
Sumanth.
Sumanth,
I believe there is no tool to monitor unicast messages. But I do believe there is a debug flag that you can enable which prints debug messages in your log indicating if unicast is working or not.
Also, make sure you set OutboundEnabled to true if you are using a custom channel.