• No results found

Top Weblogic Tasks You can Automate Now

N/A
N/A
Protected

Academic year: 2021

Share "Top Weblogic Tasks You can Automate Now"

Copied!
37
0
0

Loading.... (view fulltext now)

Full text

(1)

REMINDER

Check in on the COLLABORATE mobile app

Top Weblogic Tasks You can

Automate Now

Prepared by: Mrityunjay Kant

Practice Manager, SOA & Integration Services AST Corporation

Session ID#: 10506

(2)

Specialized. Recognized. Preferred.

3 Time Oracle Excellence

Award Winner 2014 Chicago TribuneTop 100 Workplaces Fastest Growing Companies2014, 2013, 2012 Inc. 5000

2014, 2012 Best & Brightest Companies

to Work For

2011 Inc. Top Small Company Workplaces

OUR SERVICES ORACLE PARTNERSHIP ORACLE SPECIALIZED

 Enterprise Resource Planning  Business Intelligence  EPM-Hyperion  Middleware  CRM  Managed Services  Education / Oracle University

 Project Advisory Services

 Oracle Platinum Partner  Pillar Partner

• SOA

• Business Intelligence • Hyperion

 Oracle University Approved Education Center

 Oracle University Reseller  Oracle Accelerator Implementer  Oracle Managed Cloud Services

Implementer

 Oracle Cloud Marketplace  Small Business Strategy Council  Advanced Partner Support

 EBS Financial Management  EBS Human Capital Management  EBS Supply Chain Management  BI Applications

 BI Foundation

 Service Oriented Architecture  Public Sector

 Utilities

 Travel & Transportation

 Education & Research  Application Development

Framework 11g

 WebCenter Content 11g

 Access Management Suite Plus 11g  Hyperion Planning 11

 Essbase 11  Database 11g

(3)

Agenda

■ About Weblogic Server

■ Weblogic tasks you can Automate Now

■ Weblogic Cluster Administration

■ Q&A

(4)

Weblogic Server – Introduction

■ #1 in worldwide Application Server Software

■ The Foundation for Oracle Applications and Middleware Technologies Platform

■ The Foundation for Cloud Applications and Application Infrastructure Consolidation

■ Supported features such as

 Java EE Standards

 Scalability/Clustering

 Monitoring & Management

 Enterprise Security

 Enterprise Messaging

 Linear Scalability

 Coherence etc…

(5)

What is Weblogic Scripting (WLST)?

■ Scripting Interface to Weblogic server

■ Based on Java Scripting Interpreter - Jython

■ Provides repeatable process for propagating configuration

changes across environments

■ Quickly allow environments to be replicated and migrated

(6)

Interaction Modes

■ Interactive

▪ Enter a command and view response at a command-line prompt

▪ In online mode shell maintains a persistent connection to a WLS instance

■ Script

▪ Text file with a .py extension

▪ Executed using Jython commands for running scripts

▪ Invoke a series of WLST commands without requiring your input

■ Embedded

▪ Instantiate WLST interpreter in your Java code

(7)

Connection Modes

■ Analogous to the

Configuration Wizard

■ Read and write access to the configuration data that is

persisted in the domains configuration directory or domain template JAR

■ Intended to create domain or modify a non-running domain

■ Used during WLS install to create samples domain

■ Analogous to the

Administration Console

■ JMX client

■ Interacts with server’s MBeans

■ Intended as runtime management tool:

configuration, management, deployment and monitoring

(8)

WLST Offline Can/Can’t Do

■ Create/modify templates

■ Create domains

■ Extend domains

■ Access and modify

configurations for offline domain

■ View runtime performance data

■ Modify security data

Can Do Can’t Do

(9)

WLST Online Can/Can’t Do

■ Change Configuration

■ View runtime data

■ Deploy applications

■ Start/stop servers

■ Create a domain (must be offline mode)

(10)

Invoking WLST (Online)

■ Ensure you have the Weblogic server installed!

■ Remember all commands are case sensitive

■ Set the run env with following script:

▪ WL_HOME\server\bin\setWLSEnv

■ Enter following command to run WLST:

▪ java weblogic.WLST

■ Starts in offline mode

■ Connect to domain ▪ wls:/(offline)>

(11)

Traversing Mbean Trees

■ Simpler than JMX – no need to know JMX object name

■ Mbeans are hierarchical, similar to a file system, with DomainMBean at top of tree

■ Use commands similar to Unix to traverse

▪ cd(), ls()

■ Syntax is same as WLST offline

Domain MBean (root)

(12)

Available Mbean Trees

■ domainConfig

▪ Configuration hierarchy of the entire domain; represents configuration MBeans in RuntimeMBeanServer

■ domainRuntime

▪ Hierarchy of runtime Mbeans for entire domain; read only

■ serverConfig

▪ Configuration hierarchy (configuration Mbeans) of the server you are connected to; read only

■ serverRuntime

(13)

Available Mbean Trees

■ edit

▪ Writable domain configuration with pending changes; represents configuration MBeans in EditMBeanServer

■ jndi

▪ Read-only JNDI tree for the server you are connected to

■ custom

▪ List of custom MBeans

(14)

Switching Between Trees

■ Use appropriate command to move to a different tree

▪ domainConfig() ▪ serverConfig() ▪ domainRuntime() ▪ serverRuntime() ▪ edit() ▪ jndi() ▪ custom()

(15)

Changing Configuration (Online)

Step Syntax

Change to the edit tree wls:/wl_server/domainConfig> edit()

Get an edit lock wls:/wl_server/edit> startEdit()

Make Changes wls:/wl_server/edit !> cmo.createServer(managedServer1”) wls:/wl_server/edit !> cd('/Servers/managedServer1') wls:/wl_server/edit !> cmo.setListenPort(8001) wls:/wl_server/edit !> cmo.setListenAddress(“my-address”)

Save and implicitly validate your changes wls:/wl_server/edit !>save()

(16)

Current Management Object

■ CMO variable – current management object

▪ Java bean that serves as proxy for direct access to the WLS MBean

▪ Makes it easy to interact with Mbean – get and set attributes, other commands

▪ Always set to the current WLST path

▪ Only available for WLS MBeans, not custom MBeans

■ Example:

▪ wls:/mydomain/edit>

cmo.setAdministrationPort(9091)

(17)

Start/Stop Server

■ Invoke WLST

▪ java weblogic.WLST

■ Connect to Node Manager

▪ nmConnect('weblogic', 'welcome1', 'localhost', '5556',

'mydomain',’/usr/oracle/wls/user_projects/domai ns/mydomain',‘plain')

■ Start Server (can be admin or managed server)

▪ nmStart(‘serverName’)

■ Stop Server

▪ nmKill(‘serverName’)

■ Server Status

(18)

Server Lifecycle commands using WLST

■ You can also manage server lifecycle through WLST without using node manager commands

startServer – start the Administration server

start – Start a managed server instance or cluster using

Node Manager

suspend – Suspend a running server

resume - Resume a suspended server

shutdown – Gracefully shutdown a running server instance

or cluster

(19)
(20)

Scripting Basics

■ Each Script has 4 basic parts

▪ Import Section

▪ Global Variables

▪ Definitions – class/functions

▪ Main program

■ Data Types

Base Datatypes integer, float, long, char, str, bool

Collection Types list, dictionary, tuple, sequences, maps etc

(21)

Automated start Admin Server

■ Create a domain.properties file

■ Create a Start_Admin.py script file

■ Execute the script from command line or shell/batch script

(22)

Send Email on Server state

■ Ready to use script, just change Admin email

■ Does not need cron job for scheduling!

■ Admin server need not be running for this script to run

■ More reliable than just checking serer logs

■ Bonus Script – send email on application status!

(23)

Create a Data Source

■ Can create multiple data sources with one script

■ Properties file contains all details for data sources

■ Can be used for creation of a new environment

■ Execute using following command:

(24)

Start/Stop Data Source

■ To shutdown a data source:

connect(‘weblogic’,welcome1’,'t3://localhost:7001')

domainRuntime()

cd(‘ServerRuntimes/AdminServer/JDBCServiceRuntime/AdminServer/ JDBCDataSourceRuntimeMBeans/TestDS’)

objectArray = jarray.array([], java.lang.Object)

stringArray = jarray.array([], java.lang.String)

invoke(‘shutdown’, objectArray, stringArray)

exit()

(25)

Forcibly Rotate Server Logs

■ Comes handy if the log file is too big

■ Can be run anytime as needed

■ Ability to adjust max log file size

(26)

Deploy Apps

■ Allow deployment of apps using script

■ Can recursively pick apps form a dir and deploy

▪ List of applications specified in property file

■ Easy setup of a new env!

■ Can also be used to un-deploy applications.

(27)

Creating Users and Groups

■ Can create multiple users and groups with one script

■ Properties file contains all details for users and groups

■ Can be used for creation of a new environment

■ Execute using following command:

(28)

Disable/Enable Admin Console

■ Provides additional security

■ Prevents unauthorized access

■ May be required by policy or for audit compliance

■ Disable Admin console

connect("weblogic","welcome1","t3://localhost:7001") edit() startEdit() cmo.setConsoleEnabled(false) save() activate() disconnect() exit()

(29)
(30)

What is a Cluster?

■ Multiple Servers running together as one unit

■ Can be on same or different machines

■ Appears to clients as a single unit

(31)

Why Cluster?

■ Scalability

■ High-Availability

■ Application Fail over

■ Load Balancing

(32)

What can be clustered?

■ Servlets

■ JSPs

■ EJBs

■ Remote Method Invocation (RMI) objects

■ Java Messaging Service (JMS) destinations

■ Web Services (if cluster aware)

■ These cannot be clustered:

▪ File services including file shares

(33)

Dynamic Clusters

■ Server instances that can be scaled at runtime

■ Meets peak application needs

■ Can be destroyed when not needed

(34)

Clustering Best Practices

■ Plan for clusters from Day 1

▪ High Availability

▪ Scalability

▪ Zero downtime upgrades!

■ Use scripts to monitor managed server states

■ Keep log rotation in check

■ Configure In-Memory Replication

▪ HTTP Session state management

■ Ask developers to design idempotent services for clusters

▪ Use Weblogic Clustering API

■ Don’t put cluster nodes in DMZ – Web and Application Nodes

■ Use logical DNS names instead of IP addresses

(35)
(36)

Thank You!

Mrityunjay Kant

(37)

Please complete the session

evaluation

We appreciate your feedback and insight

References

Related documents

4.3 Paper III: Accessibility percolation and first-passage site percolation on the unoriented binary hypercube 15 I On the existence of accessible paths in various mod- els of

The 2012 Asset Health Management Survey provided here indicates that in every industry, regardless of size, there is a very real opportunity for improvement in this vitally

Using data from Dealogic and from public reports of Banco de España, the paper explores three main changes in the composition of assets and liabilities of Spanish banks during the

What was needed therefore was the generation of commitment to upskilling in pursuit of competitiveness at 

This model is of interest in that it renders the safety question algorithmically decidable - for a set of operations that has yet to be determined – by means of graph-based

GOREGAON SANJAY GANDHI NATIONAL PARK Towards Western Suburbs Towards Sion Ghodbunder Road MULUND YEOOR HILLS GODREJ EXQUISITE Eastern Mulund Station M.. Source:

Este proceso/método puede utilizarse para crear un mortero adhesivo de color para facilitar la instalación de mosaicos de vidrio traslúcido, transparente u opaco, así como de

Discovery
   Plan
Member
Advocacy
   Gathering
informa7on
from
plan
members
and
 their
families
in
real
7me