SlideShare une entreprise Scribd logo
1  sur  39
WEBLOGIC ADMINISTRATION UND
DEPLOYMENT MIT WLST

            „Infrastructure as Code“

Oracle WebLogic Scripting Tool
                           Best Practices
                                            Andreas Koop
                                                     Consultant
                                            Oracle Technologies




DOAG SIG Middleware, Köln, 29. Aug. 2012
Andreas Koop
ÜBER MICH                                                          Consultant
                                                          Oracle Technologies




Beratung, Training Oracle Technologie
ADF Certified Implementation Specialist


Community
DOAG, ADF EMG, ADF German Community, Twitter @multikoop


Blog
Technical http://multikoop.blogspot.com
Sonstiges http://www.enpit.de/blog



                                          2
ENTERPRISE.PRAGMATIC.IT




   Consulting                  Training                Development
 Oracle Fusion         Oracle                 Oracle        Oracle
  Middleware          WebCenter                ADF         WebLogic

Enable productive IT by Oracle Technologies
AGENDA

Motivation „Infrastructure as Code“

Überblick WebLogic Scripting Tool

Best Practices Administration und Deployment




Andreas Koop               4
INFRASTRUCTURE AS CODE
‣       Vision - Bereitstellung einer
        lauffähigen Umgebung aus

    ‣          Source Code Repository

    ‣          Anwendungsdaten (Backup)

    ‣          Ressourcen (Physikalisch /
               Virtuell)

‣       In Zeiten von Cloud und steigendem Bedarf nach horizontal skalierbaren
        System ist IaC unabdingbar



Andreas Koop                                5
RESTORE ENV FROM CODE
                      app source

                                     App
                                      App
      SCM                              App
                                   Artefacts
                                    Artefacts
                                     Artefacts

               infra source




DB / Service
 Endpoints             configuration /   Sh, Chef, WLST, ...
                           data /
                          backup




Andreas Koop                                              6
WAS BRAUCHT EINE
ORACLE FMW UMGEBUNG?
‣      WebLogic Installation, Domain       ‣       WebLogic Konfiguration

‣      Application Deployment                  ‣     Data Sources

‣      System and Performance                  ‣     Message Queues
       Monitoring
                                               ‣     Logging

                                               ‣     Diagnostics (WLDF)
                   App1         App2


                                               ‣     Security Provider

                                               ‣     ...

Andreas Koop                           7
MANUELLE KONFIGURATION
IST KEINE LÖSUNG




Andreas Koop   8
WEBLOGIC SCRIPTING TOOL
‣       Jython basierte Scriptsprache zur Automatisierung jeglicher WebLogic
        Administrationsaufgabe

‣       Read / Write MBeans

‣       Offline

    ‣          ~ Configuration
               Wizard

‣       Online

    ‣          ~ Administration Console

Andreas Koop                              9
DOMAIN ERSTELLEN
readTemplate(os.environ['WL_HOME'] + '/common/templates/
domains/wls.jar')
cd('/')                    Current
cmo.setName('my_domain')   Management
cd('Servers/AdminServer') Object
cmo.setListenAddress( 'All Local Addresses' )
cmo.setListenPort( int(ADMIN_PORT) )
cd( '/' )
cd( 'Security/'+DOMAIN_NAME+'/User/' + ADMIN_USER )
cmo.setPassword( ADMIN_PWD )
cd('/')
setOption( 'JavaHome', os.environ['JAVA_HOME'] )
setOption( "ServerStartMode", "prod")
setOption( "OverwriteDomain", "true" )

writeDomain( DOMAIN_DIR )
closeTemplate()


Andreas Koop                 10
DOMAIN ERWEITERN

# Z.B. um die ADF Runtime in Form der JRF
readDomain(DOMAIN_DIR)

addTemplate(MW_HOME + '/oracle_common/
common/templates/applications/jrf_templ
ate_11.1.1.jar')
updateDomain()
closeDomain()

exit()




Andreas Koop                 11
WLST EXECUTION
BEST PRACTICE (OFFLINE)
#!/bin/sh

export DOMAIN_HOME=/oracle/fmw 
/11.1.1.6/user_projects/domains 
/my_domain
export DOMAIN_NAME=my_domain
...
                                       readTemplate(os.environ['WL_HOME'] + '/
                   env/env.sh          common/templates/domains/wls.jar')
                                       cd('/')
                                       cmo.setName(os.environ['DOMAIN_NAME'])
#!/bin/sh
                                       cd('Servers/AdminServer')
                                       cmo.setListenAddress( 'All Local
. $PRJ_HOME/env/env.sh
                                       Addresses' )
. $DOMAIN_HOME/bin/setDomainEnv.sh
                                       cmo.setListenPort( int(
                                       WL_ADMIN_PORT) )
cd $PRJ_HOME/bin/wlst
                                       ...
java weblogic.WLST create.domain.py
                                       writeDomain( DOMAIN_DIR )
cd -
                                       closeTemplate()


               bin/create.domain.sh              bin/wlst/create.domain.py
Andreas Koop                          12
WLST EXECUTION
BEST PRACTICE (OFFLINE)




Andreas Koop   13
WLST ONLINE
  connect('weblogic', 'welcome1', 't3://adminhost:7001')

  edit()
  startEdit()

  # do something

  save()
  activate()

  disconnect()
  exit()




Andreas Koop                  14
DOMAIN ERWEITERN
 connect('weblogic', 'welcome1', 't3://adminhost:7001')
 edit()
 startEdit()

 cmo.createServer(os.environ['MS_NAME'])

 cd('/Servers/'+ os.environ['MS_NAME'])
 cmo.setListenAddress('')
 cmo.setListenPort(os.environ['MS_PORT'])
 cmo.setListenPortEnabled(true)
 cmo.setJavaCompiler('javac')
 cmo.setMachine(getMBean('/Machines/Machine1'))
 cmo.setCluster('Cluster1')

 cd('/Servers/'+os.environ['MS_NAME']+'/SSL/'+os.environ['MS_NAME'])
 cmo.setEnabled(false)

 cd('/Servers/'+os.environ['MS_NAME']+'/ServerStart/'+os.environ['MS_NAME'])
 cmo.setArguments('-Xms512M -Xmx1024M')

 save()
 activate()
 disconnect()

                           bin/wlst/create.server.py
Andreas Koop                            15
MODULARIZE WLST SCRIPTS
                                       connect('weblogic', 'welco..)


   execfile('connect.py')
    execfile('connect.py')                           edit()
     execfile('connect.py')
   execfile('start.edit.session.py')                 startEdit()
    execfile('start.edit.session.py')
     execfile('start.edit.session.py')
   ## do something
     # do something
        do something
                                                     try:
   execfile('end.edit.session.py')
    execfile('end.edit.session.py')                     save()
     execfile('end.edit.session.py')
   execfile('disconnect.py')
    execfile('disconnect.py')
     execfile('disconnect.py')                          activate()
   exit()
    exit()                                           except ...
     exit()
                                                     ..
               bin/wlst/myscriptX.py

                                   disconnect()



Andreas Koop                             16
MODULARIZE WLST SCRIPTS
EVEN MORE
  # Custom Functions
  import os

  def getDomainName():
    return os.environ['DOMAIN_NAME']                  $WL_HOME/
  def startEditSession():                             common/wlst
    logInfo('start edit session')
    edit()
    startEdit()
  ...
                                                        Custom
                                                        Functions
               bin/wlst/modules/enpit.utils.py          stehen dann
                                                        alle Skripten
                            ..                          zur
                            startEditSession()          Verfügung
                            # do something
                            saveAndActivate()
                            ..

Andreas Koop                                     17
WLST DOMAIN INTERACTION




                    Quelle: Oracle FMW Doc Lib



Andreas Koop   18
DOMAIN STARTUP
nmConnect('Dh4bZwJNNP', 'welcome1', DOMAIN_NAME, NM_PORT)

nmStart('AdminServer')
nmStart('WLS_FORMS')
nmStart('WLS_REPORTS')
nmStart('WLS_DISCO')
nmStart('WLS_MY_APPS')
..

nmDisconnect()
exit()




                         bin/wlst/start.domain.py
Andreas Koop                      19
WLST NODE MANAGER
ENCRYPTED PASSWORD


  nmConnect('Dh4bZwJNNP', 'welcome1', DOMAIN_NAME, NM_PORT)
  storeUserConfig(userConfigFile = .., userKeyFile = .., true)
  disconnect()

  # Ab jetzt: Anmeldung ohne   Passwort im Klartext
  nmConnect(userConfigFile =   NM_HOME + '/userconfigNM.secure',
            userKeyFile    =   NM_HOME + '/userkeyNM.secure',
            domainName     =   DOMAIN_NAME, port='5556')
  exit()

Andreas Koop                    20
DOMAIN SHUTDOWN
NM_HOME = WL_HOME + '/common/nodemanager'
nmConnect(userConfigFile = NM_HOME + '/userconfigNM.secure',
          userKeyFile    = NM_HOME + '/userkeyNM.secure',
          domainName     = DOMAIN_NAME, port='5556')

nmKill('WLS_FORMS')
nmKill('WLS_REPORTS')
nmKill('WLS_DISCO')
nmKill('WLS_MY_APPS')
..
nmKill('AdminServer')

nmDisconnect()
exit()



                    bin/wlst/shutdown.domain.py
Andreas Koop                   21
LOGGING LOGGING LOGGING
‣       Never-Ending-Story

‣       Was tun? Was berücksichtigen?

    ‣          Log Rotating

    ‣          Domain Log

    ‣          Server Logs

‣       „Wo sind die Log-Files???“




Andreas Koop                            22
LOGGING KONFIGURATION
  execfile('connect.py')
  execfile('start.edit.session.py')


  cd('/Servers/AdminServer/Log/AdminServer')
  cmo.setStacktraceDepth(5)
  cmo.setRotationType('bySize')
  cmo.setDomainLogBroadcasterBufferSize(10)
  cmo.setLog4jLoggingEnabled(false)
  cmo.setNumberOfFilesLimited(false)
  cmo.setDateFormatPattern('dd.MM.yyyy HH:mm' Uhr 'z')
  cmo.setBufferSizeKB(8)
  cmo.setFileMinSize(5000)
  cmo.setLoggerSeverity('Info')
  cmo.setRotateLogOnStartup(false)
  ..
  cmo.setRedirectStdoutToServerLogEnabled(true)
  cmo.setFileName('logs/AdminServer.log')
  execfile('end.edit.session.py')
  execfile('disconnect.py')
  exit()




Andreas Koop                           23
DEPLOYMENT
‣       Data Source vorbereiten
                                       Java EE App
‣       Targets
                                                            deploy
‣       Deploy

    ‣          Application

    ‣          Shared Libs                           App1            App2



    ‣          EJBs




Andreas Koop                      24
DATA SOURCE ANLEGEN
‣ JNDI Lookup
#connect(..), edit() startEdit()
cd('/')
create('myDataSource', 'JDBCSystemResource')
cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDriverParams','JDBCDriverParams')
cd('JDBCDriverParams/myDSName')
set('DriverName','oracle.jdbc.OracleDriver')
set('URL','jdbc:oracle:thin:@localhost:1521:XE')
set('Password', 'HR')
set('UseXADataSourceInterface', 'false')
create('myProps','Properties')
cd('Properties/myDSName')
create('user', 'Property')
cd('Property/user')
cmo.setValue('HR')
..
cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDataSourceParams','JDBCDataSourceParams')
cd('JDBCDataSourceParams/myDSName')
set('JNDIName', java.lang.String("jdbc/hrDS"))




Andreas Koop                           25
DATA SOURCE
ENCRYPTED PASSWORD
Shell
  akmac2:doag1_domain ak$ . ./bin/setDomainEnv.sh
  akmac2:doag1_domain ak$ java weblogic.security.Encrypt HR

  {AES}s77UdlHeZXMziW4i8WoPxBSN/DovWtnpYEPTJbBQ70M=



create.datasource.py
  ..
  cd('/')
  create('myDataSource', 'JDBCSystemResource')
  ..
  set('PasswordEncrypted', '{AES}s77UdlHeZXMziW4i8WoPxBSN/DovWtnpYEPTJbBQ70M=')
  ..

  set('Targets',jarray.array([ObjectName('com.bea:Name=MS1,Type=Server')],
  ObjectName))




Andreas Koop                           26
APPLICATION DEPLOYMENT
‣       2 Phasen
                                             Java EE App
    ‣          Vorbereiten

    ‣          Deployment Durchführen               deploy

‣       Modi

    ‣          No Stage                                    App1   App2



    ‣          Stage

    ‣          External Stage

Andreas Koop                            27
HOW TO DEPLOY

  connect('weblogic', 'welcome1', ADMIN_URL)

  deploy('myApp', '/path/to/myApp.ear', targets='Cluster1')
  # targets='Server1'
  startApplication('myApp')


  disconnect()
  exit()




Andreas Koop                           28
HOW TO UNDEPLOY

  connect('weblogic', 'welcome1', ADMIN_URL)


  stopApplication('myApp')
  undeploy('myApp')
  # default: from all targets

  disconnect()
  exit()




Andreas Koop                           29
DEPLOYMENT COMMANDS
Command

deploy(appName, path, [targets], [stageMode], [planPath], [options])

startApplication(appName, [options])

stopApplication(appName, [options])

undeploy(appName,[targets],[options])

                                                                       Mittels plan.xml
updateApplication(appName, [planPath], [options])
                                                                       aktualisieren
listApplications()




Andreas Koop                                30
HOW TO RELAX
(CUSTOM SOLUTION)                                        Keep last 10 EARs
‣      ...falls das Deployment mal                      2012-08-02-myapp.ear
                                                         2012-08-02-myapp.ear
                                                          2012-08-02-myapp.ear
       nicht reibungslos läuft?

‣      Deploy And Backup EAR         deploy(...)
                                     shutil.copy(...)




‣      Restore          def restore():
                          #Get last EAR
                          #deploy(lastEAR)
                                                               myapp




Andreas Koop                            31
SIDE-BY-SIDY DEPLOYMENT
  deploy('myApp', '/path/to/myApp.ear', ..,appVersion = '1.0')


               Bestehende Client-
                 Verbindungen



                        app v1.0            app v2.0




                                      Neue Client-
                                      Verbindungen
  deploy('myApp', '/path/to/myApp.ear', ..,appVersion = '2.0')


Andreas Koop                           32
SERVER MONITORING
  ..
  state('<ServerName>')

  ..



  domainConfig()
  serverNames = cmo.getServers()
  domainRuntime()
  for name in serverNames:
    cd("/ServerRuntimes/"+name.getName()+"/JVMRuntime/"+name.getName())
    heapFree = int(get('HeapFreeCurrent'))/(1024*1024)
    heapTotal = int(get('HeapSizeCurrent'))/(1024*1024)
    heapUsed = (heapTotal - heapFree)
    print '%14s %4d MB %4d MB %4d MB' % (name.getName(),heapTotal, heapFree, heapUsed)




Andreas Koop                                    33
SERVER THREAD DUMP
  ..
  threadDump(writeToFile='true',fileName='/tmp/threaddump.txt',
  serverName='AdminServer')

  ..




Andreas Koop                           34
DOMAIN CONFIG AS CODE
Domain Configuration
wls:offline>configToScript(configPath='$DH',
pyPath='config.mydomain.py')

MDS per Application
wls:online>exportMetadata(application='doag-
demo', server='AdminServer', toLocation='/tmp/exportmds'


User / Groups Embedded LDAP
wls:online> domainRuntime() cd(‘/DomainServices/
DomainRuntimeService/DomainConfiguration/<domain>/
SecurityConfiguration/<domain>/DefaultRealm/myre alm/
AuthenticationProviders/DefaultAuthenticator’)
cmo.exportData('DefaultAtn', '/export.ldif', Properties())


Andreas Koop                 35
WLST RECORDING FEATURE
‣      WebLogic Console Record (Aufzeichnen)-Button klicken




‣      Gewünschte Konfiguration vornehmen

‣      Generiertes WLST-Skript anpassen und integrieren




Andreas Koop                          36
CONCLUSION
‣       WLST RULEZ!

‣       MUST for every Oracle FMW Admin!

‣       Vollständige Automatisierung von

    ‣          Domainerstellung, -konfiguration

    ‣          Application, Library Deployment

    ‣          Export / Import MDS

    ‣          Server - Startup / Shutdown - Monitoring

Andreas Koop                                37
VIELEN DANK FÜR IHRE
   AUFMERKSAMKEIT



HABEN SIE NOCH FRAGEN?
WebLogic Administration und Deployment mit WLST

Contenu connexe

Tendances

[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...
[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...
[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...
オラクルエンジニア通信
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic Concepts
James Bayer
 
最新 ASP.NET Web 開発オーバービュー
最新 ASP.NET Web 開発オーバービュー最新 ASP.NET Web 開発オーバービュー
最新 ASP.NET Web 開発オーバービュー
Akira Inoue
 

Tendances (20)

Oracle Advanced Security Data Redactionのご紹介
Oracle Advanced Security Data Redactionのご紹介Oracle Advanced Security Data Redactionのご紹介
Oracle Advanced Security Data Redactionのご紹介
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
 
Oracle 資料庫建立
Oracle 資料庫建立Oracle 資料庫建立
Oracle 資料庫建立
 
WebLogic 12c & WebLogic Mgmt Pack
WebLogic 12c & WebLogic Mgmt PackWebLogic 12c & WebLogic Mgmt Pack
WebLogic 12c & WebLogic Mgmt Pack
 
Em13c New Features- Two of Two
Em13c New Features- Two of TwoEm13c New Features- Two of Two
Em13c New Features- Two of Two
 
GitLab과 Kubernetes를 통한 CI/CD 구축
GitLab과 Kubernetes를 통한 CI/CD 구축GitLab과 Kubernetes를 통한 CI/CD 구축
GitLab과 Kubernetes를 통한 CI/CD 구축
 
[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...
[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...
[Oracle DBA & Developer Day 2016] しばちょう先生の特別講義!!ストレージ管理のベストプラクティス ~ASMからExada...
 
Setup Oracle eBS 2 Oracle BI SSO
Setup Oracle eBS 2 Oracle BI SSOSetup Oracle eBS 2 Oracle BI SSO
Setup Oracle eBS 2 Oracle BI SSO
 
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cMaximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19c
 
Oracle EBS R12.2 - Deployment and System Administration
Oracle EBS R12.2 - Deployment and System AdministrationOracle EBS R12.2 - Deployment and System Administration
Oracle EBS R12.2 - Deployment and System Administration
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic Concepts
 
Oracle Database Vaultのご紹介
Oracle Database Vaultのご紹介Oracle Database Vaultのご紹介
Oracle Database Vaultのご紹介
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
 
最新 ASP.NET Web 開発オーバービュー
最新 ASP.NET Web 開発オーバービュー最新 ASP.NET Web 開発オーバービュー
最新 ASP.NET Web 開発オーバービュー
 
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
 
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
 
Active directory slides
Active directory slidesActive directory slides
Active directory slides
 
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
 
MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetes
 
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
 

En vedette

Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
enpit GmbH & Co. KG
 
Missing-Value Handling in Dynamic Model Estimation using IMPL
Missing-Value Handling in Dynamic Model Estimation using IMPL Missing-Value Handling in Dynamic Model Estimation using IMPL
Missing-Value Handling in Dynamic Model Estimation using IMPL
Alkis Vazacopoulos
 
Prezentare Your Promo Innovaty
Prezentare Your Promo InnovatyPrezentare Your Promo Innovaty
Prezentare Your Promo Innovaty
Andreea Vladau
 
Action, enaction, inter(en)ation schiavio
Action, enaction, inter(en)ation   schiavioAction, enaction, inter(en)ation   schiavio
Action, enaction, inter(en)ation schiavio
María Marchiano
 
Impact Communication Agency
Impact Communication AgencyImpact Communication Agency
Impact Communication Agency
Lusanda Khanyile
 
IFLA-illustrated-presentation June2015
IFLA-illustrated-presentation June2015IFLA-illustrated-presentation June2015
IFLA-illustrated-presentation June2015
Mary Minicka
 

En vedette (20)

Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
 
Infrastructure as Code for Beginners
Infrastructure as Code for BeginnersInfrastructure as Code for Beginners
Infrastructure as Code for Beginners
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
 
Puppetconf2016 Puppet on Windows
Puppetconf2016 Puppet on WindowsPuppetconf2016 Puppet on Windows
Puppetconf2016 Puppet on Windows
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Mastering DevOps With Oracle
Mastering DevOps With OracleMastering DevOps With Oracle
Mastering DevOps With Oracle
 
Missing-Value Handling in Dynamic Model Estimation using IMPL
Missing-Value Handling in Dynamic Model Estimation using IMPL Missing-Value Handling in Dynamic Model Estimation using IMPL
Missing-Value Handling in Dynamic Model Estimation using IMPL
 
Customer service innovations - presentation for Kyiv Mohyla Business School
Customer service innovations - presentation for Kyiv Mohyla Business SchoolCustomer service innovations - presentation for Kyiv Mohyla Business School
Customer service innovations - presentation for Kyiv Mohyla Business School
 
Sweden presentation by Rien Sibarani
Sweden presentation by Rien SibaraniSweden presentation by Rien Sibarani
Sweden presentation by Rien Sibarani
 
From Waterfall to Agile - Six Months In
From Waterfall to Agile - Six Months InFrom Waterfall to Agile - Six Months In
From Waterfall to Agile - Six Months In
 
Prezentare Your Promo Innovaty
Prezentare Your Promo InnovatyPrezentare Your Promo Innovaty
Prezentare Your Promo Innovaty
 
Analytical thinking 11 - August 2012
Analytical thinking 11 - August 2012Analytical thinking 11 - August 2012
Analytical thinking 11 - August 2012
 
Solid Bytes ICT bedrijfspresentatie
Solid Bytes ICT bedrijfspresentatieSolid Bytes ICT bedrijfspresentatie
Solid Bytes ICT bedrijfspresentatie
 
Action, enaction, inter(en)ation schiavio
Action, enaction, inter(en)ation   schiavioAction, enaction, inter(en)ation   schiavio
Action, enaction, inter(en)ation schiavio
 
Audition
AuditionAudition
Audition
 
Impact Communication Agency
Impact Communication AgencyImpact Communication Agency
Impact Communication Agency
 
annadanilovacv.doc
annadanilovacv.docannadanilovacv.doc
annadanilovacv.doc
 
Stuck in Neutral...Mapping Your Business Future
Stuck in Neutral...Mapping Your Business FutureStuck in Neutral...Mapping Your Business Future
Stuck in Neutral...Mapping Your Business Future
 
IFLA-illustrated-presentation June2015
IFLA-illustrated-presentation June2015IFLA-illustrated-presentation June2015
IFLA-illustrated-presentation June2015
 
Feasibility requirements group 3 compiled
Feasibility requirements group 3   compiledFeasibility requirements group 3   compiled
Feasibility requirements group 3 compiled
 

Similaire à WebLogic Administration und Deployment mit WLST

Similaire à WebLogic Administration und Deployment mit WLST (20)

Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
One Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12cOne Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12c
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
 
Book
BookBook
Book
 
AKS - Azure Kubernetes Services 101
AKS - Azure Kubernetes Services 101AKS - Azure Kubernetes Services 101
AKS - Azure Kubernetes Services 101
 
Play framework
Play frameworkPlay framework
Play framework
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on Docker
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Booting Weblogic - OOW14
Booting Weblogic - OOW14Booting Weblogic - OOW14
Booting Weblogic - OOW14
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM BluemixContinuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
 
Create a Database Application Development Environment with Docker
Create a Database Application Development Environment with DockerCreate a Database Application Development Environment with Docker
Create a Database Application Development Environment with Docker
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Ato2019 weave-services-istio
Ato2019 weave-services-istioAto2019 weave-services-istio
Ato2019 weave-services-istio
 
All Things Open 2019 weave-services-istio
All Things Open 2019 weave-services-istioAll Things Open 2019 weave-services-istio
All Things Open 2019 weave-services-istio
 
Weave Your Microservices with Istio
Weave Your Microservices with IstioWeave Your Microservices with Istio
Weave Your Microservices with Istio
 

Plus de enpit GmbH & Co. KG

Agilität und Microservices als Chance für Modernisierung?
Agilität und Microservices als Chance für Modernisierung?Agilität und Microservices als Chance für Modernisierung?
Agilität und Microservices als Chance für Modernisierung?
enpit GmbH & Co. KG
 
Die 5 Mythen der Forms-Modernisierung
Die 5 Mythen der Forms-ModernisierungDie 5 Mythen der Forms-Modernisierung
Die 5 Mythen der Forms-Modernisierung
enpit GmbH & Co. KG
 

Plus de enpit GmbH & Co. KG (20)

Von Big Data zu Künstlicher Intelligenz - Maschinelles Lernen auf dem Vormarsch
Von Big Data zu Künstlicher Intelligenz - Maschinelles Lernen auf dem VormarschVon Big Data zu Künstlicher Intelligenz - Maschinelles Lernen auf dem Vormarsch
Von Big Data zu Künstlicher Intelligenz - Maschinelles Lernen auf dem Vormarsch
 
Mit Legosteinen Maschinelles Lernen lernen
Mit Legosteinen Maschinelles Lernen lernenMit Legosteinen Maschinelles Lernen lernen
Mit Legosteinen Maschinelles Lernen lernen
 
Cloud-native Apps – Architektur, Implementierung, Demo
Cloud-native Apps – Architektur, Implementierung, DemoCloud-native Apps – Architektur, Implementierung, Demo
Cloud-native Apps – Architektur, Implementierung, Demo
 
Development in der Cloud-Ära
Development in der Cloud-ÄraDevelopment in der Cloud-Ära
Development in der Cloud-Ära
 
Client side webdevelopment with jet
Client side webdevelopment with jetClient side webdevelopment with jet
Client side webdevelopment with jet
 
Best Practices für Last- und Performancetests von Enterprise Applikationen au...
Best Practices für Last- und Performancetests von Enterprise Applikationen au...Best Practices für Last- und Performancetests von Enterprise Applikationen au...
Best Practices für Last- und Performancetests von Enterprise Applikationen au...
 
Agilität und Microservices als Chance für Modernisierung?
Agilität und Microservices als Chance für Modernisierung?Agilität und Microservices als Chance für Modernisierung?
Agilität und Microservices als Chance für Modernisierung?
 
REST in Peace - Mit ORDS, Node.JS, ADF, Java oder OSB?
REST in Peace  - Mit ORDS, Node.JS, ADF, Java oder OSB?REST in Peace  - Mit ORDS, Node.JS, ADF, Java oder OSB?
REST in Peace - Mit ORDS, Node.JS, ADF, Java oder OSB?
 
WebLogic im Docker Container
WebLogic im Docker ContainerWebLogic im Docker Container
WebLogic im Docker Container
 
Modernisierung in Zeiten wie diesen
Modernisierung in Zeiten wie diesenModernisierung in Zeiten wie diesen
Modernisierung in Zeiten wie diesen
 
Die 5 Mythen der Forms-Modernisierung
Die 5 Mythen der Forms-ModernisierungDie 5 Mythen der Forms-Modernisierung
Die 5 Mythen der Forms-Modernisierung
 
Was ist Docker?
Was ist Docker?Was ist Docker?
Was ist Docker?
 
Choice-o-mat - Entscheidungshilfe für Oracles Entwicklungswerkzeuge
Choice-o-mat - Entscheidungshilfe für Oracles EntwicklungswerkzeugeChoice-o-mat - Entscheidungshilfe für Oracles Entwicklungswerkzeuge
Choice-o-mat - Entscheidungshilfe für Oracles Entwicklungswerkzeuge
 
Visualisierung von fachlichen Informationen mit Oracle ADF
Visualisierung von fachlichen Informationen mit Oracle ADFVisualisierung von fachlichen Informationen mit Oracle ADF
Visualisierung von fachlichen Informationen mit Oracle ADF
 
WebCenter Portal - Integrate Custom taskflows
WebCenter Portal - Integrate Custom taskflowsWebCenter Portal - Integrate Custom taskflows
WebCenter Portal - Integrate Custom taskflows
 
Java WebApps und Services on Oracle Java Cloud Service
Java WebApps und Services on Oracle Java Cloud ServiceJava WebApps und Services on Oracle Java Cloud Service
Java WebApps und Services on Oracle Java Cloud Service
 
Rapid Application Development (RAD) im Enterprise - Quo vadis Portal?
Rapid Application Development (RAD) im Enterprise - Quo vadis Portal?Rapid Application Development (RAD) im Enterprise - Quo vadis Portal?
Rapid Application Development (RAD) im Enterprise - Quo vadis Portal?
 
Best Practices für Multi-Channel Application Development
Best Practices für Multi-Channel Application DevelopmentBest Practices für Multi-Channel Application Development
Best Practices für Multi-Channel Application Development
 
Gestern OWB, heute ODI
Gestern OWB, heute ODIGestern OWB, heute ODI
Gestern OWB, heute ODI
 
Effective Blueprints for Forms 2 Oracle ADF
Effective Blueprints for Forms 2 Oracle ADFEffective Blueprints for Forms 2 Oracle ADF
Effective Blueprints for Forms 2 Oracle ADF
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

WebLogic Administration und Deployment mit WLST

  • 1. WEBLOGIC ADMINISTRATION UND DEPLOYMENT MIT WLST „Infrastructure as Code“ Oracle WebLogic Scripting Tool Best Practices Andreas Koop Consultant Oracle Technologies DOAG SIG Middleware, Köln, 29. Aug. 2012
  • 2. Andreas Koop ÜBER MICH Consultant Oracle Technologies Beratung, Training Oracle Technologie ADF Certified Implementation Specialist Community DOAG, ADF EMG, ADF German Community, Twitter @multikoop Blog Technical http://multikoop.blogspot.com Sonstiges http://www.enpit.de/blog 2
  • 3. ENTERPRISE.PRAGMATIC.IT Consulting Training Development Oracle Fusion Oracle Oracle Oracle Middleware WebCenter ADF WebLogic Enable productive IT by Oracle Technologies
  • 4. AGENDA Motivation „Infrastructure as Code“ Überblick WebLogic Scripting Tool Best Practices Administration und Deployment Andreas Koop 4
  • 5. INFRASTRUCTURE AS CODE ‣ Vision - Bereitstellung einer lauffähigen Umgebung aus ‣ Source Code Repository ‣ Anwendungsdaten (Backup) ‣ Ressourcen (Physikalisch / Virtuell) ‣ In Zeiten von Cloud und steigendem Bedarf nach horizontal skalierbaren System ist IaC unabdingbar Andreas Koop 5
  • 6. RESTORE ENV FROM CODE app source App App SCM App Artefacts Artefacts Artefacts infra source DB / Service Endpoints configuration / Sh, Chef, WLST, ... data / backup Andreas Koop 6
  • 7. WAS BRAUCHT EINE ORACLE FMW UMGEBUNG? ‣ WebLogic Installation, Domain ‣ WebLogic Konfiguration ‣ Application Deployment ‣ Data Sources ‣ System and Performance ‣ Message Queues Monitoring ‣ Logging ‣ Diagnostics (WLDF) App1 App2 ‣ Security Provider ‣ ... Andreas Koop 7
  • 8. MANUELLE KONFIGURATION IST KEINE LÖSUNG Andreas Koop 8
  • 9. WEBLOGIC SCRIPTING TOOL ‣ Jython basierte Scriptsprache zur Automatisierung jeglicher WebLogic Administrationsaufgabe ‣ Read / Write MBeans ‣ Offline ‣ ~ Configuration Wizard ‣ Online ‣ ~ Administration Console Andreas Koop 9
  • 10. DOMAIN ERSTELLEN readTemplate(os.environ['WL_HOME'] + '/common/templates/ domains/wls.jar') cd('/') Current cmo.setName('my_domain') Management cd('Servers/AdminServer') Object cmo.setListenAddress( 'All Local Addresses' ) cmo.setListenPort( int(ADMIN_PORT) ) cd( '/' ) cd( 'Security/'+DOMAIN_NAME+'/User/' + ADMIN_USER ) cmo.setPassword( ADMIN_PWD ) cd('/') setOption( 'JavaHome', os.environ['JAVA_HOME'] ) setOption( "ServerStartMode", "prod") setOption( "OverwriteDomain", "true" ) writeDomain( DOMAIN_DIR ) closeTemplate() Andreas Koop 10
  • 11. DOMAIN ERWEITERN # Z.B. um die ADF Runtime in Form der JRF readDomain(DOMAIN_DIR) addTemplate(MW_HOME + '/oracle_common/ common/templates/applications/jrf_templ ate_11.1.1.jar') updateDomain() closeDomain() exit() Andreas Koop 11
  • 12. WLST EXECUTION BEST PRACTICE (OFFLINE) #!/bin/sh export DOMAIN_HOME=/oracle/fmw /11.1.1.6/user_projects/domains /my_domain export DOMAIN_NAME=my_domain ... readTemplate(os.environ['WL_HOME'] + '/ env/env.sh common/templates/domains/wls.jar') cd('/') cmo.setName(os.environ['DOMAIN_NAME']) #!/bin/sh cd('Servers/AdminServer') cmo.setListenAddress( 'All Local . $PRJ_HOME/env/env.sh Addresses' ) . $DOMAIN_HOME/bin/setDomainEnv.sh cmo.setListenPort( int( WL_ADMIN_PORT) ) cd $PRJ_HOME/bin/wlst ... java weblogic.WLST create.domain.py writeDomain( DOMAIN_DIR ) cd - closeTemplate() bin/create.domain.sh bin/wlst/create.domain.py Andreas Koop 12
  • 13. WLST EXECUTION BEST PRACTICE (OFFLINE) Andreas Koop 13
  • 14. WLST ONLINE connect('weblogic', 'welcome1', 't3://adminhost:7001') edit() startEdit() # do something save() activate() disconnect() exit() Andreas Koop 14
  • 15. DOMAIN ERWEITERN connect('weblogic', 'welcome1', 't3://adminhost:7001') edit() startEdit() cmo.createServer(os.environ['MS_NAME']) cd('/Servers/'+ os.environ['MS_NAME']) cmo.setListenAddress('') cmo.setListenPort(os.environ['MS_PORT']) cmo.setListenPortEnabled(true) cmo.setJavaCompiler('javac') cmo.setMachine(getMBean('/Machines/Machine1')) cmo.setCluster('Cluster1') cd('/Servers/'+os.environ['MS_NAME']+'/SSL/'+os.environ['MS_NAME']) cmo.setEnabled(false) cd('/Servers/'+os.environ['MS_NAME']+'/ServerStart/'+os.environ['MS_NAME']) cmo.setArguments('-Xms512M -Xmx1024M') save() activate() disconnect() bin/wlst/create.server.py Andreas Koop 15
  • 16. MODULARIZE WLST SCRIPTS connect('weblogic', 'welco..) execfile('connect.py') execfile('connect.py') edit() execfile('connect.py') execfile('start.edit.session.py') startEdit() execfile('start.edit.session.py') execfile('start.edit.session.py') ## do something # do something do something try: execfile('end.edit.session.py') execfile('end.edit.session.py') save() execfile('end.edit.session.py') execfile('disconnect.py') execfile('disconnect.py') execfile('disconnect.py') activate() exit() exit() except ... exit() .. bin/wlst/myscriptX.py disconnect() Andreas Koop 16
  • 17. MODULARIZE WLST SCRIPTS EVEN MORE # Custom Functions import os def getDomainName(): return os.environ['DOMAIN_NAME'] $WL_HOME/ def startEditSession(): common/wlst logInfo('start edit session') edit() startEdit() ... Custom Functions bin/wlst/modules/enpit.utils.py stehen dann alle Skripten .. zur startEditSession() Verfügung # do something saveAndActivate() .. Andreas Koop 17
  • 18. WLST DOMAIN INTERACTION Quelle: Oracle FMW Doc Lib Andreas Koop 18
  • 19. DOMAIN STARTUP nmConnect('Dh4bZwJNNP', 'welcome1', DOMAIN_NAME, NM_PORT) nmStart('AdminServer') nmStart('WLS_FORMS') nmStart('WLS_REPORTS') nmStart('WLS_DISCO') nmStart('WLS_MY_APPS') .. nmDisconnect() exit() bin/wlst/start.domain.py Andreas Koop 19
  • 20. WLST NODE MANAGER ENCRYPTED PASSWORD nmConnect('Dh4bZwJNNP', 'welcome1', DOMAIN_NAME, NM_PORT) storeUserConfig(userConfigFile = .., userKeyFile = .., true) disconnect() # Ab jetzt: Anmeldung ohne Passwort im Klartext nmConnect(userConfigFile = NM_HOME + '/userconfigNM.secure', userKeyFile = NM_HOME + '/userkeyNM.secure', domainName = DOMAIN_NAME, port='5556') exit() Andreas Koop 20
  • 21. DOMAIN SHUTDOWN NM_HOME = WL_HOME + '/common/nodemanager' nmConnect(userConfigFile = NM_HOME + '/userconfigNM.secure', userKeyFile = NM_HOME + '/userkeyNM.secure', domainName = DOMAIN_NAME, port='5556') nmKill('WLS_FORMS') nmKill('WLS_REPORTS') nmKill('WLS_DISCO') nmKill('WLS_MY_APPS') .. nmKill('AdminServer') nmDisconnect() exit() bin/wlst/shutdown.domain.py Andreas Koop 21
  • 22. LOGGING LOGGING LOGGING ‣ Never-Ending-Story ‣ Was tun? Was berücksichtigen? ‣ Log Rotating ‣ Domain Log ‣ Server Logs ‣ „Wo sind die Log-Files???“ Andreas Koop 22
  • 23. LOGGING KONFIGURATION execfile('connect.py') execfile('start.edit.session.py') cd('/Servers/AdminServer/Log/AdminServer') cmo.setStacktraceDepth(5) cmo.setRotationType('bySize') cmo.setDomainLogBroadcasterBufferSize(10) cmo.setLog4jLoggingEnabled(false) cmo.setNumberOfFilesLimited(false) cmo.setDateFormatPattern('dd.MM.yyyy HH:mm' Uhr 'z') cmo.setBufferSizeKB(8) cmo.setFileMinSize(5000) cmo.setLoggerSeverity('Info') cmo.setRotateLogOnStartup(false) .. cmo.setRedirectStdoutToServerLogEnabled(true) cmo.setFileName('logs/AdminServer.log') execfile('end.edit.session.py') execfile('disconnect.py') exit() Andreas Koop 23
  • 24. DEPLOYMENT ‣ Data Source vorbereiten Java EE App ‣ Targets deploy ‣ Deploy ‣ Application ‣ Shared Libs App1 App2 ‣ EJBs Andreas Koop 24
  • 25. DATA SOURCE ANLEGEN ‣ JNDI Lookup #connect(..), edit() startEdit() cd('/') create('myDataSource', 'JDBCSystemResource') cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource') create('myJdbcDriverParams','JDBCDriverParams') cd('JDBCDriverParams/myDSName') set('DriverName','oracle.jdbc.OracleDriver') set('URL','jdbc:oracle:thin:@localhost:1521:XE') set('Password', 'HR') set('UseXADataSourceInterface', 'false') create('myProps','Properties') cd('Properties/myDSName') create('user', 'Property') cd('Property/user') cmo.setValue('HR') .. cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource') create('myJdbcDataSourceParams','JDBCDataSourceParams') cd('JDBCDataSourceParams/myDSName') set('JNDIName', java.lang.String("jdbc/hrDS")) Andreas Koop 25
  • 26. DATA SOURCE ENCRYPTED PASSWORD Shell akmac2:doag1_domain ak$ . ./bin/setDomainEnv.sh akmac2:doag1_domain ak$ java weblogic.security.Encrypt HR {AES}s77UdlHeZXMziW4i8WoPxBSN/DovWtnpYEPTJbBQ70M= create.datasource.py .. cd('/') create('myDataSource', 'JDBCSystemResource') .. set('PasswordEncrypted', '{AES}s77UdlHeZXMziW4i8WoPxBSN/DovWtnpYEPTJbBQ70M=') .. set('Targets',jarray.array([ObjectName('com.bea:Name=MS1,Type=Server')], ObjectName)) Andreas Koop 26
  • 27. APPLICATION DEPLOYMENT ‣ 2 Phasen Java EE App ‣ Vorbereiten ‣ Deployment Durchführen deploy ‣ Modi ‣ No Stage App1 App2 ‣ Stage ‣ External Stage Andreas Koop 27
  • 28. HOW TO DEPLOY connect('weblogic', 'welcome1', ADMIN_URL) deploy('myApp', '/path/to/myApp.ear', targets='Cluster1') # targets='Server1' startApplication('myApp') disconnect() exit() Andreas Koop 28
  • 29. HOW TO UNDEPLOY connect('weblogic', 'welcome1', ADMIN_URL) stopApplication('myApp') undeploy('myApp') # default: from all targets disconnect() exit() Andreas Koop 29
  • 30. DEPLOYMENT COMMANDS Command deploy(appName, path, [targets], [stageMode], [planPath], [options]) startApplication(appName, [options]) stopApplication(appName, [options]) undeploy(appName,[targets],[options]) Mittels plan.xml updateApplication(appName, [planPath], [options]) aktualisieren listApplications() Andreas Koop 30
  • 31. HOW TO RELAX (CUSTOM SOLUTION) Keep last 10 EARs ‣ ...falls das Deployment mal 2012-08-02-myapp.ear 2012-08-02-myapp.ear 2012-08-02-myapp.ear nicht reibungslos läuft? ‣ Deploy And Backup EAR deploy(...) shutil.copy(...) ‣ Restore def restore(): #Get last EAR #deploy(lastEAR) myapp Andreas Koop 31
  • 32. SIDE-BY-SIDY DEPLOYMENT deploy('myApp', '/path/to/myApp.ear', ..,appVersion = '1.0') Bestehende Client- Verbindungen app v1.0 app v2.0 Neue Client- Verbindungen deploy('myApp', '/path/to/myApp.ear', ..,appVersion = '2.0') Andreas Koop 32
  • 33. SERVER MONITORING .. state('<ServerName>') .. domainConfig() serverNames = cmo.getServers() domainRuntime() for name in serverNames: cd("/ServerRuntimes/"+name.getName()+"/JVMRuntime/"+name.getName()) heapFree = int(get('HeapFreeCurrent'))/(1024*1024) heapTotal = int(get('HeapSizeCurrent'))/(1024*1024) heapUsed = (heapTotal - heapFree) print '%14s %4d MB %4d MB %4d MB' % (name.getName(),heapTotal, heapFree, heapUsed) Andreas Koop 33
  • 34. SERVER THREAD DUMP .. threadDump(writeToFile='true',fileName='/tmp/threaddump.txt', serverName='AdminServer') .. Andreas Koop 34
  • 35. DOMAIN CONFIG AS CODE Domain Configuration wls:offline>configToScript(configPath='$DH', pyPath='config.mydomain.py') MDS per Application wls:online>exportMetadata(application='doag- demo', server='AdminServer', toLocation='/tmp/exportmds' User / Groups Embedded LDAP wls:online> domainRuntime() cd(‘/DomainServices/ DomainRuntimeService/DomainConfiguration/<domain>/ SecurityConfiguration/<domain>/DefaultRealm/myre alm/ AuthenticationProviders/DefaultAuthenticator’) cmo.exportData('DefaultAtn', '/export.ldif', Properties()) Andreas Koop 35
  • 36. WLST RECORDING FEATURE ‣ WebLogic Console Record (Aufzeichnen)-Button klicken ‣ Gewünschte Konfiguration vornehmen ‣ Generiertes WLST-Skript anpassen und integrieren Andreas Koop 36
  • 37. CONCLUSION ‣ WLST RULEZ! ‣ MUST for every Oracle FMW Admin! ‣ Vollständige Automatisierung von ‣ Domainerstellung, -konfiguration ‣ Application, Library Deployment ‣ Export / Import MDS ‣ Server - Startup / Shutdown - Monitoring Andreas Koop 37
  • 38. VIELEN DANK FÜR IHRE AUFMERKSAMKEIT HABEN SIE NOCH FRAGEN?

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. WLS Domain\n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. DEMO: Domain erstellen\n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. TODO: ugb fragen bzgl. erstellung der userconfig keys\nWarum keine Loop &amp;#xFC;ber alle Server?\n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. - retireTimeout Parameter vorhanden\n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. -Braucht man WLST in ZEiten von Cloud Control noch?\n- Wie schauts mit WebCenter, SOA, BPM Modulen aus? Gibt es seitens WLST unterst&amp;#xFC;tzung?\n
  39. \n