Part 5: 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

Step 2f: Install and configure MySQL (WebStack)

In last entry I demonstrate then we can use a command line iPKG client for Update Center driven installation

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

1. We will use a MySQL from WebStack

WebStack home

WebStack 1.5 is integrated Bundled into OpenSolaris 200906 and can be also obtained as UnBundled packgage in Enterprice versin,
but this taint with for you use only license Glassfish WebStack Enterprice.

Because we are creating a DEMO for developers I will use a dev version WebStack 1.6

Web Stack 1.6 Development builds are available for testing

Unfortunately it uses a GUI based installation based on tainted with for you use only license Glassfish WebStack Enterprice version.

So to be able potentially redistribute VM template without need for Legal Audit I will use directly a FOSS based iPKG Update Center Client toolkit
together with this WebStack 1.6 development repository:

http://pkg.sun.com/layered/collection/dev/

2. Install Update Center Client toolkit

Pre-installed Toolkit Images and Starter Repositories

osol@osol-jeos:~/$ cd 
osol@osol-jeos:~/unbundled$ wget http://download.java.net/updatecenter2/promoted/2.3.0RR/pkg-toolkit-2.3.0-sunos-i386.zip
Length: 5,137,048 (4.9M) [application/zip]
osol@osol-jeos:~/unbundled$ unzip pkg-toolkit-2.3.0-sunos-i386.zip
osol@osol-jeos:~/unbundled$ rm pkg-toolkit-2.3.0-sunos-i386.zip
osol@osol-jeos:~/unbundled$ mv pkg-toolkit-sunos-i386 webstack16
osol@osol-jeos:~/unbundled$ cd ./webstack16/
osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg version
1.122.2-38.2493
osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg publisher
PUBLISHER                             TYPE     STATUS   URI
layered.sun.com          (preferred)  origin   online   http://pkg.sun.com/layered/collection/dev/

3. Update iPKG client first

osol@osol-jeos:~/unbundled/webstack16$ pkg set-property flush-content-cache-on-success True
osol@osol-jeos:~/unbundled/webstack16$ pkg image-update
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    5/5       20/20     0.22/0.22

PHASE                                        ACTIONS
Removal Phase                                  54/54
Install Phase                                  10/10
Update Phase                                 239/239
PHASE                                          ITEMS
Reading Existing Index                           8/8
Indexing Packages                                5/5
Deleting content cache

osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg version
1.122.2-43.2581

4. Check MySQL OS needs

System Package dependency (WebStack 1.5)

CLI OS Dependencies

4a. Get decencies as files (Dependencies are for Solaris 10)

osol@osol-jeos:/tmp$ cat webstack.deps
SUNWbash        GNU Bourne-Again shell (bash)
SUNWbzip2     Bzip compression library
SUNWcakr     Core Solaris Kernel Architecture
SUNWcar       Core Architecture (Root)
SUNWckr       Core Solaris Kernel (Root)
SUNWcnetr    Core Solaris Network Infrastructure (Root)
SUNWcry      Crypt Utilities
SUNWcry      Crypt Utilities
SUNWcsd      Core Solaris Devices
SUNWcsl       Core Solaris Libraries
SUNWcslr      Core Solaris Libraries (Root)
SUNWcsr       Core Solaris, (Root)
SUNWcsu      Core Solaris, (Usr)
SUNWgss       GSSAPI V2
SUNWjpg        jpeg - The Independent JPEG Groups JPEG software
SUNWkrbu      Kerberos version 5 support (Usr)
SUNWkvm      Core Architecture (KVM)
SUNWlexpt     XML parser library
SUNWlibC       Sun Workshop Compilers Bundled libC
SUNWlibms     Math & Microtasking Libraries (Usr)
SUNWlibsasl    SASL v2
SUNWlxsl        The XSLT library
SUNWopenssl-libraries OpenSSL Libraries (Usr)
SUNWperl584core  Perl 5.8.4 programming language
SUNWpng       Portable Network Graphics library
SUNWpr        Netscape Portable Runtime
SUNWtls        Network Security Services
SUNWxwrtl       X Window System & Graphics Runtime Library Links
SUNWzlib       The Zip compression library 

GUI OS dependencies

SUNWfontconfig        Fontconfig library
SUNWfreetype2        FreeType2 Font library
SUNWxwplt      X Window System platform software

4b. Check CLI dependencies on OpenSolaris 200906 JeOS prototype

osol@osol-jeos:/tmp$ cat webstack.deps | awk '{print $1}'| xargs -n1 /usr/bin/pkg list -sH
SUNWbash                       GNU Bourne-Again shell (bash)
SUNWcakr                       Core Solaris Kernel Architecture
SUNWcar                        Core Architecture
SUNWckr                        Core Solaris Kernel
SUNWcnetr                      Core Solaris Network Infrastructure
SUNWcsd                        Core Solaris Devices
SUNWcsl                        Core Solaris, (Shared Libs)
SUNWgss                        GSSAPI V2
SUNWkvm                        Core Architecture, (Kvm)
SUNWlexpt                      libexpat - XML parser library
SUNWlibC                       Sun Workshop Compilers Bundled libC
SUNWlibms                      Math & Microtasking Libraries
SUNWlibsasl                    SASL v2
SUNWlxsl                       The XSLT library
SUNWperl584core                Perl 5.8.4 (core)
SUNWpng                        Portable Network Graphics library
SUNWpr                         Netscape Portable Runtime
SUNWtls                        Network Security Services
SUNWxwrtl                      X Window System & Graphics Runtime Library Links in /usr/lib
SUNWzlib                       The Zip compression library
pkg: no packages matching 'SUNWbzip2' installed
pkg: no packages matching 'SUNWcry' installed
pkg: no packages matching 'SUNWcslr' installed
pkg: no packages matching 'SUNWcsr' installed
pkg: no packages matching 'SUNWcsu' installed
pkg: no packages matching 'SUNWjpg' installed
pkg: no packages matching 'SUNWkrbu' installed
pkg: no packages matching 'SUNWopenssl-libraries' installed

4c. Analyze missing packages

pkg: no packages matching 'SUNWbzip2' installed
On OpenSolaris we have SUNWbzip -  Installed

pkg: no packages matching 'SUNWjpg' installed
osol@osol-jeos:/tmp$ pfexec pkg install SUNWjpg

pkg: no packages matching 'SUNWcsr' installed
pkg: no packages matching 'SUNWcsu' installed
On OpenSolaris we have SUNWcs -  Installed

pkg: no packages matching 'SUNWcry' installed
This functionality is now part of OpenSolaris
http://hub.opensolaris.org/bin/view/Project+crypto/sunwcry

pkg: no packages matching 'SUNWcslr' installed
On OpenSolaris we have SUNWcsl -  Installed

pkg: no packages matching 'SUNWkrbu' installed
On OpenSolaris we have SUNWkrb -  Installed

pkg: no packages matching 'SUNWopenssl-libraries' installed
On OpenSolaris we have SUNWopenssl -  Installed

4. Install MySQL DB and Libraries driver in chunks

osol@osol-jeos:/tmp$ cd ~/unbundled/webstack16/

osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg list -as | grep -i mysql
 sun-mysql51                    MySQL Community Database
 sun-mysql51lib                 MySQL 5.1 Client Libraries
 sun-mysql51test                MySQL 5.1 Test
 sun-php52-mysql                PHP MySQL connector

osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg list -a | grep -i mysql
 sun-mysql51                                   5.1.37-1.6      known      ----
 sun-mysql51lib                                5.1.37-1.6      known      ----
 sun-mysql51test                               5.1.37-1.6      known      ----
 sun-php52-mysql                               5.2.11-1.6      known      ----

osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg install  sun-wsbase
  DOWNLOAD                                  PKGS       FILES    XFER (MB)
  Completed                                  1/1     279/279      3.7/3.7

  PHASE                                        ACTIONS
  Install Phase                                396/396
  PHASE                                          ITEMS
  Reading Existing Index                           8/8
  Indexing Packages                                1/1
  Deleting content cache

osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg install  sun-mysql51lib
  DOWNLOAD                                  PKGS       FILES    XFER (MB)
  Completed                                  1/1       14/14      5.3/5.3
 
  PHASE                                        ACTIONS
  Install Phase                                  47/47
  PHASE                                          ITEMS
  Reading Existing Index                           8/8
  Indexing Packages                                1/1
  Deleting content cache

osol@osol-jeos:~/unbundled/webstack16$ ./bin/pkg install  sun-mysql51
  DOWNLOAD                                  PKGS       FILES    XFER (MB)
  Completed                                  1/1     342/342    75.9/75.9

  PHASE                                        ACTIONS
  Install Phase                                402/402
  PHASE                                          ITEMS
  Reading Existing Index                           8/8
  Indexing Packages                                1/1
  Deleting content cache

osol@osol-jeos:~/unbundled/webstack16$ ./bin/setup-webstack

5. Configure MySQL 5.1 database

5a. Install DB first

DB was allready created with mysql_install_db and is owned by install user in our case user osol

osol@osol-jeos:~/unbundled/webstack16$ ls ./var/mysql/5.1/data/
mysql  mysql-bin.000001  mysql-bin.000002  mysql-bin.index  test

osol@osol-jeos:~/unbundled/webstack16$ ls ./var/mysql/5.1/data/
mysql  mysql-bin.000001  mysql-bin.000002  mysql-bin.index  test
osol@osol-jeos:~/unbundled/webstack16$ ls -l ./var/mysql/5.1/data/
total 795
drwx------ 2 osol staff     71 Dec 22 14:48 mysql
-rw-rw---- 1 osol staff  18939 Dec 22 14:48 mysql-bin.000001
-rw-rw---- 1 osol staff 712394 Dec 22 14:48 mysql-bin.000002
-rw-rw---- 1 osol staff     38 Dec 22 14:48 mysql-bin.index
drwx------ 2 osol staff      2 Dec 22 14:48 test

5b. Secure MySQL 5.1 installation

osol@osol-jeos:~/unbundled/webstack16$ ./bin/sun-mysql51 start
Starting mysql51                   OK

osol@osol-jeos:~/unbundled/webstack16$ ./mysql/5.1/bin/mysqladmin -u root password MySQL51

5d. Check then user root can use database and define user 'osol' with password 'justone1'.

PS: Customize - limit rights \*.\* to set you want , see more in MySQL Grant Command

osol@osol-jeos:~/unbundled/webstack16$ ./bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \\g.
Server version: 5.1.37 Source distribution

mysql> drop database test;

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------+
2 rows in set (0.00 sec)

mysql> grant all privileges on \*.\* to osol@"%"  identified by 'justone1';
Query OK, 0 rows affected (0.00 sec)

mysql> quit

5e. Stop MySQL instance

osol@osol-jeos:~/unbundled/webstack16$ ./bin/sun-mysql51 stop
Stopping mysql51                   OK

See more in:

Sun GlassFish Web Stack 1.5 Installation and Configuration Guide

Web Stack Getting Started Guide

WEbStack Forums

WebStack Mailing list

6. Check used space after MySQL 5.1 installation

6a. Check ZFS used space after MySQL 5.1 installation

osol@osol-jeos:~/unbundled/webstack16$ zfs list
NAME                               USED  AVAIL  REFER  MOUNTPOINT
rpool                             2.18G  5.64G  83.5K  /rpool
rpool/ROOT                         855M  5.64G    19K  legacy
rpool/ROOT/opensolaris             855M  5.64G   855M  /
rpool/dump                         384M  5.64G   384M  -
rpool/export                       477M  5.64G    20K  /export
rpool/export/home                  477M  5.64G    21K  /export/home
rpool/export/home/osol             477M  5.64G  51.5K  /export/home/osol
rpool/export/home/osol/unbundled   477M  5.64G   477M  /export/home/osol/unbundled
rpool/swap                         512M  6.14G    20K  -

osol@osol-jeos:~/unbundled/webstack16$ df -h
Filesystem                                                Size  Used Avail Use% Mounted on
rpool                                                        5.7G   84K  5.7G   1% /rpool
rpool/ROOT/opensolaris                            6.5G  855M  5.7G  13% /
rpool/export                                              5.7G   20K  5.7G   1% /export
rpool/export/home                                     5.7G   21K  5.7G   1% /export/home
rpool/export/home/osol
                                                                5.7G   52K  5.7G   1% /export/home/osol
rpool/export/home/osol/unbundled              6.2G  477M  5.7G   8% /export/home/osol/unbundled

6b. Check Virtual Disk and Archive sizes after MySQL 5.1 installation

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

Virtual Disk size grow to 1587MB and with 7Z ultra compression size is now 464MB

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