Successfully reported this slideshow.
Your SlideShare is downloading. ×

Oracle Middleware Forum Canberra: CI Fundamentals - WLST

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 13 Ad

Oracle Middleware Forum Canberra: CI Fundamentals - WLST

Download to read offline

Presentation from the Oracle Middleware Forum Canberra. This covers the fundamentals of WLST. Check out ofmcanberra.wordpress.com for more information as well as links to the resources mentioned in this presentation

Presentation from the Oracle Middleware Forum Canberra. This covers the fundamentals of WLST. Check out ofmcanberra.wordpress.com for more information as well as links to the resources mentioned in this presentation

Advertisement
Advertisement

More Related Content

Recently uploaded (20)

Advertisement

Oracle Middleware Forum Canberra: CI Fundamentals - WLST

  1. 1. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Continuous Integration Fundamentals WLST Joel Nation, Senior Solution Architect
  2. 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | WebLogic Scripting Tool (WLST) • Scripting tool for administering a domain • Based on Jython • Great for automating repetitive tasks – Configuring domains – Creating domains – Starting servers – Deploy applications 2
  3. 3. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | How to use it • Via command line: – java weblogic.WLST – wlst.sh • With a jython script – wlst.sh script.py • This will set the domain environment variables • In Java code – import weblogic.management.scripting.utils.WLSTInterpreter
  4. 4. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Online/Offline • Online mode: connect to a running admin or managed server – Modifies server’s config MBeans directly – Equivalent to manual changes in the WebLogic console • Offline mode: not connected to a running domain – Offline edits on a running domain will be ignored Online Offline Create/modify templates X Create/extend domains X Change domain configuration X Limited View runtime performance data X Modify security data X Deploy applications X
  5. 5. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Example 1: Modify Listen Port readDomain(‘<path to domain>’) cd(‘Server/AdminServer’) set(‘ListenPort’, 7777) updateDomain() exit() 5
  6. 6. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Example 2: Recording • You can record your changes in the WebLogic console – Note: Not all changes will be recorded • This will output a script of all the changes you made • Use this to upgrade any other domains, or use this as a basis for your domain creation script
  7. 7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Templates • Use domain templates to create a domain – Several shipped with WLS – Create your own using Template Builder – Modify an existing template using WLST offline • Use templates when domain is complete – Use scripts when developing your domain WLS WLS
  8. 8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Example 3: Build domain https://github.com/Joelith/wlst/blob/master/OSB/osb_domain.py
  9. 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Example 4: Starting Servers https://github.com/Joelith/wlst/blob/master/OSB/osb_build.sh • startServer() • Recommended to use node manager: – nmStart() • Make sure ‘StartScriptEnabled’ is set in your node manager properties – Otherwise, pass startup properties to nmStart. Eg: args = "Arguments=" -server -Xms512m -Xmx768m -XX:MaxPermSize=256m -Xrs"" prps = makePropertiesObject(args) nmStart('AdminServer', props=prps)
  10. 10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Deployments • Online: – Use the deploy command: deploy(appName, path) • Offline: – Add an application to a template: addApplication(appName) • OSB (online): – Get a session, upload the JAR, activate the session
  11. 11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Example 5: OSB Deployment https://github.com/Joelith/wlst/blob/master/OSB/osb_deploy.py
  12. 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Make Life Easier • Install rlwords so you can use directional arrows – Install EPEL – Download word list from https://blogs.oracle.com/johngraves/resource/code/wlst.words – Add an alias for wlst in bash_profile alias wlst='rlwrap -f /home/oracle/.rlwords --multi-line java weblogic.WLST' • Use a syntax highlighter for scripts – WLST Sublime plugin: https://github.com/Joelith/sublime-wlst (or use PackageControl) • Disable module scanning on WLST startup with -skipWLSModuleScanning • Language reference: http://docs.oracle.com/cd/E13222_01/wls/docs90/config_scripting/reference.html
  13. 13. 13

×