My plan is to learn a new thing every two to three weeks. By sharing on this blog, will help me focus and hopefully help some readers. This is a hobby that I have been trying to exercise for quite a while now, but never could get it going for different reasons. Thanks
20120924
How to set and Start Coherence with WLST
Oracle Weblogic Server - Version 10.3.4 to 12.1.1.0
Oracle Coherence - Version 3.6.0 to 3.7.1.x
Different ways to start Coherence Servers using WLST?
Pre-requirements:
Node Manager should be running and please make sure that you have the following jar files on your classpath;
/home/Oracle/Middleware/121cJar/modules/features/weblogic.server.modules.coherence.server_12.1.1.0.jar:/home/Oracle/Middleware/121cJar/coherence-java-3.7.1.0b27797/coherence/lib/coherence.jar
Use the following links to create and set the Coherence Servers using the Admin Console:
http://docs.oracle.com/cd/E25054_01/apirefs.1111/e13952/taskhelp/coherence/CreateCoherenceServers.html
http://docs.oracle.com/cd/E25054_01/apirefs.1111/e13952/taskhelp/coherence/ConfigureStartupArgumentsForCoherenceServers.html
Ans1: Using the nmStart():
1. Start the WLST tool by setting the environmnet from Domain/bin directory:
$. bin/setDomainEnv.sh (cmd if Windows)
$java weblogic.WLST
2. Connect With the NM;
wls:/offline> nmConnect("weblogic","Welcome1","localhost","5556","12cjar","/home/Oracle/Domains/12cjar")
3. Start the Coherence server in which is named here as Server-0;
wls:/nm/12cjar> nmStart("Server-0",serverType="Coherence")
4. The Coherence server should be started:
Starting server Server-0 ...
Successfully started server Server-0 ...
Ans2: Now let use the CoherenceServerLifeCycleRuntimeMBean to start:
1. Set the domain environment from your WLS domain and run the following:
$java weblogic.WLST
2. Connect with your running AdminServer.
connect()
3. goto your domain Runtime.
domainRuntime()
4. goto your Coherence MBeam home.
cd("CoherenceServerLifeCycleRuntimes/Server-0")
5. and run the server using this command:
cmo.start()
The Server should be running by now....
Ans3: Goto the link bellow and you should see the startCoh.py and stopCoh.py, then is the matter of using the following command:
1. Create the files stopCoh.py and startCoh.py;
2. Goto bin directory of your domain.
3. Set your domian environments: $ . setDomainEnv.sh
4. Go back to the directory in which you created the two py files.
5. and run for example:
$java weblogic.WLST startCoh.py
ref: http://docs.oracle.com/cd/E24329_01/web.1211/e24442/coh_wls.htm#CIHDDAAE
Ans4: The Most common way is to use the Console, for that you can use Oracle's documentation:
http://docs.oracle.com/cd/E25054_01/apirefs.1111/e13952/taskhelp/coherence/StartCoherenceServers.html
20120810
Node Manager Starting Weblogic Server life cycle explained
Node Manager, is an java instance that ensure high availability of WLS servers with whole server migration and automatic restarting WLS nodes in case of unwanted shutdown. NM uses the ServerMBean, ServerStartMBean, and SSLMBean to set the JAVA_VENDOR, JAVA_HOME, JAVA_OPTIONS, SECURITY_POLICY, CLASSPATH, and ADMIN_URL. Therefore by using the NM to start a managed server does not necessary uses the domain's bin directory startWebLogic.sh or startWebLogic.cmd to start a node.
This is due because the flag StartScriptEnabled nodemanager.properties file is set to false by default; So this means that all the settings modification done, such as adding debug flags or adding a new jar on the classpath, on startWeblogic.sh will not be pick up or better saying will not be provided to the JVM.
So solve this unpleasant situation you can just go to wlserver_10.3/common/nodemanager directory and edit the nodemanager.properties as following:
StartScriptEnabled=true
Also, you need to pay attention on another configuration on the same file; The StartScriptName actually tells the NM which script should be use to start the WLS node. By default it uses the startWebLogic.sh, but you can create a new file in the domain's bin directory with all needed start-up configurations;
StartScriptName=startWebLogicModified.sh
Understand the some situations you are using the NM to start the WLS nodes without knowing; Sometimes this process seems to be unseeing by administrators. Bellow is the list of situations in which you may be using NM to start servers:
Admin Console - You need to have the NM running to start any instance.
WLST -
1. When you use the following WLST's commands:
start NM:offline>
startNodeManager()
Connect:
offline>
nmConnect('username','password','nmHost','nmPort','domainName','domainDir','nmType')
Start Server
:
wls:/nm/mydomain>
nmStart('AdminServer')
Stop Server:wls:/nm/mydomain
>nmKill('serverName')
2. When you use the WLST to connect to the AdminServer, therefore is just like when you use the Admin Console:
Connecting with AdminServer:(offline)>
connect('username','password')
Then you can start by using single server name or cluster:
wls:/mydomain/serverConfig>start('
managedServerName
','Server')
wls:/mydomain/serverConfig>start('
clusterName
', 'Cluster')
Pay attention that some basic rules must be follow, for NM to start a server:
2. Is one NM per physical machine; WLS has the great feature of extend a domain across physicals machines, so I insist again remember to assign the WLS nodes to the particular NM located on the same physical machine.
3. Remember that NM by default uses the ServerStartMBean to set the environment, so if you have edited the startWebLogic.sh the JVM will not pick up the changes. Unless, as explained, you modify these
StartScriptEnabled and StartScriptName accordingly with your requirements on the nodemanager.properties file.
StartScriptEnabled and StartScriptName accordingly with your requirements on the nodemanager.properties file.
Subscribe to:
Posts (Atom)