Part 4: Glassfish V3 Pet Catalog sample DEMO in VM Template - SW Installation

OpenSolaris 200906 JeOS Prototype was designed as PURE CLI enviroment providing main building stone for creation of Virtual Appliances or VM Templates

In this example I will DEMOnstrate creation of Evaluation type Virtual Appliance / VM Template which will leveradge OpenSolaris 200906 JeOS prototype and just in Dec/09 released Glassfish v3, Java EE 6 and Netbeans 6.8 with simple Java EE 6 demo. This entry is part of Virtual Appliances & OVF workshop.

New Glassfish V3 introduce an unique network repository based modular structure, so we can more easily create really simple initial DEMO setup which user can extend by installation more samples right from Glassfish V3 repository or from Netbeans GUI.


Step 2: Add layered software

2e: Install and Configure Glassfish V3 (Community Edition)

We wil use a download Glassfish V3 community edition Web Profile , we can extend it later (if needed) with repository based installation , see more at:

GlassFish Project - v3 Final

Glassfish V3 - Resources and Links

OpenSolaris is dual arch 32bit and 64bit environment, also for 64 bit Java setup we can check later Putting GlassFish v3 in Production: Essential Surviving Guide

1. Install Java 6 dev to JeOS instance

Check if we have in JeOS all OS level dependencies (OS core and Java JDK)

Note: We will install both 32bit and 64 bit environments.

osol@osol-jeos:~$ pfexec pkg refresh --full
osol@osol-jeos:~$ pfexec pkg list -rs SUNWj6cfg SUNWj6dev SUNWj6dmo SUNWj6dmx \\
 SUNWj6dvx SUNWj6jmp SUNWj6man SUNWj6rt SUNWj6rtx
NAME (PUBLISHER)               SUMMARY
SUNWj6cfg                      JDK 6.0 Host Config. (1.6.0_13)
SUNWj6dev                      JDK 6.0 Dev. Tools (1.6.0_13)
SUNWj6dmo                      JDK 6.0 Demo Programs (1.6.0_13)
SUNWj6dmx                      JDK 6.0 64-bit Demo Programs (1.6.0_13)
SUNWj6dvx                      JDK 6.0 64-bit Dev. Tools (1.6.0_13)
SUNWj6jmp                      JDK 6.0 Man Pages: Japan (1.6.0_13)
SUNWj6man                      JDK 6.0 Man Pages (1.6.0_13)
SUNWj6rt                       JDK 6.0 Runtime Env. (1.6.0_13)
SUNWj6rtx                      JDK 6.0 64-bit Runtime Env. (1.6.0_13)
osol@osol-jeos:~$ pfexec pkg install SUNWj6rt
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1     686/686   31.77/31.77

PHASE                                        ACTIONS
Install Phase                                880/880
Deleting content cache

osol@osol-jeos:~$ pfexec pkg install SUNWj6rtx
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1       61/61     6.18/6.18

PHASE                                        ACTIONS
Install Phase                                  89/89
Deleting content cache
osol@osol-jeos:~$ pfexec pkg install SUNWj6dev
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1     284/284   33.53/33.53

PHASE                                        ACTIONS
Install Phase                                351/351
Deleting content cache

osol@osol-jeos:~$ pfexec pkg install SUNWj6dvx
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1       31/31     0.66/0.66

PHASE                                        ACTIONS
Install Phase                                  55/55
Deleting content cache

2. Check size after JDK 6 installation

pfexec zfs list
NAME                               USED  AVAIL  REFER  MOUNTPOINT
rpool                             1.70G  6.11G  83.5K  /rpool
rpool/ROOT                         848M  6.11G    19K  legacy
rpool/ROOT/opensolaris             848M  6.11G   848M  /
rpool/dump                         384M  6.11G   384M  -
rpool/export                        89K  6.11G    20K  /export
rpool/export/home                   69K  6.11G    20K  /export/home
rpool/export/home/osol              49K  6.11G    30K  /export/home/osol
rpool/export/home/osol/unbundled    19K  6.11G    19K  /export/home/osol/unbundled
rpool/swap                         512M  6.61G    20K  -

osol@osol-jeos:~$ pfexec df  -h
Filesystem            Size  Used Avail Use% Mounted on
rpool                                               6.2G   84K  6.2G   1% /rpool
rpool/ROOT/opensolaris                   7.0G  848M  6.2G  12% /
rpool/export                                     6.2G   20K  6.2G   1% /export
rpool/export/home                            6.2G   20K  6.2G   1% /export/home
rpool/export/home/osol                     6.2G   30K  6.2G   1% /export/home/osol
rpool/export/home/osol/unbundled     6.2G   19K  6.2G   1% /export/home/osol/unbundle

3. Download Glassfish V3 Community edition Web Profile, see more at:

GlassFish Project - v3 Final

osol@osol-jeos:~/# cd ~/unbundled
osol@osol-jeos:~/unbundled$ wget http://download.java.net/glassfish/v3/release/glassfish-v3-web.zip
Length: 47,244,334 (45M) [application/zip]

4. Unpack glassfish-v3-web.zip

osol@osol-jeos:~/unbundled$ unzip glassfish-v3-web.zip
  inflating: glassfishv3/javadb/LICENSE
 .....
  inflating: glassfishv3/javadb/RELEASE-NOTES.html
osol@osol-jeos:~/unbundled$ rm glassfish-v3-web.zip

5. Bootstrap (install) a pkg framework inside glassfishv3

Glassfish V3 use a iPKG based repositories and GUI based update-tool, we will try to demonstrate to developers hoe to use command line PKG tools instead.

If you prefer to use a GUI based update-tool, you need to ass to JeOS minimal GUI (X/Gnome) enviroment {add link here}

osol@osol-jeos:~/unbundled$ cd ./glassfishv3/bin
osol@osol-jeos:~/unbundled/glassfishv3/bin$ ./pkg

The software needed for this command (pkg) is not installed.

When this tool interacts with package repositories, some system information
such as your system's IP address and operating system type and version
is sent to the repository server. For more information please see:

http://wiki.updatecenter.java.net/Wiki.jsp?page=UsageMetricsUC2

Once installation is complete you may re-run this command.

Would you like to install this software now (y/n): y

Proxy: Using system proxy settings.
Install image: /export/home/osol/unbundled/glassfishv3
Installing pkg packages.
Initialization complete.

Software successfully installed. You may now re-run this command (pkg).

Note: Check, if we need to add this note to VM template docs !?

6. Check iPKG bootstrap

osol@osol-jeos:~/unbundled/glassfishv3/bin$ cd ..

osol@osol-jeos:~/unbundled/glassfishv3$  ./bin/pkg version
1.122.2-38.2493

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg publisher
PUBLISHER                             TYPE     STATUS   URI
stable.glassfish.org     (preferred)  origin   online   http://pkg.glassfish.org/v3/stable/
contrib.glassfish.org                 origin   online   http://pkg.glassfish.org/v3/contrib/
contrib.glassfish.sun.com              origin   online   http://pkg.sun.com/glassfish/v3/contrib/
dev.glassfish.org                     origin   online   http://pkg.glassfish.org/v3/dev/
release.glassfish.sun.com              origin   online   http://pkg.sun.com/glassfish/v3/release/

7. Now we will check iPKG command line functionality Check ZFS used space before SW installation 7a. Now you have GlasfishV3 pkg root installed installed under ~/unbundled/glassfishv3/,

of course there is still a OS System iPKG root under /, see:

osol@osol-jeos:~/unbundled/glassfishv3$  cd ~
osol@osol-jeos:~/$  /usr/bin/pkg version
87d6ba4c8e1c

osol@osol-jeos:~$ /usr/bin/pkg publisher
PUBLISHER                             TYPE     STATUS   URI
opensolaris.org          (preferred)  origin   online   http://pkg.opensolaris.org/release/
contrib                               origin   online   http://pkg.opensolaris.org/contrib/

7b. Disable some Glassfish v3 repositories, for now some repositories show same version of packages.

Plus GUI based tools can easily filter by repositoy, this is for now difficult to make in iPKG command line,

pkg list for now can't filter by repositories, so we need to disable some of them as an workaround.

osol@osol-jeos:~/$ cd ~/unbundled/glassfishv3$
osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg list -sa glassfish-full-profile
NAME (PUBLISHER)               SUMMARY
glassfish-full-profile         GlassFish Full Profile
glassfish-full-profile (release.glassfish.sun.com) GlassFish Full Profile
glassfish-full-profile (dev.glassfish.org) GlassFish Full Profile

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg list -va glassfish-full-profile
FMRI                                                             STATE      UFIX
pkg:/glassfish-full-profile@3.0,0-74.2:20091203T062408Z          known      ----
pkg://release.glassfish.sun.com/glassfish-full-profile@3.0,0-74.2:20091203T062408Z known      ----
pkg://dev.glassfish.org/glassfish-full-profile@3.0,0-74:20091125T094019Z known      u---

So I will temporally disable dev and release, leaving only stable and contribs ones

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg set-publisher --disable dev.glassfish.org
osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg set-publisher --disable release.glassfish.sun.com

osol@osol-jeos:~/unbundled/glassfishv3$  ./bin/pkg publisher
PUBLISHER                             TYPE     STATUS   URI
stable.glassfish.org     (preferred)  origin   online   http://pkg.glassfish.org/v3/stable/
contrib.glassfish.org                 origin   online   http://pkg.glassfish.org/v3/contrib/
contrib.glassfish.sun.com              origin   online   http://pkg.sun.com/glassfish/v3/contrib/

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg publisher -a
PUBLISHER                             TYPE     STATUS   URI
stable.glassfish.org     (preferred)  origin   online   http://pkg.glassfish.org/v3/stable/
contrib.glassfish.org                 origin   online   http://pkg.glassfish.org/v3/contrib/
contrib.glassfish.sun.com              origin   online   http://pkg.sun.com/glassfish/v3/contrib/
dev.glassfish.org        (disabled)   origin   online   http://pkg.glassfish.org/v3/dev/
release.glassfish.sun.com (disabled)   origin   online   http://pkg.sun.com/glassfish/v3/release/

7c. See what we have now installed by default from Glassfish V3 repos:

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg refresh --full
osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg list -s
NAME (PUBLISHER)               SUMMARY
felix                          Apache Felix
glassfish-common               GlassFish Common Components
glassfish-corba-base           Base CORBA for GlassFish
glassfish-ejb-lite             GlassFish EJB Lite Container
glassfish-grizzly              Grizzly NIO Framework
glassfish-grizzly-full         More Grizzly NIO Framework
glassfish-gui                  GlassFish Administration Console
glassfish-hk2                  HK2
glassfish-javahelp             JavaHelp for GlassFish
glassfish-jca                  GlassFish JCA
glassfish-jcdi                 GlassFish JCDI
glassfish-jdbc                 GlassFish JDBC
glassfish-jpa                  GlassFish JPA
glassfish-jsf                  GlassFish JSF
glassfish-jta                  GlassFish Local Transaction Support
glassfish-jts                  GlassFish XA Transaction Support
glassfish-management           GlassFish REST Management
glassfish-nucleus              GlassFish Nucleus
glassfish-registration         GlassFish Registration
glassfish-scripting            GlassFish Scripting
glassfish-upgrade              GlassFish Upgrade Tool
glassfish-web                  GlassFish Web Container
glassfish-web-incorporation    GlassFish Web Profile Incorporation
glassfish-web-profile          GlassFish Web Profile
javadb-client                  Java DB Client
javadb-common                  Java DB Common Files
javadb-core                    Java DB Server
jersey                         Jersey Core, RESTful Web services for GlassFish
pkg                            pkg(5) Image Packaging System
pkg-java                       pkg(5) Client Java API
pkg-toolkit-incorporation      Update Center Toolkit Incorporation
python2.4-minimal              Python 2.4 Minimized

7d. List for available packages in Glassfish V3 repositories:

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg list -sa
NAME (PUBLISHER)               SUMMARY
ant (contrib.glassfish.org)    Apache Ant Build Tool
felix                          Apache Felix
glassfish-appclient            GlassFish Appclient
glassfish-cmp                  GlassFish CMP
glassfish-common               GlassFish Common Components
glassfish-common-full          GlassFish Commons Full Profile
... 
mq-server                      Message Queue Server
pkg                            pkg(5) Image Packaging System
pkg-extra-tools                pkg(5) Extra Tools
pkg-java                       pkg(5) Client Java API
pkg-toolkit                    Update Center Toolkit
pkg-toolkit-incorporation      Update Center Toolkit Incorporation
python2.4-minimal              Python 2.4 Minimized
sun-javaee-engine              Java EE Service Engine
updatetool                     Update Tool
wxpython2.8-minimal            wxPython 2.8 Minimized

osol@osol-jeos:~/GFv3sample/glassfishv3$  ./bin/pkg list -va
FMRI                                                             STATE      UFIX
pkg://contrib.glassfish.org/ant@1.7.1,0-0.6:20081111T231040Z     known      ----
pkg:/felix@2.0.2,0-0:20091203T054540Z                            installed  ----
pkg:/glassfish-appclient@3.0,0-74.2:20091203T061841Z             known      ----
pkg:/glassfish-cmp@3.0,0-74.2:20091203T060956Z                   known      ----
pkg:/glassfish-common@3.0,0-74.2:20091203T062350Z                installed  ----
pkg:/glassfish-common-full@3.0,0-74.2:20091203T060704Z           known      ----
.....
pkg:/mq-locale@4.4.1,0-7.2:20091119T083943Z                      known      ----
pkg:/mq-server@4.4.1,0-7.2:20091119T083901Z                      known      ----
pkg:/pkg@1.122.2,0-38.2493:20091008T195241Z                      installed  ----
pkg:/pkg-extra-tools@0.2.0,0-38.2493:20091008T194915Z            known      ----
pkg:/pkg-java@1.122,0-38.2493:20091008T194916Z                   installed  ----
pkg:/pkg-toolkit@2.3.0,0-38.2493:20091008T195241Z                known      ----
pkg:/pkg-toolkit-incorporation@2.3.0,0-38.2493:20091008T195241Z  installed  ----
pkg:/python2.4-minimal@2.4.4.0,0-38.2493:20091008T195303Z        installed  ----
pkg:/sun-javaee-engine@3.0,0-74.2:20091203T062453Z               known      ----
pkg:/updatetool@2.3.0,0-38.2493:20091008T195325Z                 known      ----
pkg:/wxpython2.8-minimal@2.8.10.1,0-38.2493:20091008T195344Z     known      ----

7e. See more information about Application Servers profiles (Including license)

osol@osol-jeos:~/GFv3sample/glassfishv3$ ./bin/pkg info -r glassfish-full-profile
          Name: glassfish-full-profile
       Summary: GlassFish Full Profile
      Category: Application Servers
         State: Not installed
     Publisher: stable.glassfish.org
       Version: 3.0
 Build Release: 0
        Branch: 74.2
Packaging Date: Thu Dec 03 06:24:08 2009
          Size: 35.27 kB
          FMRI: pkg:/glassfish-full-profile@3.0,0-74.2:20091203T062408Z

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg info -r --license glassfish-full-profile | more
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
.....

7f. Lets make also some repository searches (Local and Remote ones):

osol@osol-jeos:~/GFv3sample/glassfishv3$ pkg rebuild-index
PHASE                                          ITEMS
Indexing Packages                              32/32

osol@osol-jeos:~/GFv3sample/glassfishv3$ ./bin/pkg search -l -I 'glassfish'
INDEX      ACTION    VALUE                     PACKAGE
basename   dir       glassfish                 pkg:/glassfish-management@3.0-74.2
basename   dir       glassfish                 pkg:/glassfish-gui@3.0-74.2
....
basename   dir       glassfish                 pkg:/glassfish-jts@3.0-74.2
basename   dir       glassfish                 pkg:/glassfish-registration@3.0-74.2

osol@osol-jeos:~/GFv3sample/glassfishv3$ ./bin/pkg search -l -I '<\*-web-\*>'
PACKAGE
pkg:/glassfish-common@3.0-74.2
pkg:/glassfish-web-incorporation@3.0-74.2
pkg:/glassfish-web-profile@3.0-74.2
pkg:/glassfish-web@3.0-74.2

7g. You can also search a repository which are disable by directly put their URL into search string:

osol@osol-jeos:~/GFv3sample/glassfishv3$ ./bin/pkg search -l -s http://pkg.glassfish.org/v3/dev/ -I '<\*-web-\*>'
PACKAGE
pkg:/glassfish-common@3.0-74.2
pkg:/glassfish-web-incorporation@3.0-74.2
pkg:/glassfish-web-profile@3.0-74.2
pkg:/glassfish-web@3.0-74.2
pkg:/glassfish-common@3.0-50 (dev.glassfish.org)
...
pkg:/glassfish-common@3.0-74 (dev.glassfish.org)
pkg:/glassfish-full-incorporation@3.0-69 (dev.glassfish.org)
...
pkg:/glassfish-full-incorporation@3.0-74 (dev.glassfish.org)
pkg:/glassfish-full-profile@3.0-62 (dev.glassfish.org)
...
pkg:/glassfish-web-profile@3.0-74 (dev.glassfish.org)
pkg:/glassfish-web@3.0-50 (dev.glassfish.org)
...
pkg:/glassfish-web@3.0-74 (dev.glassfish.org)

8. Check Glassfish V3 functionality

8a. Start default Glassfish V3 instance "domain1"

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/asadmin start-domain
Waiting for DAS to start ...
Started domain: domain1
Domain location: /export/home/osol/unbundled/glassfishv3/glassfish/domains/domain1
Log file: /export/home/osol/unbundled/glassfishv3/glassfish/domains/domain1/logs/server.log
Admin port for the domain: 4848
Command start-domain executed successfully.
osol@osol-jeos:~/unbundled/glassfishv3$ netstat -a | grep 8
      \*.8080               \*.\*                0      0 49152      0 LISTEN
      \*.8181               \*.\*                0      0 49152      0 LISTEN
      \*.4848               \*.\*                0      0 49152      0 LISTEN
      \*.8686               \*.\*                0      0 49152      0 LISTEN

8b. Go to Glassfish V3 administration interface

Go to http://IP.OF.JEOS.INSTANCE:4848/
Wait until Admin Console is initialized for the first time
Click on Register  = Reminder me Later

Security note: Glassfish V3 Community edition is by default in Developer mode , so no password is needed for admin user

8c. Go to Glassfish V3 main page HTTP

Go to http://IP.OF.JEOS.INSTANCE:8080/
You will default Glassfish welcome page

8d. Go to Glassfish V3 main page HTTPS

Go to https://IP.OF.JEOS.INSTANCE:8181/
Accept self-sign certificate
You will default Glassfish welcome page

8a. Stop default Glassfish V3 instance "domain1"

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/asadmin stop-domain
Waiting for the domain to stop ....
Command stop-domain executed successfully.

9. Tips: Install additional Glassfish and Java EE Components and Documentation

9a. Set cleaning cache on success

osol@osol-jeos:~/unbundled/glassfishv3$ pkg property  flush-content-cache-on-success
  PROPERTY                       VALUE
  flush-content-cache-on-success False
osol@osol-jeos:~/unbundled/glassfishv3$ pkg set-property  flush-content-cache-on-success True
osol@osol-jeos:~/unbundled/glassfishv3$ pkg property  flush-content-cache-on-success
  PROPERTY                       VALUE
  flush-content-cache-on-success True

9b. For some parts like integrated documentation you need to re-enable release repository

osol@osol-jeos:~/unbundled/glassfishv3$  ./bin/pkg set-publisher --enable release.glassfish.sun.com

9c. Now you can looks for example for docs

Note: We will not install them to save space on VM templates, we will document in VM Template as sample

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg list -as | grep -i docs
  glassfish-docs (release.glassfish.sun.com) Sun GlassFish Enterprise Server v3 Documentation
  javaee-javadocs (release.glassfish.sun.com) Java EE 6 API Specification
  jersey-docs-and-examples       Jersey Examples And Documentation, RESTful Web services for GlassFish
  mq-docs                        Message Queue Javadocs and Examples
  mq-docs (release.glassfish.sun.com) Message Queue Javadocs and Examples

Note: In release repository can be also a commercial software with various usage and / or distribution limitations, see individual packages licenses

10. Process some initial minimal cleaning

10a. pkg download caches

pkg download cache will by cleaned automatically , but we can check it

osol@osol-jeos:~/unbundled/glassfishv3$ ls ./.org.opensolaris,pkg/download/

10b. Clean pkg history

osol@osol-jeos:~/unbundled/glassfishv3$ ./bin/pkg purge-history

11. Check used space after Glassfish V3 installation

11a. Check ZFS used space after Glassfish V3 installation

osol@osol-jeos:~/unbundled/glassfishv3$ zfs list
NAME                               USED  AVAIL  REFER  MOUNTPOINT
rpool                             1.84G  5.97G  83.5K  /rpool
rpool/ROOT                         849M  5.97G    19K  legacy
rpool/ROOT/opensolaris             849M  5.97G   849M  /
rpool/dump                         384M  5.97G   384M  -
rpool/export                       142M  5.97G    20K  /export
rpool/export/home                  142M  5.97G    20K  /export/home
rpool/export/home/osol             142M  5.97G  44.5K  /export/home/osol
rpool/export/home/osol/unbundled   142M  5.97G   142M  /export/home/osol/unbundled
rpool/swap                         512M  6.47G    20K  -

osol@osol-jeos:~/unbundled/glassfishv3$ 
osol@osol-jeos:~/unbundled/glassfishv3$ df -h
Filesystem                                    Size  Used Avail Use% Mounted on
rpool                                            6.0G   84K  6.0G   1% /rpool
rpool/ROOT/opensolaris                6.8G  849M  6.0G  13% /
rpool/export                                  6.0G   20K  6.0G   1% /export
rpool/export/home                         6.0G   20K  6.0G   1% /export/home
rpool/export/home/osol                  6.0G   45K  6.0G   1% /export/home/osol
rpool/export/home/osol/unbundled  6.2G  142M  6.0G   3% /export/home/osol/unbundled

11a. Check Virtual Disk and Archive sizes after Glassfish V3 installation

osol@osol-jeos:~/unbundled/glassfishv3$ pfexec init 0

Virtual Disk size grow to 1156MB and 7Z ultra size is now 369MB

Note: Image grow also due to ZFS copy-on-write, we will shrink image as part of Cleaning Step

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Hands-on experience with Virtualization

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today