Admin Cli Jane Young Kedar Mhaswade 22 Jan09

750 views

Published on

GlassFIsh Administration Console CLI

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
750
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Admin Cli Jane Young Kedar Mhaswade 22 Jan09

  1. 1. GlassFish Admin CLI - asadmin Jane Young janey@dev.java.net Kedar Mhaswade km@dev.java.net January 22, 2009
  2. 2. Agenda • Admin CLI • CLI Syntax • Tips > Multimode > Environment Variables > Passwords > Closest Matching > Dotted-Name Commands > Debug • V2 and V3 • Q.A. 2
  3. 3. Admin CLI - asadmin • Command Line Administration tool > Administers domains, nodeagents, instances > Deploys applications > Configures and manages resources > Monitors resources • Everything you do in Admin console, you can do it with asadmin and much more! • To get a list of all the commands, “asadmin help”.
  4. 4. Syntax asadmin command-name options operands > command-name: start-domain, create-domain stop-domain etc. > options: boolean, short-options, long-options > operands To get the syntax for a command, “asadmin command-name –help” or “asadmin help command-name” • Compliant with OpenSolaris CLIP Standards: http://www.opensolaris.org/os/community/arc/caselo g/2006/062/
  5. 5. Tip 1 - multi-mode • Execution of many commands in asadmin shell • Environment Variables are preserved in the asadmin session. • Execution of many commands specified in a file > asadmin multimode –file <file contains commands> • Faster performance since commands are executed in the same Java VM.
  6. 6. Tip 2 - Environment Variables • AS_ADMIN_<option-name> e.g. AS_ADMIN_USER, AS_ADMIN_HOST etc. > In SingleMode: > Set environment variables in the shell > In MultiMode: > export AS_ADMIN_<option-name>=<options-value> > unset AS_ADMIN_<option-name> • You don't need to specify the options on the command line when it's set in the environment variable.
  7. 7. Tip 3 - Password Handling • Interactive > If true (by default), passwords are prompted • Passwordfile > Save passwords in a file and pass it as –passwordfile option > Passwords are saved in the file with the format: AS_ADMIN_<password-name>=<password-value> • login command / create-domain --savelogin > admin passwords are encrypted in $HOME/.asadminpass file. > No need to provide passwordfile option on command line
  8. 8. Tip 4 - Closest Matching • Finding commands in asadmin > Accepts wildcards > asadmin jdbc – returns all the commands with jdbc > asadmin ^create* - returns all the command that starts with create. • Catches typos and return the closest matching commands > asadmin create-domian – returns the correct command “asadmin create-domain”
  9. 9. Tip 5 – Dotted Name Commands • get > Gets the names and values of attributes > Use wildcard character: “asadmin get ”, “asadmin get server.” > Use –monitor option for monitoring. Don't forget to update the monitoring-level for the resource you want to monitor. • set > Sets the values of one or more configurable attribute. > e.g. “asadmin set <name1>=<value1> <name2>=<value2> • List > Lists configuration elements
  10. 10. Tip 6 -Debug • V2 > Add -DDebug in asadmin • V3 > Set AS_DEBUG in environment
  11. 11. V2 vs V3 • V2 > Command classes are executed on client side > Commands are bundled in admin-cli.jar and appserv- ser.jar > Uses JMX connector to communicate with the server • V3 > Command classes are executed on server side > Uses REST-like HTTP protocol to communicate with the server. 10
  12. 12. Resources • V2 > Admin Guide: http://docs.sun.com/doc/819-3671 • V3 > Admin Infrastructure Onepager: https://glassfish.dev.java.net/nonav/v3/admin/planning/prelude • Forum > admin@glassfish.dev.net • Weekly Admin iTeam Meeting > http://wiki.glassfish.java.net/Wiki.jsp?page=GlassFishV2Admin 12

×