VoIP Service and Marketing using Odoo and Asterisk PBX
Lzy.sh oracle coherence-37_on_weblogic_1036
1. lzy.sh http://lzy.sh/oracle-coherence-3-7-on-weblogic-10-3-6/
Oracle Coherence 3.7 on Weblogic 10.3.6
Recently, we completed a project to implement Oracle Coherence 3.7.1.1. on Weblogic 10.3.6 and the steps are
documented f or a quick ref erence.
1) Install Coherence
Oracle Coherence is by def ault installed with the Oracle Weblogic 10.3.6 and located at the same f older level as
WEBLOGIC_HOME. Just look f or coherence_3.7 f older.
This is a three node weblogic cluster.
Deploy the libraries and target them to the Weblogic cluster. These libraries are available at
$COHERENCE_HOME/lib/coherence-web.jar
$COHERENCE_HOME/lib/coherence.jar
$Weblogic_Home/common/deployable-libraries/active-cache-1.0.jar
Here is the wlst to deploy the coherence libraries to your weblogic cluster that will be used as a client, this
requires a properties f ile as well.
2. #!/usr/bin/python
loadProperties("/fmw/domains/scripts/fmw.props")
# deploy libs
# variables
deployableLibList='active-cache-1.0.jar'
coherenceLibList='coherence-web.jar,coherence.jar'
# connect string
connect(username,password,'t3s://'+adminMachine+'.mydomain.com:'+adminSSLPort)
# deploy loop
libs = deployableLibList.split(',')
for lib in libs:
deploy('',wlHome+'/common/deployable-
libraries/'+lib,targets=WLclusterName,libraryModule='true')
libs = coherenceLibList
for lib in libs:
deploy('',wlHome+'/coherence_3.7/lib/'+lib,targets=WLclusterName,libraryModule='true')
exit()
The f mw.props:
username=weblogic
password=myPassword
adminSSLPort=31000
adminMachine=myserver
wlHome=/fmw/products/wlserver_10.3
WLclusterName=wl_st1
2) Create the coherence cluster & servers using Weblogic Admin Console.
On the next Screen which looks like below, specif y the “Unicast Port” and uncheck “Unicast Port Auto
Adjust” (we would like to have a better control on the TCP ports used by Java processes).
3. The Coherence cluster is targeted to the WLS cluster. The Webapp which is the Coherence client will also be
deployed on the same WLS cluster.
You can now f inish your Coherence Cluster Conf iguration.
Next create the Coherence Servers one on each node.
a) cache_tst_01 on myTestMachine01.mydomain.com
b) cache_tst_02 on myTestMachine02.mydomain.com
b) cache_tst_03 on myTestMachine03.mydomain.com
4. Uncheck “Unicast Port Auto Adjust”.
Repeat the steps to create additional coherence servers.
Once created the coherence server summary looks as below.
In order to start the coherence servers, update the “server start” tab of these JVMs by providing relevants
values to
Java Home
Java Vendor
BEA Home
Root Directory
The Coherence JVMs will not start if coherence.server_10.3.5.0.jar & coherence.jar are not f ound in the
classpath. So, go ahead and update the classpath with the location of these jar f iles.
<Install_f older>/modules/f eatures/weblogic.server.modules.coherence.server_10.3.5.0.jar:
<COHERENCE_HOME>/lib/coherence.jar
5. select the server start tab and in the “Arguments” box and enter the properties below
For example on cache_tst_01:
-Xverbose:gcreport,memory,gcpause -XverboseTimeStamp -
Xverboselog:/fmw/log/myDomain/my_cache_cluster/cache_tst_01.gc -Xms1536m -Xmx1536m jamagent.jamrun
jamconshost=myEMhost.myDomain.com jamconsport=3800 jampool=my_cache_cluster
jamjvmid=my_cache_cluster/cache_tst_01 -Dtangosol.coherence.mode=prod -
Dtangosol.coherence.machine=myTestMachine01.myDomain.com -
Doracle.coherence.machine=myTestMachine01.myDomain.com -Dtangosol.coherence.cluster=my_cache_cluster
-Dtangosol.coherence.localhost=myTestMachine01.myDomain.com -Dtangosol.coherence.localport=8888 -
Dtangosol.coherence.session.localstorage=true -
Dtangosol.coherence.log=/fmw/log/myDomain/my_cache_cluster/cache_tst_01.out -
Dtangosol.coherence.override=/fmw/domains/myDomain/config/coherence/my_cache_cluster/tangosol-
coherence-override.xml -Dtangosol.coherence.management.remote=true -
Doracle.coherence.jamjvmid=my_cache_cluster/cache_tst_01
There are some options in here f or conf iguring Enterprise Manager 12c that will be detailed in another post.
Those can be ignored f or now.
A tangosol override f ile is used to maintain coherence operational settings across the domain and in this
environment it is conf igured to be same on all nodes.
temp-override
This completes the Coherence Server setup.
Here is a sample coherence WLST script, note the EM12c options are removed and will be included in the
second post conf iguring EM12c f or coherence management. This also requires a properties f ile and you
should see what is needed by looking at the below script.
6. #!/usr/bin/python
# Configuration Script for Coherence
# Read Properties File
loadProperties("/fmw/domains/scripts/fmw.props")
# Split if more than one.
CachemgdName = CachemgdNameList.split(',')
machineName = MachineNameList.split(',')
CachemgdPort = CachemgdPortList.split(',')
machineAddress = MachineAddressList.split(',')
# need to change number values type to integer
clusterNodesInt = int(clusterNodes)
# Connect String
connect(username,password,'t3s://'+adminHost+':'+adminSSLPort)
edit()
startEdit()
# Create Cache Cluster
cd('/')
print 'Creating ' +CacheClusterName+ ':'
cmo.createCoherenceClusterSystemResource(CacheClusterName)
cd('/CoherenceClusterSystemResources/'+CacheClusterName)
set('Targets',jarray.array([ObjectName('com.bea:Name='+WLclusterName+',Type=Cluster')], ObjectName))
cd('Resource/'+CacheClusterName+'/CoherenceClusterParams/'+CacheClusterName)
cmo.setUnicastPortAutoAdjust(false)
cmo.setUnicastListenAddress('localhost')
cmo.setUnicastListenPort(8888)
# Create the Coherence JVMs
def CreateCachemgd(CachemgdNamefnc,CachemgdPortfnc,machineNamefnc,machineAddressfnc,clusterNamefnc):
cd('/')
print "Creating mgdServer " +CachemgdNamefnc+ ":"
cmo.createCoherenceServer(CachemgdNamefnc)
cd('/CoherenceServers/'+CachemgdNamefnc)
cmo.setMachine(getMBean('/Machines/'+machineNamefnc))
cmo.setCoherenceClusterSystemResource(getMBean('/CoherenceClusterSystemResources/'+clusterNamefnc))
cmo.setUnicastListenAddress(machineAddressfnc)
cmo.setUnicastListenPort(CachemgdPortfnc)
cmo.setUnicastPortAutoAdjust(false)
cd('/CoherenceServers/'+CachemgdNamefnc+'/CoherenceServerStart/'+CachemgdNamefnc)
cmo.setJavaHome(javaHome)
cmo.setRootDirectory(domainDir+'/'+domainName)
cmo.setJavaVendor('Oracle')
cmo.setBeaHome(beaHome)
cmo.setClassPath(beaHome+'/modules/features/weblogic.server.modules.coherence.server_10.3.5.0.jar:'+beaHome+'/coherence_3.7/lib/coherence.jar')
cmo.setArguments('-Duser.timezone=GMT -Xverbose:gcreport,memory,gcpause -XverboseTimeStamp -
Xverboselog:/fmw/log/'+domainName+'/'+CacheClusterName+'/'+CachemgdNamefnc+'.gc -Xms1536m -Xmx1536m -Dtangosol.coherence.mode=prod
-Dtangosol.coherence.machine='+machineAddressfnc+' -Doracle.coherence.machine='+machineAddressfnc+' -
Dtangosol.coherence.cluster='+CacheClusterName+' -Dtangosol.coherence.localhost='+machineAddressfnc+' -
Dtangosol.coherence.localport='+str(CachemgdPortfnc)+' -Dtangosol.coherence.session.localstorage=true -
Dtangosol.coherence.log=/fmw/log/'+domainName+'/'+CacheClusterName+'/'+CachemgdNamefnc+'.out -
Dtangosol.coherence.override='+domainDir+'/'+domainName+'/config/coherence/'+CacheClusterName+'/tangosol-coherence-override.xml -
Dtangosol.coherence.management.remote=true')
nodes = 1
while nodes < = clusterNodesInt:
CachemgdPortInt = int(CachemgdPort[(nodes-1)])
CreateCachemgd(CachemgdName[(nodes-1)],CachemgdPortInt,machineName[(nodes-1)],machineAddress[(nodes-1)],CacheClusterName)
nodes += 1
save()
activate()
exit()
3) Update WLS JVMs to join the Coherence Cluster
The webapp which uses coherence is deployed on WLS cluster.
Next steps will prepare the WLS JVMs to join the Coherence cluster and WKA (Well Known Address) list as
members
On wl_pr1_01, add the below settings to arguments within the “server start” options.
-Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.mode=prod -
Dtangosol.coherence.localport.adjust=false -Dtangosol.coherence.machine=myTestMachine01.mydomain.com -
Doracle.coherence.machine=myTestMachine01.mydomain.com -Dtangosol.coherence.member=wl_pr1_01 -
Dtangosol.coherence.localhost=myTestMachine01.mydomain.com -Dtangosol.coherence.localport=9999 -
7. Dtangosol.coherence.override=/fmw/domains/myDomain/config/coherence/my_cache_cluster/tangosol-
coherence-override.xml
Similarly f or the other JVMs.
Local storage f lag (-Dtangosol.coherence.distributed.localstorage=f alse) is set to f alse since the WLS jvms
are clients.
To activate the changes, restart the WLS servers and Coherence servers.
To conf irm all the members successf ully join the coherence cluster, ref er to the coherence logs.
For inf ormation on conf iguring Enterprise Manager 12c f or Oracle Coherence please see this post.