2. sysco.no
Agenda
âąAboutusand ourcompany
âąWhythispresentation?
âąInvolvedcomponents
âąHowto
âąWhat are the options?
âąOur recommendations
âąSample script âa walkthrough
âąQ&A
Info
3. sysco.no
Information about us
âąJon Petter Hjulstad, DeptManager Middleware, Sysco
âąCato Aune, Senior Consultant, Sysco
âąMiddlewareconsultantsâOslo, Norway
âąColleaguesin Lima, Peru
âąFocusingonBPM, SOA, WLS, EM, OVM
âąBlog: http://sysco.no/blogg/
Info
4. sysco.no
Information about SYSCO
âąIT company established 2004
âąContinuous growth, over 100 employees
âąOperations, development, consulting in technology and economics
âąCompetence in database technology, middleware
âąSpecial focus in the energy sector
âąEngineered Systems Partner of the YearNorway 2014
âą6 Locations in Norway, 1 in Peru
Info
5. sysco.no
Booting Oracle WebLogic
âWebLogic -advanced and flexible
oMakes it a bit complex
oMany choices that has to be made
âNo out-of-the-box start scripts
âMany resources on the Net
oSome good
oSome that might not fit your requirements
oSome not so optimal
6. sysco.no
Why automatic/scripted boot
âNo user intervention
oNo one has to be present (physical or âvirtualâ)
oLess error prone
oDo it the same way every time
âMakes it easier to start / stop single instances for the ops staff
âWant services to be restarted automatically if needed
âUse what is available in WLS
8. sysco.no
Sharing
âFeel free to use the scripts âas isâ or as a basis for your own enhancements to fit your requirements
âAll scripts, some more background information and suggestions for enhancement are in our blog http://sysco.no/blogg
10. sysco.no
Node Manager
Node Manager is a WebLogic Server utility that enables you to
âStart
âShut down
âRestart
Administration Server and Managed Server instances
11. sysco.no
Node Manager
BeforeWebLogic12.1.2
âOne Node Manager per server
âCentral Node Manager config
From WebLogic12.1.2
âOne Node Manager per domain(default)
âNode Manager configwithindomainhome
12. sysco.no
Starting an Administration Server
http://docs.oracle.com/middleware/1213/wls/NODEM/overview.htm#i1074930
13. sysco.no
Starting a Managed Server
http://docs.oracle.com/middleware/1213/wls/NODEM/overview.htm#i1074951
14. sysco.no
Restarting an Administration Server
http://docs.oracle.com/middleware/1213/wls/NODEM/overview.htm#i1074976
15. sysco.no
Restarting a Managed Server
http://docs.oracle.com/middleware/1213/wls/NODEM/overview.htm#i1074995
16. sysco.no
WebLogic Scripting Tool (WLST)
âWLST is based on Jython (Python)
âCan do pretty much everything with WLST
âBe sure to have correct path (source setDomainEnv.sh)
âRecording option in Admin Console, might be used as starting point for automation
17. sysco.no
Shell scripts called during boot
âStart Node Manager
oinit.d / xinit.d scripts for Linux
oScript to create a Windows service
âStart WebLogic
oCustom bash/cmd script for starting the AdminServer and managed servers
18. sysco.no
Different methods
Start script
Using WLST and Admin Server
Using WLST and Node Manager
Choose one method and stick with it
19. sysco.no
Start scripts
Generated when a domain is created
<domain home>/startWebLogic.sh
<domain home>/bin/startManagedWebLogic.sh
Works well, but make sure to use nohupand put the process in the background
$ nohupstartWeblogic.sh &
20. sysco.no
Using WLST and Admin Server
âPossible to start AdminServer
oNot recommended with Fusion Middleware suite products
âConnect to AdminServer to start managed servers
oconnect(userConfigFile=userFile, userKeyFile=keyFile, url=adminUrl)
ostart(...)
21. sysco.no
Using WLST and Admin Server
âRequires
oRunning AdminServer
oRunning Node Manager
oAdminServer communicates with Node Manager
âNode Manager sets the
oJAVA_VENDOR, JAVA_HOME, JAVA_OPTIONS
oSECURITY_POLICY,CLASSPATH, ADMIN_URL
22. sysco.no
Using WLST and Node Manager
âConnect to Node Manager
onmConnect
âStart AdminServerand managed servers
onmStart
âDoes not set the variables with information from AdminServer. Possible to provide this information manually along with nmStart
24. sysco.no
Recommendations
âIt is recommended to always use Node Manager to start AdminServer and managed servers
âIt is recommended to let Node Manager use start script (StartScriptEnabled=true)
âIt is recommended to start from AdminServer to give server start arguments and SSL arguments to Node Manager
25. sysco.no
Our approach
âEnable start script in Node Manager (StartScriptEnabled=true in nodemanager.properties)
âConnect to Node Manager and start AdminServer
âConnect to AdminServer and start managed servers
26. sysco.no
Put it together -wls.py
import sys
def startAdmin():
print 'Starting AdminServer'
nmConnect(userConfigFile=nmUserFile,
userKeyFile=nmKeyFile, host=nmHost,
port=nmPort, domainName=domain,
domainDir=domainPath, nmType=nmType)
nmStart('AdminServer')
nmDisconnect()
return
34. sysco.no
Encrypt credentials in 11g
Deprecated in 12c but still works
For Node Manager:
$ java weblogic.Admin
-username nodemanager
-userconfigfile /u01/app/oracle/config/nmUserFile-userkeyfile /u01/app/oracle/config/nmKeyFileSTOREUSERCONFIG
35. sysco.no
Encrypt credentials in 11g
Enter the password for user nodemanager:
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or n y
36. sysco.no
Encrypt credentials in 11g
For WebLogic:
$ javaweblogic.Admin
-usernameweblogic
-userconfigfile/u01/app/oracle/config/wlsUserFile-userkeyfile/u01/app/oracle/config/wlsKeyFileSTOREUSERCONFIG
37. sysco.no
Encrypt credentials in 12c
wls:/offline> nmConnect(
ânodemanager','welcome1','localhost',5556,'mydomain',
'/u01/app/oracle/user_projects/domains/mydomain',
'plain')
Currentlyconnectedto Node Manager to monitor thedomainmydomain.
38. sysco.no
Encrypt credentials in 12c -NM
wls:/mydomain/serverConfig> storeUserConfig(
'/u01/app/oracle/config/nmUserFile',
'/u01/app/oracle/config/nmKeyFile',
'true')
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or n:y
39. sysco.no
Encrypt credentials in 12c -WLS
wls:/mydomain/serverConfig> storeUserConfig(
'/u01/app/oracle/config/wlsUserFile',
'/u01/app/oracle/config/wlsKeyFile',
'false')
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or n:y
40. sysco.no
OS boot scripts -Linux
/etc/init.d/nodemanager(dependsonnetwork)
Script is availablein theOracle documentation,
butyouhave to do somemodifications
http://docs.oracle.com/middleware/1213/wls/NODEM/java_nodemgr.htm#BABJIDFD
/etc/init.d/weblogic(dependsonnodemanager)
# Required-Start: $nodemanager
PROGRAM_START="$BOOT_HOME/startall.sh"
PROGRAM_STOP="$BOOT_HOME/stopall.sh"
43. sysco.no
OS boot scripts -Windows
Starting Node Manager as a Windows service is supported out-of-the- box.
Follow the instructions in the documentation (or on the next slides)
NB!
-XrsJVM property for each Managed Server that will be under Node Manager control.
44. sysco.no
Windows -Node Manager
1. Log in to the machine with Administrator privileges.
2. Open a DOS command prompt window.
3. Change to the DOMAIN_HOMEbindirectory.
45. sysco.no
Windows -Node Manager
4. Enter the following command:
installNodeMgrSvc.cmd
5. After a few seconds, the following message is displayed:
Oracle WebLogic <domain-name> NodeManager installed.