Andreas Koop
ÜBER MICH
Geschäftsführung
& Consulting
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
AGENDA
Wer oder Was ist „DevOps“?
WebLogic „DevOps Features“
Silent Install, JMX, WLST, RESTful Services
Automatisierung mit Vagrant und Puppet
Fazit
Andreas Koop
4
KNACKPUNKTE ZWISCHEN
ENTWICKLUNG UND BETRIEB
‣
„Silo-Denke“ - Meist keine übergreifende
Zusammenarbeit vorhanden
‣
Es werden meist unterschiedliche Ziele verfolgt
(New Features / Versions <-> Gesicherter Lifecycle)
‣
Unterschiedliche Definition von „Fertig!“
‣
Automatisierung unzureichend genutzt
‣
Veränderungswille oft nicht gegeben
Andreas Koop
6
HERAUSFORDERUNGEN IM
BETRIEB GROßER APPS
‣
Provisionierung von „Maschinen“
‣
Konfiguration von Servern
‣
Deployment von Apps
‣
(Performance) Monitoring
‣
Hochverfügbarkeit
Andreas Koop
7
Q
DEVOPS
WIRD GEBOREN
Agile Development
Continuous Integration
plan
code
build
test
release
deploy operate
Continuous Delivery
DevOps
Quelle: http://www.collab.net/solutions/devops
Andreas Koop
8
e
Operations
c
an
ur
ss
yA
D
ev
elo
pm
en
t
lit
ua
DevOps
DEVOPS IST...
‣
Ganzheitliche Betrachtung von
Entwicklung und Betrieb
‣
Konfliktminimierung
‣
„Environment as Code“
‣
Automatisierung von Build Test, Release,
Deployment
Andreas Koop
9
AGENDA
Wer oder Was ist „DevOps“?
WebLogic „DevOps Features“
Silent Install, JMX, WLST, RESTful Services
Automatisierung mit Vagrant und Puppet
Fazit
Andreas Koop
10
WEBLOGIC SILENT
INSTALLATION (2/2)
WebLogic Version >= 12.1.2
‣
java -jar wls_121200.jar -silent -response /home/
oracle/install/wls.rsp
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/opt/oracle/middleware
#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence,
Complete with Examples.
INSTALL_TYPE=WebLogic Server
...
Weitere Parameter: http://docs.oracle.com/middleware/1212/core/OUIRF/silent.htm
Andreas Koop
13
JMX MBEANS
‣
Java Management Extension
‣
MBeans haben Attribute und Operationen
‣
WebLogic MBeans bieten Zugang zu
Konfigurations- und Laufzeitdaten
JMX ermöglicht erst die vollständige Automatisierung
von WebLogic Konfigurationen & Monitoring !
Andreas Koop
14
JMX TOOLS
Prominent Tools
‣
WLS Admin Console, EM, JConsole, WLST
Less prominent
‣
‣
WLS RESTful Management Services
‣
Jolokia*
Remote JMX with JSON over HTTP
‣
wlsagent**
Nagios Plugin by remote JMX over HTTP
Andreas Koop
15
*: http://www.jolokia.org
**:https://code.google.com/p/wlsagent/
JMX JAVA CLIENT (1/2)
‣
Open JMX Connection
...
Map<String, String> map = new HashMap<String,String>();
// User credentials
map.put(Context.SECURITY_PRINCIPAL, "weblogic");
map.put(Context.SECURITY_CREDENTIALS, "welcome1");
// Use a t3 connector with a 20 seconds timeout
map.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
map.put("jmx.remote.x.request.waiting.timeout", "20000");
// We build the URL with the sample 'hostname' and 'port' params
JMXServiceURL url = new JMXServiceURL("service:jmx:t3://adminhost:7001/
jndi/weblogic.management.mbeanservers.runtime");
connector = JMXConnectorFactory.connect(url, map);
connection = connector.getMBeanServerConnection();
...
Andreas Koop
16
HOW TO DEPLOY
connect('weblogic', 'welcome1', ADMIN_URL)
deploy('myApp', '/path/to/myApp.ear', targets='Cluster1')
# targets='Server1'
startApplication('myApp')
disconnect()
exit()
Andreas Koop
20
HANDLING DIFFERENT ENV
REQUIREMENTS WITH PLANS
EAR
EAR
EAR
+
+
+
plan.xml
web.xml -> sessiontimeout = 3600
weblogic.xml -> ...
web.xml -> sessiontimeout = 60
weblogic.xml -> ...
web.xml -> sessiontimeout = 7200
weblogic.xml -> ...
deploy
deploy
...
plan.xml
...
plan.xml
deploy
Development
Test
Production
DataSource
DataSource
DataSource
Andreas Koop
21
WEBLOGIC RESTFUL
MANAGEMENT SERVICES
‣
Abfrage per REST-URL (XML oder JSON) von
Server Status
Applications
Clusters
Data Sources
‣
Vorherige Aktivierung in der Admin Console
notwendig
Andreas Koop
22
AGENDA
Wer oder Was ist „DevOps“?
WebLogic „DevOps Features“
Silent Install, JMX, WLST, RESTful Services
Automatisierung mit Vagrant und Puppet
Fazit
Andreas Koop
24
VM PROVISIONING SERVICE
ProdVMTemplate
Virtualisierung ermöglicht das schnelle
bereitstellen von Laufzeitumgebungen
‣
Basis für die Anforderung von GLEICHEN
Umgebungen
‣
VM Provisioning
Service
‣
Warum nicht dieses Verfahren auch für
Entwicklungsumgebung und EntwicklerRechner nutzen ?
TestVMTemplate
DevVMTemplate
Beispieltool:
www.vagrantup.com
Andreas Koop
KONFIGURATIONSWERKZEUG
‣
Umgebungen sind vielzählig und unterliegen
einem Wandel (Versionen, Patches, etc)
‣
Wieviele Administratoren werden benötigt,
um den Betrieb von 10 Rechner eines
Systems im Aufbau GLEICH zu halten ?
‣
Notwendigkeit: Automatisierung,
Dokumentation, Konfiguration und
Überwachung !
Konfigurationswerkzeug
Konfiguration
Beispieltool:
Oracle PlugIns für puppet von Edwin Biemond
https://forge.puppetlabs.com/biemond/orautils
Andreas Koop
KONFIGURATIONSMANAGEMENT MIT PUPPET
‣
Automatisierung von Konfigurationen von
Computer Systemen
Users, Groups, Services, Packages, Deployments, etc..
‣
user { 'oracle':
ensure => 'present',
home
=> '/home/oracle',
shell => '/bin/bash'
...
}
Verteilung im Netzwerk
Master
...
Node
Node
Node
host {"node1":
ip => "10.10.0.101",
host_aliases =>
['node1.sample.com','node1']
}
...
Andreas Koop
28
WLS PUPPET SAMPLE
Based on: Oracle PlugIns für puppet von Edwin Biemond
https://forge.puppetlabs.com/biemond/orautils
Andreas Koop
29
VAGRANT / PUPPET /
WEBLOGIC SINGLE NODE
Local machine
Oracle VirtualBox
Virtual Machine
Vagrant
Puppet
JDK
Git
Shared folders
/vagrant
/software
WLS
Source Repository
(Github)
Andreas Koop
WLS Domain
VM Template Repository
(centos64.box, oel64.box,...)
30
Software Repository
(jdk, weblogic_121200.jar)
MASTER IMAGES MIT PACKER
ERSTELLEN
w w w . p a c k e r. i o
‣
Identische VM Images aus Konfiguration erstellen
‣
Multi-Provider Support
Vagrant Boxes
VMWare Image Templates
Amazon AMI
...
{"builders": [{
"type": "virtualbox",
"iso_url": "...ubuntu-12.04.2-server-amd64.iso" },
...
], [{
"type": "vmware",
"iso_url": "...ubuntu-12.04.2-server-amd64.iso" },
...
], [{
"type": "amazon-instance",
"source_ami": "ami-d9d6a6b0" },
...
],
...
}
Andreas Koop
32
VirtualBox Image
(for Development e.g.)
VMWare Image
(for Development e.g.)
...
Amazon EC2 Image
(for Production e.g.)
...
FAZIT
‣
WebLogic Installation / Patching / Konfiguration /
Monitoring lässt sich sehr gut automatisieren
‣
WebLogic Umgebungen „auf Knopfdruck“ möglich
mit Vagrant, Puppet und WLST
‣
Höherer Aufwand zu Beginn
‣
Sehr hoher Nutzen mittelfristig
Risikominimierung
Continous Delivery
Andreas Koop
33
WEITERE INFORMATIONEN
‣
Was ist DevOps?
http://radar.oreilly.com/2012/06/what-is-devops.html
‣
Accessing WebLogic Server MBeans with JMX
http://docs.oracle.com/middleware/1212/wls/JMXCU/accesswls.htm
‣
Oracle RESTful Management Services
http://www.oracle.com/technetwork/articles/soa/oliveira-wls-rest-javafx-1723982.html
http://multikoop.blogspot.de/2011/12/restful-management-services-in-oracle.html
‣
Vagrant / Puppet / WLS
http://multikoop.blogspot.de/2013/11/setup-weblogic-12c-environment-with.html
Andreas Koop
34