• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Asadmin Webinar 12 Feb 2009
 

Asadmin Webinar 12 Feb 2009

on

  • 2,252 views

ASAdmin, the GlassFish CLI console. Second try

ASAdmin, the GlassFish CLI console. Second try

Statistics

Views

Total Views
2,252
Views on SlideShare
2,252
Embed Views
0

Actions

Likes
0
Downloads
18
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Asadmin Webinar 12 Feb 2009 Asadmin Webinar 12 Feb 2009 Presentation Transcript

    • GlassFish Admin CLI - asadmin (Past, Present and Future) Kedar Mhaswade km@dev.java.net Jane Young janey@dev.java.net February 12th 2009
    • Agenda • What asadmin is ... • GlassFish V2.x asadmin • What GlassFish V2 asadmin Lacked • Enter GlassFish V3 • Interactive Command Development • Exciting Features Planned • References • Questions? 2
    • What asadmin is ... Asadmin is: > Well, a Hidden Gem ;) > Extensive, Powerful, Scriptable Administrative Command Line Interface for GlassFish CLIP Compliant Grammar > A Very Stable Interface Countless Scripts Depend on it Savior for Automated Test Scripts 3
    • What asadmin is … (Quiz Time) Did you know? > Asadmin Manages Multiple Domains > Securely Administers on Single Port Speaks Beloved (?) HTTP > Has ~ 250 Commands (+/-) > Has a DSL (well, sort of) in Dotted Names Number of Commands is Reduced Cryptic Till You Get Them > Has a Minimal Shell 4
    • What asadmin is … (Architecture, sort of) Server Software is Complex, Needs Setup Commands (Local) Create-domain, create-node-agent ... Server Management Commands (Remote) Server Implements Most Commands Parsed Command Line + RPC Transport is HTTP Admin Admin Server (DAS) CLI Server (DAS) 5
    • GlassFish V2.x asadmin A Java HTTP/JMX Client to DAS Several Generic JMX Commands Uses JSR-160 (Little-Known) Implementation HTTP/S Has Parsing Framework and Commands Used Elsewhere (cli-framework) Some Form of Pluggability OpenESB Integration CLIDescriptor.xml 6
    • GlassFish V2.x asadmin Provides CRUD Support (Configuration) Generic Set/Get/List Monitoring (vmstat/prstat) Super-set of GUI Properties Files Not Just Domain.xml Keyword Search/Manpages List Set/Get Integration Database Operating System (SMF) 7
    • What it Lacks ... •Rather Monolithic >Hard to Extend, Plug Commands In >Not Dynamic •A Powerful/Useful Shell >Too Many Commands to Remember and Key-in! •Integration with Scripting Languages •Separation of Options (Command, asadmin) 8
    • Enter V3 (Prelude) 9
    • Changes in v3 asadmin Server Became Pluggable/Modular Asadmin Had to Follow A Rigorous Look at Command A Command Line With a Grammar A Set of Options and Operands (Parameters) A Java Class Implementing Functionality Adequate Hooks Into Infrastructure Data Transfer Between Client and Server Strings, Baby! 10
    • Changes in v3 asadmin – II Command Line Remains Parsing Moves to Server A General Purpose Injection Manager Injects Params into Object A Command is a POJO with AdminCommand Annotation A Set of @Params @AdminCommand (name=”mycmd”) A Report Filled In public class FooCommand { @Param String name; //--name @Param String value; // -- value @Param Boolean enabled; // public void execute(AdminCommandContext Context) { …} } 11
    • Changes in v3 asadmin – III Data Transfer A Simple Get/Post HTTP Request Get for URI Post for FileUpload Grizzly Adapter at the Server End java.util.Manifest (Yikes!) Coming Back Other Formats Totally Possible (hk2-agent) 12
    • Changes in v3 asadmin – IV As a Result, You as a Command Developer (and App Server Enhancer) Create Your Module/Container/Whatever Identify Admin Commands and Name Them Create Pojo's With @Param(s) Write Business Logic and Return the Result Drop in Module.jar in /modules Folder Run asadmin mycmd –opt1=v1 –opt2=v2 ... Forget Command Line Parsing And Get CLI for your Module for Free 13
    • V3 asadmin – How Commands Are Received Grizzly Adapter Called AdminAdapter Entertains Authenticated Requests Only Context Root: host:admin-port/__asadmin Supports Streaming Intercepts ALL Admin Requests Reads the Input Stream for POST and Uploads Files (Deploy) Invokes the Commands Returns the Result to OutputStream Writes a Manifest for CLI/NetBeans Writes an HTML for Browser Invocation 14
    • V3 asadmin – How Authentication Works Only Admin Users Should Be Able to Manage Requires HTTP BASE64 Authentication Admin-Realm (A File Realm – Remember admin-keyfile)? CLI Sends a BASE64-Encoded UserName and Password Provision of the so-called Anonymous Login Of Course Not Secure Need SSL Certificate Exchange 15
    • V3 asadmin – Are We Doing Enough? Enter V3 FCS 16
    • V3 FCS asadmin Build the Icing on the Cake No Changes to Basic API A Powerful Shell Alias History Completion, Navigation Separation of Options --host is NOT an option for create-cluster! 17
    • V3 FCS asadmin – II A Shell In the Browser? Cool and Useful, No Installation Required Add a Ruby Gem irb>> require 'asadmin' Gem install asadmin! irb>> domain = Domain.new(“localhost”); irb>> domain.each_application do { |app| puts “app: #{app.name}, type: #{app.type}” } app: trade2 type: web app: Twitterfeed type: jruby 18
    • V3 FCS asadmin – III A Client-side Preferences File Should asadmin be an OSGi System? Local Commands Made Pluggable Many More Commands Feature Parity With V2 Developer Profile And Compatibility 19
    • What Are Others Doing? JBoss 5.0 GA: • No changes in administration for the past 3 years. Same scripts: run, shutdown, twiddle (JMX based) • No commands for deployment. Applications are manually copied to the deploy directory. • No monitoring and diagnostics support BEA (Oracle) WebLogic 10g: • WLST – manages server lifecycle, deployment, diagnostics, navigation of MBeans • Hard to follow syntax. e.g. Invoke a Mbean Object: wls> obj s = j ar r ay. ar r ay( [ j ava. l ang. St r i ng( quot; oam ver quot; ) ] , j ava. l ang. O ect ) ser bj wls> st r s = j ar r ay. ar r ay( [ quot; j ava. l ang. St r i ngquot; ] , j ava. l ang. St r i ng) wls> i nvoke( ' l ookupSer ver ' , obj s, st r s) • Command category to WLST is not extensible GF asadmin : Most powerful and user friendly amongst 20 all others!
    • References users@glassfish.dev.java.net admin@glassfish.dev.java.net km@dev.java.net janey@dev.java.net 21
    • Got Questions? 22