Liberty profile

Transkript

Liberty profile
IBM WebSphere Application Server V8.5
Liberty Profile
© 2013 IBM Corporation
Overview
2
© 2013 IBM Corporation
What is WebSphere Application Server Liberty Profile?
 A new flexible dynamic profile of WAS which is focused FIRST on
the development experience.
– Fast
– Lightweight
– Simplified Configuration
 Fidelity with full-profile WAS
– But radically refactored to focus on the development experience
 Initially focused on development and test of web, mobile and OSGi apps.
3
© 2013 IBM Corporation
What is WebSphere Application Server Liberty Profile?
 Support for Liberty Profile in Rational Application Developer
– Enterprise development - advanced programming, cloud, collaboration, and quality tools
– Available stand-alone or bundled in WAS - Tools Edition
and WAS Network Deployment - Tools Edition
 Support for Liberty Profile in WebSphere Application Server Development Tools for Eclipse
– Subset of RAD focused on core programming models
– Simple Eclipse feature update for Eclipse 3.6 (Helios) or 3.7 (Indigo)
– Available on Eclipse Marketplace for Eclipse Juno, Kepler
– Available unsupported at no charge, or supported for a fee
– WAS for Developers – Tools Edition for Eclipse
 Development tools can install the runtime.
 Additional platform support for z/OS - runtime only, i5/OS
and Mac OS runtime & tools (development only not supported for production)
 Choice of either Oracle or IBM’s Java (where available)
4
© 2013 IBM Corporation
Usage scenarios
5
© 2013 IBM Corporation
Installation options
 WebSphere Application Server Developer Tools
in RTC or Eclipse
 Archive Install
 Installation Manager
 Maven Repository
6
© 2013 IBM Corporation
WAS Liberty installation using Eclipse Marketplace
 Help –> Eclipse Marketplace
© 2013 IBM Corporation
Create a lightweight WAS server in WebSphere Developer Tools
Create a lightweight WAS server
configuration in seconds
8
© 2013 IBM Corporation
Simplified server configuration
 Simplest case: one XML file
for all server configuration
 Editable within the
workspace
 Exportable, shareable,
versionable
No need for Admin Console, wsadmin,
or enhanced EARs
9
X
resources.xml
server.xml
etc.
ws-security.xml
© 2013 IBM Corporation
Simplified server configuration
<server>
<featureManager>
features control which capabilities (bundles) are
installed in the server
<feature>jsp-2.2</feature>
<feature>jdbc-4.0</feature>
'singleton' configurations specify properties for
a runtime service like logging
</featureManager>
<logging trace.specification="webcontainer=all=enabled:*=info=enabled" />
<application type="war" id="tradelite" name="tradelite" location="tradelite.war" />
<jdbcDriver id="DerbyEmbedded" libraryRef="DerbyLib"/>
<library filesetRef="DerbyFileset" id="DerbyLib"/>
<fileset dir="${shared.resource.dir}/derby" id="DerbyFileset" includes="derby.jar"/>
<dataSource id="DefaultDatasource" jdbcDriverRef="DerbyEmbedded" jndiName="DefaultDatasource">
<properties createDatabase="create" databaseName="${shared.resource.dir}/data/product"/>
</dataSource>
</server>
10
'instance' configurations
specify multiple resources like
applications and datasource
definitions
Any of this configuration could be put into a separate
xml file and 'included' in this 'master' configuration
file
© 2013 IBM Corporation
Flexible configuration
 Shareable configuration snippets
<server>
...
<include location="http://cfgserver/global.xml" />
<include location="${shared.config.dir}/global.xml" />
<server>
server.xml
 Configuration can be componentized at any level of granularity, from one file to many
(update
( configuration for thousands of servers by one xml file change)
 Can use WDT to associate configuration snippets with a server configuration.
 Visualization through WDT tools as a single logical view.
 Team development: keep the application and configuration components together.
11
© 2013 IBM Corporation
Highly composable runtime based on “features”
WAS
Extensions
Java EE
support
jsf-2.0
appSecurity-1.0
servlet-3.0
runtime
services
config model
jsf jsp app security
webcontainer
webcontainer
http transport
app
manager
http transport
runtime (osgi) services
Full WAS profile
12
app
manager
runtime (osgi) services
Liberty profile
© 2013 IBM Corporation
Dynamic runtime
application
features
apps
resources
application
application
dropins location
server.xml
config updates
feature updates
app updates
Liberty runtime
13
© 2013 IBM Corporation
Flexible Configuration
mbeans

Configuration defaults are specified by
contributing features

Configuration by exception – any property can be
overridden in user-specified server config

Config can be changed dynamically, changes are
“observed” and are injected back into the
contributing feature immediately
t
<server>
<featureManager>
<feature>servlet-3.0</feature>
<feature>transaction-1.1</feature>
</featureManage>
<transaction timeout="30" />
<server>
OSGi
metadata
config
defaults
classes
config
metadata
server runtime
bundle
(for example
transaction support)
id=com.ibm.ws.transaction
name=transaction
attribute id=timeout
default=100
server.xml
14
© 2013 IBM Corporation
Liberty profile for i
 iAdmin command
– supports operating a Liberty profile server on the IBM® i platform
– wlp/lib/native/os400/bin
 iAdmin task [options]
– task could be:
• POSTINSTALL – configures server to run in QWAS85 subsystem
• PREUNINSTALL – removes objects created by POSTINSTALL
• GRANTAUTH – grants QEJBSVR user necessary permissions
– options
• Required only for GRANTAUTH task
• --userprofilename QEJBSVR
• Optional for GRANTAUTH (ignored by other tasks)
• --outputdir wlp_user_dir – directory for server generated files
• --rolename role_name – the only supported role is server
• --userdir wlp_user_dir – shared resources directory
© 2013 IBM Corporation
Deployment options
 An “Embedded Server” profile is a production instance of the configured Liberty server type.
– Package the application, configuration and server you just tested into an archive file.
• server package server_name --archive=package_file_name.zip --include=all
– Application centric – server pre-configured for a specific application.
16
© 2013 IBM Corporation
Deployment of applications
 Drag & drop
– dropins directory
• ${server.config.dir}/dropins
– Place the archive file with its identifying suffix (ear, war, wab, and so on) directly into
the /dropin
 Add to server configuration file
<application context-root="helloworld" type="war" id="helloworld"
location="helloworld.war" name="helloworld"/>
 Context root is determined in the following precedence:
– context-root in the server.xml file
– application.xml, if an EAR application
– ibm-web-ext.xml, if a web application
– name of the application in the server.xml file, if a web application
– Manifest.MF, if a WAB application
– Directory name or the file name relative to the "dropins" directory of the Liberty profile
© 2013 IBM Corporation
JVM properties
 File jvm.options
– jvm-specific start options
• for example -X arguments
– One option per line
 ${wlp.install.dir}/etc/jvm.options
– Settings apply for all servers
 ${server.config.dir}/jvm.options
– Settings are specific to the server
© 2013 IBM Corporation
Starting and stopping server from command line
 server command in ${wlp.install.dir}/bin directory
 server start <servername>
– Start server in background
 server run <servername>
– Start server in foreground
– Write console output to the window
– Ctrl+c or kill to stop the server
 server debug <servername>
– Start server in debug mode
 server stop <servername>
– Stops the server
 server status <servername>
– Displays the current state of the server
© 2013 IBM Corporation
Maven support
 Maven plug-in for the Liberty profile
<pluginRepository>
<id>Liberty</id>
<name>Liberty Repository</name>
<url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
 Since 15.4.2014 liberty-maven-plugin available in central repository
 Maven tasks (goals)
– liberty:start-server goal to start a Liberty profile server in the file system
– liberty:create-server goal to create a Liberty profile server
– liberty:package-server goal to package a Liberty profile server
– liberty:stop-server goal to stop a Liberty profile server
– liberty:deploy goal to deploy an application to a Liberty profile server
– liberty:undeploy goal to remove an application from a Liberty profile server
– liberty:install-apps goal to copy one or more applications to a Liberty profile
© 2013 IBM Corporation
server
Configuration variables
 wlp.install.dir
– Profile’s installation directory
 wlp.user.dir
– Root of the tree containing user configuration
– ${wlp.install.dir}/usr
 server.config.dir
– Server configuration directory contains the server.xml file and any other optional configuration files
– ${wlp.user.dir}/servers/serverName
 server.output.dir
– Resources generated by the server, such as logs
 shared.app.dir
– Shared user applications directory
– ${wlp.user.dir}/shared/apps
 shared.config.dir
– Shared user configuration directory
– ${wlp.user.dir}/shared/config
 shared.resource.dir
– Shared user resources directory
– ${wlp.user.dir}/shared/resources
© 2013 IBM Corporation
Instalace a konfigurace WAS
Liberty Profile
© 2013 IBM Corporation
Příprava prostředí
 Instalace Java SE 6 nebo 7
– Kontrola zda je Java nainstalovaná:
• java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
– Např.: C:\apps\jdk1.6.0_29\jre\
© 2013 IBM Corporation
Instalace Liberty Profile runtime (non-Eclipse)
 Instalační soubory jsou k dispozici na URL:
– https://www.ibmdw.net/wasdev/downloads/liberty-profile-using-non-eclipse-environments/
 Instalace WebSphere Application Server V8.5.5.2 Liberty Profile – archive packaging
– Runtime (Liberty core)
• java -jar jméno_developer_runtime_jar_souboru
– Extended (podpora JMS, Web services, MongoDB, atd.)
• Rozbalit extended jar do stejného umístění jako runtime (core)
 Vytvoření servru
– Z adresáře wlp/bin
• server create jméno-serveru
– Server je vytvořen v adresáři
• wlp/usr/servers/jméno-serveru
– Start server
• Na pozadí:
• server start jméno-serveru
nebo interaktivně:
• server run jméno-serveru
© 2013 IBM Corporation
Konfigurace servru
 Konfigurace servru
– Adresář ${server.config.dir}
• usr/servers/jméno-serveru
– Konfigurační soubor
• server.xml
– Nastavení JAVA_HOME
• V adresáři ${server.config.dir} soubor server.env s řádkem
• JAVA_HOME=cesta_k_JDK
© 2013 IBM Corporation
Instalace krok za krokem
 Start command prompt
 PATH=%PATH%;C:\apps\jdk1.6.0_29\jre\bin
 cd C:\common\liberty\was
 java -jar wlp-developers-runtime-8.5.5.2.jar
– dvakrát zadat x a enter
– 1 (Agree) a enter
– Target directory for product files?
• C:\common\liberty\cviceni
 java -jar wlp-developers-extended-8.5.5.2.jar
– dvakrát zadat x a enter
– 1 (Agree) a enter
– Target directory for product files?
• C:\common\liberty\cviceni
© 2013 IBM Corporation
Vytvoření a konfigurace serveru
Vytvoření
 Z command promptu
 cd C:\common\liberty\cviceni\wlp\bin
 server create kurdejov
Konfigurace
 Otevřít v text editoru soubor
C:\common\liberty\cviceni\wlp\usr\servers\kurdejov\server.xml
 Přidat features
– jsp-2.2
– monitor-1.0
– localConnector-1.0
 Uložit změny a zavřít text editor
© 2013 IBM Corporation
Vytvoření a konfigurace serveru - pokračování
 Nastavení JAVA_HOME
– Vytvořit soubor server.env v adresáři
C:\common\liberty\cviceni\wlp\usr\servers\kurdejov
 Do souboru server.env vložit následující řádek
– JAVA_HOME=C:\apps\jdk1.6.0_29\jre
 Start serveru v interaktivním módu
– cd C:\common\liberty\cviceni\wlp\bin
– server run kurdejov
© 2013 IBM Corporation
Deployment ukázkové aplikace
 Nakopírujte soubor liberty-monitor.war do adresáře
– C:\common\liberty\cviceni\wlp\usr\servers\kurdejov\dropins
 Otevřete internet browser a zadejte URL
– http://localhost:9080/liberty-monitor/JvmStats.jsp
© 2013 IBM Corporation
Liberty v Eclipse
 Instalace/spuštění Eclipse
– Rozbalit soubor eclipse-jee-kepler-SR2-win32.zip do adresáře
• C:\common\liberty\cviceni\eclipse-jee-kepler-SR2-win32
– Spustit
• C:\common\liberty\cviceni\eclipse-jee-kepler-SR2win32\eclipse\eclipse.exe
– Zvolit workspace
• C:\common\liberty\cviceni\workspace
– Otevřít workbench
 Instalace WDT do Eclipse (vyžaduje přístup na Internet)
 Help - Eclispe Marketplace...
– Find “Liberty”
– Nainstalovat
IBM WAS 8.5.5 Liberty Developer Tools for Eclipse
– Restart Eclipse
© 2013 IBM Corporation
Liberty v Eclipse
 Konfigurace již vytvořeného WAS Liberty Profile serveru v Eclipse
 Záložka Servers – New – Server – WAS 8.5 Liberty Profile
 Path
 C:\common\liberty\cviceni\wlp
© 2013 IBM Corporation
Konfigurace Liberty v Eclipse
© 2013 IBM Corporation
Závěr
 Dokumentace
– http://www01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.nd.doc/ae
/twlp_setup.html?cp=SSAW57_8.5.5%2F1-6-0
 Zajímavé odkazy
– WebSphere Liberty Profile demo: the remote control house
• https://www.ibm.com/developerworks/community/blogs/videoportal/entry/new_websphere_liberty_profile_demo_the_remote_control_house?
lang=en
– Liberty controlled car
• https://developer.ibm.com/wasdev/2013/04/25/liberty_controlled_car/
© 2013 IBM Corporation

Podobné dokumenty

Diplomová práce

Diplomová práce z nich je architekturní, strukturovaná, složit jší, koresponduje z velké ásti s formátem EDIF. Hodí pro strukturované ukládání a využívaní komplexních informací o elektronickém obvodu. Pro ú ely si...

Více

2 Webové služby - FAKE GAME Project

2 Webové služby - FAKE GAME Project Nemám závažný důvod proti užití tohoto školního díla ve smyslu §60 zákona č. 121/2000 Sb., o právu autorském, o právech souvisejících s právem autorským a o změně některých zákonů (autorský zákon)....

Více

Spring framework 2.0

Spring framework 2.0 Tangosol Coherence Data Grid http://www.tangosol.com/

Více