Domain Partitions and Multitenancy in Oracle WebLogic Server 12c - Why It's Useful

Post on 22-Jan-2018

302 views 3 download

Transcript of Domain Partitions and Multitenancy in Oracle WebLogic Server 12c - Why It's Useful

Raastech, Inc.2201 Cooperative Way, Suite 600Herndon, VA 20171+1-703-884-2223info@raastech.com

Domain Partitions & Multitenancy in Oracle WebLogic Server 12c

Why It’s Useful

Thursday, May 18, 20172:45 - 3:45pm

Session 9LL10AB

© Raastech, Inc. 2017 | All rights reserved. Slide 2 of 64@Raastech

Agenda

1. Introduction

2. Overview of Oracle WebLogic Server

3. Introducing Multitenancy

4. WebLogic Multitenancy Concepts

5. Isolation

6. Oracle Traffic Director

7. Porting Domains

8. Extending to Oracle Java Cloud Service

9. Managing Downtime

10. Summary

© Raastech, Inc. 2017 | All rights reserved. Slide 3 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 4 of 64@Raastech

About Me

▪ Ahmed Aboulnaga @Ahmed_Aboulnaga

▪ 18+ years Oracle experience

▪ Oracle ACE, OCE, OCA

▪ Author, Blogger, Presenter, Tweeter

© Raastech, Inc. 2017 | All rights reserved. Slide 5 of 64@Raastech

About Raastech

▪ Small systems integrator founded in 2009

▪ Headquartered in the Washington DC area

▪ Specializes in Oracle Fusion Middleware

▪ Oracle Gold Partner

▪ Oracle SOA Specialized

© Raastech, Inc. 2017 | All rights reserved. Slide 6 of 64@Raastech.

© Raastech, Inc. 2017 | All rights reserved. Slide 7 of 64@Raastech

▪ Application servers (i.e., middleware) reside between the frontend

and the backend

▪ The mostly (but not always) host and execute web application code

and web services

Middleware

.

© Raastech, Inc. 2017 | All rights reserved. Slide 8 of 64@Raastech

Oracle WebLogic Server

▪ Acquired from BEA in 2008

▪ Industry’s leading Java Enterprise Edition (Java EE) Application server

▪ Replaced Oracle Application Server

▪ Required for almost all Oracle Fusion Middleware products

▪ Provides a standard set of APIs for creating distributed Java

applications that can access a wide variety of services such as

▪ JMS, JDBC, RMI, Web Services, XML, EJB etc.

.

© Raastech, Inc. 2017 | All rights reserved. Slide 9 of 64@Raastech

Current Releases

▪ Current release:

▪ Oracle WebLogic Server 12c R2 (12.2.1.2)

▪ Previous releases:

▪ Oracle WebLogic Server 12c (12.1.2 and 12.1.3)

▪ Oracle WebLogic Server 11g (10.3.5 and 10.3.6)

.

© Raastech, Inc. 2017 | All rights reserved. Slide 10 of 64@Raastech

Oracle Marketing Speak – WebLogic Server

▪ “New features for lowering cost of operations, improving performance,

enhancing scalability”

▪ “Provides flexibility between on-premise and third-party clouds”

▪ “Increases developer productivity with mobile application

development and maven support”

▪ “Optimized for Oracle Exalogic Elastic Cloud”

▪ “Provides extreme cloud performance, scalability, and elasticity,

unmatched integration with Oracle’s Database 12c including multi-

tenant database support”

© Raastech, Inc. 2017 | All rights reserved. Slide 11 of 64@Raastech

Understanding Oracle Fusion Middleware

▪ “Oracle Fusion Middleware” is a misleading term

▪ Used to describe middleware products such as:

▪ Business Intelligence (e.g., OBIEE)

▪ Integration (e.g., SOA Suite, OSB)

▪ WebCenter (e.g., WebCenter Content and Portal)

▪ Identity Management (e.g., Oracle Access Manager)

▪ Monitoring (e.g., OEM Cloud Control)

▪ But many times used (erroneously) to describe a single product:

▪ WebLogic Server

© Raastech, Inc. 2017 | All rights reserved. Slide 12 of 64@Raastech

▪ WebLogic Server is the core foundation of all Oracle Fusion

Middleware products (and applications)

WebLogic Server: Foundation for Fusion Middleware

© Raastech, Inc. 2017 | All rights reserved. Slide 13 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 14 of 64@Raastech

Docker Containers

▪ Light, extremely quick startup, increased density, portableA

pp

Physical Server

Host OS

Hypervisor

Guest OS

Guest OS

Guest OS

bin/lib bin/libA

pp

Ap

p

Physical Server

Host OS

Docker Engine

bin/lib bin/lib

bin/lib

Ap

p

Ap

p

Ap

p

Ap

p

© Raastech, Inc. 2017 | All rights reserved. Slide 15 of 64@Raastech

Oracle Database Multitenancy

▪ PDB = Pluggable Database

▪ Portable, increased density, isolated

▪ DBA’s love it

DB

Server

OS

bin/lib bin/libbin/lib

DB DB

Server

OS

bin/lib

DB

PDB PDB PDB

© Raastech, Inc. 2017 | All rights reserved. Slide 16 of 64@Raastech

WebLogic Server Multitenancy

▪ Same concept exactly, but at the WebLogic level

▪ WebLogic Server multitenancy is achieved via domain partitions

Domain

Server

OS

bin/lib bin/libbin/lib

Domain Domain

Server

OS

bin/lib

Domain

Partition Partition Partition

© Raastech, Inc. 2017 | All rights reserved. Slide 17 of 64@Raastech

Oracle Marketing Speak – Domain Partitions

▪ Consolidate “microcontainers onto an efficient, shared platform”

▪ “Improves your time to market”

▪ “Simplifies movement of workloads to and from the cloud”

▪ “Enables up to 3x hardware consolidation”

▪ “Reduces operating expenses by up to 25%”

© Raastech, Inc. 2017 | All rights reserved. Slide 18 of 64@Raastech

Convincing Oracle Marketing Speak

▪ “Increased density”

▪ “Tenant isolation”

▪ “Simplified management”

© Raastech, Inc. 2017 | All rights reserved. Slide 19 of 64@Raastech

WebLogic Domain Partitions

▪ New to Oracle WebLogic Server 12.2.1

▪ Think virtualization or multitenancy in WebLogic Server, similar to

pluggable databases in the Oracle Database

▪ Every domain can have 1 or more partitions, each containing its own

apps and resources

© Raastech, Inc. 2017 | All rights reserved. Slide 20 of 64@Raastech

New in 12.2.1

▪ Domain Partitions

▪ Resource Groups

▪ Resource Group Templates

▪ Other new features include:

▪ Zero Down Time (ZDT) patching

▪ Via automatic orchestration, retries/rolls back on failure

▪ WebLogic multitenant live partition migration

▪ Move from one cluster to another

▪ Coherence persistence

▪ Cache data persisted to durable storage

© Raastech, Inc. 2017 | All rights reserved. Slide 21 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 22 of 64@Raastech

Introducing WebLogic Domain Partitions

WebLogic Domain APP

AdminServer

BookingApp

WebLogic Domain ORD

AdminServer

OrderMgmt

WebLogic Domain NEW

AdminServer

OrderReports

JMS JDBC

JMS JDBC

Partition APP

BookingApp

JMS JDBC

Partition ORD

OrderMgmt

OrderReports

JMS JDBC

© Raastech, Inc. 2017 | All rights reserved. Slide 23 of 64@Raastech

Domain Partitions

▪ A WebLogic microcontainer

▪ Can create 1 or more partitions

▪ Each partition has its own apps and resources

▪ Can start/stop each partition independently

▪ Each partition can have different security realms

▪ Can assign a different administrator for each partition

© Raastech, Inc. 2017 | All rights reserved. Slide 24 of 64@Raastech

Domain Partitions Isolation Boundaries

▪ Applications and their data

▪ JNDI

▪ Security

▪ Runtime MBeans

▪ Work Managers

▪ Logging

© Raastech, Inc. 2017 | All rights reserved. Slide 25 of 64@Raastech

Resource Groups

▪ Resource Group = collection of Java EE apps and resources

▪ Examples of resources:

▪ Deployments

▪ Services (JDBC, messaging, persistent stores, etc.)

▪ Targets

▪ Can override resources to customize settings

© Raastech, Inc. 2017 | All rights reserved. Slide 26 of 64@Raastech

Resource Groups – Creating

▪ Navigate to Environment > Resource Groups

© Raastech, Inc. 2017 | All rights reserved. Slide 27 of 64@Raastech

Resource Groups – Configuring Services

© Raastech, Inc. 2017 | All rights reserved. Slide 28 of 64@Raastech

Resource Group Templates

▪ Basically templates of Resource Groups

▪ Overrides:

▪ Can create “overrides” for the resources defined in the resource group

template

▪ Example: JDBC connection information

© Raastech, Inc. 2017 | All rights reserved. Slide 29 of 64@Raastech

Targeting

▪ In Pre-12.2.1, applications and resources are targeted to a managed

server or cluster

▪ Resources and applications are grouped into resource groups

▪ The resource group is targeted to a virtual target

© Raastech, Inc. 2017 | All rights reserved. Slide 30 of 64@Raastech

Virtual Targets

▪ A virtual target is targeted either to a cluster or a managed server

▪ Each has its own URL mapping

▪ Each has its own separate HTTP server

▪ Which helps avoid context path clashes

http://devhost:8001/PartitionAPP/BookingApp

http://devhost:8001/PartitionORD/OrderManagement

© Raastech, Inc. 2017 | All rights reserved. Slide 31 of 64@Raastech

Virtual Targets – Creating

© Raastech, Inc. 2017 | All rights reserved. Slide 32 of 64@Raastech

WebLogic Domain Partitions

WebLogic Domain APP

AdminServer

WebLogic Domain NEW

AdminServer

JMS JDBC

Partition APP

JMS JDBC

JMS JDBC

Resource Group

Virtual Target

JMS JDBC

MS1 MS2

MS1 MS2

© Raastech, Inc. 2017 | All rights reserved. Slide 33 of 64@Raastech

Some New Terminology

Term Explanation

MicrocontainerGeneral term that defines encapsulated applications and resources, resources are isolated

Domain Partition –or–Partition

A WebLogic concept, a microcontainer, a runtime slice of the WebLogic Domain

Virtual TargetDefines where a partition runs, either on a managed server or a cluster

Resource GroupCreated within a partition, groups resources, targeted to a virtual target

RCM Resource Consumption Management

© Raastech, Inc. 2017 | All rights reserved. Slide 34 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 35 of 64@Raastech

How to Enable Isolation

▪ Though a shared domain, partitions must provide for:

▪ Runtime isolation

▪ Security isolation

▪ Administrative isolation

▪ Data isolation

▪ Configure Resource Consumption Managers and Partition Work

Managers

© Raastech, Inc. 2017 | All rights reserved. Slide 36 of 64@Raastech

Isolation Types

Isolation Type Explanation

RuntimePolicies allow for usage of heap, CPU time, and open file descriptors

Security Each partition can have a separate security realm

Administrative Each partition can be managed by different administrators

DataEach partition has its own dedicated data source, JMS configuration, and Coherence runtime cache

© Raastech, Inc. 2017 | All rights reserved. Slide 37 of 64@Raastech

Resource Consumption Management (RCM)

▪ Helps provide runtime isolation and protection

▪ Set the following JVM arguments to enable WebLogic RCM

-XX:+UnlockCommercialFeatures -XX:+ResourceManagement -XX:+UseG1GC

© Raastech, Inc. 2017 | All rights reserved. Slide 38 of 64@Raastech

Triggers

▪ A static constraint for the allowed usage for a resource

▪ Can create boundaries for:

▪ HeapRetained

▪ CpuUtilization

▪ FileOpen

▪ If constraint exceeded, an action is performed:

▪ Notify - obvious

▪ Slow - through work manager settings

▪ Fail - reject requests

▪ Shutdown - stop partition

© Raastech, Inc. 2017 | All rights reserved. Slide 39 of 64@Raastech

<domain>..<resource-management>

<resource-manager><heap-retained>

<trigger><name>UpThere_4GB</name><value>4096</value><action>notify</action>

</trigger><trigger>

<name>UpThere_6GB</name><value>6144</value><action>slow</action>

</trigger><trigger>

<name>UpThere_8GB</name><value>8192</value><action>shutdown</action>

</trigger>..

config.xml

Partition 1

8.9 GB

Partition 3

Trigger Example (heap-retained)

Partition 2

3.7 GB

8 GB

4 GB

6 GB

2 GB

Total 30 GB JVM

6.1 GB

© Raastech, Inc. 2017 | All rights reserved. Slide 40 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 41 of 64@Raastech

Oracle Traffic Director (OTD)

▪ Is a software load balancer

▪ Optional

▪ Separately licensed

▪ WebLogic Server typically fronted by OTD or hardware load balancer

▪ You must set the WebLogic Plug-in Enabled in the WLS Admin Console

http://www.ateam-oracle.com/wls-plugin-enabled/

© Raastech, Inc. 2017 | All rights reserved. Slide 42 of 64@Raastech

Oracle Traffic Director (OTD)

▪ Supports an Active-Active or Active-Passive architecture

▪ Highly recommended on Exalogic

▪ When a server is added to a cluster, traffic is automatically routed to

the new managed server

▪ When a partition is created/imported, traffic routing is automatically

added to OTD configuration

© Raastech, Inc. 2017 | All rights reserved. Slide 43 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 44 of 64@Raastech

Export a Domain

▪ Can export 11g and 12c domains

▪ Export a domain:

exportDomainForPartition.sh /tmp /u01/mw/user_projects/domains/raastech

▪ Output files are:

raastech-attributes.json

raastech.zip

© Raastech, Inc. 2017 | All rights reserved. Slide 45 of 64@Raastech

Import a Domain to a Partition

▪ Run these command to import the domain to a partition:

$MW_HOME/oracle_common/common/bin/wlst.sh

connect('weblogic', 'welcome1', 'http://newhost:7001');

importPartition('/tmp/raastech.zip', 'raastech', true, none);

startPartitionWait(cmo.lookupPartition("raastech"));

© Raastech, Inc. 2017 | All rights reserved. Slide 46 of 64@Raastech

Confirm Application

▪ Note URI prefix

▪ Application URL on old domain:

http://devhost:8001/BookingApp

▪ Application URL on new domain partition:

http://devhost:8001/raastech/BookingApp

© Raastech, Inc. 2017 | All rights reserved. Slide 47 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 48 of 64@Raastech

Introducing the Oracle Java Cloud Service (JCS)

▪ Simply… WebLogic Server on the cloud

▪ Requires the Oracle Database Cloud Service

© Raastech, Inc. 2017 | All rights reserved. Slide 49 of 64@Raastech

Migrating to Oracle JCS

1. Migrate the Database

2. Configure the Oracle JCS Environment

3. Migrate the Application

© Raastech, Inc. 2017 | All rights reserved. Slide 50 of 64@Raastech

Configure the Oracle JCS Environment

1. Navigate to the Oracle JCS Console

2. Launch the AdminConsole

3. Create data sources, work managers, messaging resources,

cluster, etc.

© Raastech, Inc. 2017 | All rights reserved. Slide 51 of 64@Raastech

AppToCloud Healthcheck

▪ Validates on-premise domain and applications prior to moving them

to Oracle JCS

a2c-healthcheck.sh

-oh /u01/app/fmw

-adminUrl t3://devhost:7001

-adminUser weblogic

-outputDir /tmp

.

© Raastech, Inc. 2017 | All rights reserved. Slide 52 of 64@Raastech

AppToCloud Export

▪ Exports on-premise domain and applications in preparation to move

them to the Oracle JCS storage container

a2c-export.sh

-oh /u01/app/fmw

-domainDir /u01/user_projects/domain/raastech

-archiveFile raastech.zip

-cloudStorageContainer Storage-Me/MyContainer

-cloudStorageUser myuser

.

© Raastech, Inc. 2017 | All rights reserved. Slide 53 of 64@Raastech

AppToCloud Import

▪ Create an Oracle JCS instance with AppToCloud

1. Click Create Service

2. Select Java Cloud Service – AppToCloud

▪ Import application to service instance

1. Click AppToCloud Import

Gotchas

▪ Can only be performed on a new and unmodified service instance

▪ Copy AppToCloud JSON to Oracle Storage Cloud Service

▪ Create service instance with AppToCloud option

▪ Manually configure properties

© Raastech, Inc. 2017 | All rights reserved. Slide 54 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 55 of 64@Raastech

Ways to Reduce Downtime

▪ Application:

▪ Redeploy apps

▪ Side-by-side deployment using versions (at a max of 1 previous version)

▪ Infrastructure:

▪ Rolling restarts

▪ Rolling Java patching

▪ Rolling Oracle Home patching

▪ Zero Down Time patching (ZDT)

© Raastech, Inc. 2017 | All rights reserved. Slide 56 of 64@Raastech

© Raastech, Inc. 2017 | All rights reserved. Slide 57 of 64@Raastech

Thoughts on WebLogic Partitions

▪ Is it really needed?

▪ Would you prefer 2 domains -or- 1 domain with 2 partitions?

▪ Patching considerations

▪ Must upgrade all apps simultaneously

▪ Segregation considerations

▪ Not performance, but rather binaries

© Raastech, Inc. 2017 | All rights reserved. Slide 58 of 64@Raastech

Good Stuff

▪ Consolidation of environments

▪ Consolidate smaller or less used apps into a single environment

▪ Replication of environments

▪ Quickly provision replicas of test environments

© Raastech, Inc. 2017 | All rights reserved. Slide 59 of 64@Raastech

Benefits of WebLogic Server Multitenancy

▪ Improves density and resource utilization

▪ Environment consolidation

▪ Portability

What is Shared What is Not Shared

Domain Application Data

WebLogic Server Application Configuration

JVM Application Runtime

OS

© Raastech, Inc. 2017 | All rights reserved. Slide 60 of 64@Raastech

Disadvantages of WebLogic Server Multitenancy

▪ Does not support most Oracle Fusion Middleware applications

▪ Only supports Java EE applications

▪ Does not support Oracle ADF applications

▪ Does not support applications that depend on Oracle JRF

▪ Shared WebLogic Server and domain will impact upgradeability

▪ Not 100% isolated

© Raastech, Inc. 2017 | All rights reserved. Slide 61 of 64@Raastech

WebLogic Microcontainers vs. Docker

▪ Both isolate packaged applications and their resources

▪ Both are portable

▪ Docker works at the OS level

▪ Microcontainers work at the WebLogic level

▪ i.e., Does not exist outside the WebLogic runtime environment

▪ WebLogic 12.2.1 is certified to run on Docker containers

▪ To create your own WebLogic Docker images

© Raastech, Inc. 2017 | All rights reserved. Slide 62 of 64@Raastech

References

▪ Domain Partitions for Multi-tenancy in WebLogic Server 12.2.1

https://blogs.oracle.com/WebLogicServer/entry/domain_partitions_for_multi_tenancy

▪ Oracle Fusion Middleware Using WebLogic Server Multitenant

http://docs.oracle.com/middleware/1221/wls/WLSMT

▪ WebLogic Multitenant: Configuring Domain Partitions

https://docs.oracle.com/middleware/1221/wls/WLSMT/config_domain_part.htm#WLSMT585

▪ WebLogic Multitenant: Configuring Resource Consumption Management

https://docs.oracle.com/middleware/1221/wls/WLSMT/config_rcm.htm#WLSMT630

▪ Exporting and Importing Partitions

https://docs.oracle.com/middleware/1221/wls/WLSMT/export_import.htm#WLSMT636

▪ WebLogic Server 12.2.1 – Converting Domains to Partitions (video)

https://www.youtube.com/watch?v=D1vQJrFfz9Q

▪ Migrating a Java EE Application to Oracle Java Cloud Service (tutorial)

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/javaservice/JCS/jcs_migration/jcs_migration.html

▪ Checking the Health of an On-Premise WebLogic Domain

https://docs.oracle.com/en/cloud/paas/java-cloud/jscug/checking-health-premises-weblogic-domain.html

▪ Oracle Java Cloud Service – AppToCloud Tooling

http://www.oracle.com/technetwork/topics/cloud/downloads/java-cloud-apptocloud-3042466.html

© Raastech, Inc. 2017 | All rights reserved. Slide 63 of 64@Raastech

Contact Information

▪ Ahmed Aboulnaga

▪ Technical Director

▪ @Ahmed_Aboulnaga

▪ ahmed.aboulnaga@raastech.com

© Raastech, Inc. 2017 | All rights reserved. Slide 64 of 64@Raastech

Q&A