Virtual Guru's Blog – Home of Virtualization Workshops

February 1, 2010

Part 2: Glassfish V3 Pet Catalog sample DEMO in VM Template – OS Instance

Filed under: glassfish, jeos, opensolaris — natiku @ 4:47 pm

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 1: Create OS Instance
   General Information – JeOS Prototype OpenSolaris project
   Step 1a: Create an OpenSolaris 20906 JeOS Prototype instance
   Step 1b: Start JeOS VM instance and check readiness as user root
   Step 1c: Create a non-root but fully privileged user

(more…)

January 15, 2010

Downloads: Glassfish V3 Pet Catalog sample DEMO in VM Template

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 9:32 am

My colleagues will handle publishing downloads on public place for you, for now you can get images internaly at:
http://jsc-nfs.czech.sun.com/room/virtual/OSOL0906/vmtemplate-sample/GFv3sample/VMTemplates

For information about “What Virtualizations platforms are supported be images?” or
“How to start image in Virtualization platform ?” look into JeOS prototype download page

Part 12: Glassfish V3 Pet Catalog sample DEMO in VM Template – Clean and Convert

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 9:24 am

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 6: Clean and Convert VM
   Step 6c: Generate VirtualBOX 3.x VDI IDE format
      Convert VMDK SCSI to VDI IDE format with VirtualBox
      Configure VirtualBox for VDI IDE
      Reconfigure HW with VA Live-CD in VirtualBox?for VDI IDE
   Step 6d: Generate Parallels format
      Open in Parallels JeOS image and recreate OS disk
      Restore from ZFS stream from VA Live-CD
      Add Freeware NI network driver
   Step 6e: Generate xVM/XEN compatible PARA and HVM RAW disk formats

(more…)

Part 11: Glassfish V3 Pet Catalog sample DEMO in VM Template – Pack and Publish

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 4:09 am

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 7: Pack and Publish Images
      Step 7a: Pack each Image with compression tool
      Step 7b: Generate a checksum for each archive
      Step 7d: Create a Download page with helper instructions

(more…)

January 14, 2010

Part 10: Glassfish V3 Pet Catalog sample DEMO in VM Template – Clean and Convert

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 8:07 am

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 6: Clean and Convert VM
      Step 6a: Clean & Pack VMware – our primary development platform
      Step 6b: Generate VirtualBOX 3.x OVF format

(more…)

Part 9: Glassfish V3 Pet Catalog sample DEMO in VM Template – Finalize

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 6:56 am

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 5: Finalize the template
      Step 5a: Finalize template outline

(more…)

Part 8: Glassfish V3 Pet Catalog sample DEMO in VM Template – Cleaning

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 6:27 am

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 4: Clean-up the template
      Step 4a: Motivations for Clean-up
      Step 4b: Clear layered app SW
      Step 4c: Clean OS and default user OSOL data
      Step 4d: Important: Time to make a backup now
      Step 4e: Shrink installed system disk with ZFS Streaming
            First I will optimize disk with local ZFS SEND/RECEIVE streaming
            Second I will optimize disk with NFS based ZFS SEND/RECEIVE streaming

(more…)

January 13, 2010

Part 7: Glassfish V3 Pet Catalog sample DEMO in VM Template – Adding internals

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 8:03 am

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 3: Add Template internals
   Step 3a: Add auto starting of layered components
   Step 3b: Adding welcome WEB page
   Step 3c: Licenses audit
  Final Used Space After all SW installation

(more…)

December 23, 2009

Part 6: Glassfish V3 Pet Catalog sample DEMO in VM Template – SW Installation

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 7:43 am

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 2g: Install Java EE 6 Pet Catalog sample from NetBeans 6.8 IDE (Video)

(more…)

December 22, 2009

Part 5: Glassfish V3 Pet Catalog sample DEMO in VM Template – SW Installation

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 6:47 am

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)

(more…)

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

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 2:58 am

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.

(more…)

December 21, 2009

Part 3: Glassfish V3 Pet Catalog sample DEMO in VM Template – SW Installation

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 6:34 am

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 2a: Bundled vs UnBundled SW installation
   Step 2b: Using UnBundled SW Installation for our DEMO
   Step 2c: OpenSolaris is dual arch (32bit and 64bit) environment
   Step 2d: Creating a dedicated ZFS fs for UnBundled installation

(more…)

December 17, 2009

Part 1: Quad-Core Workstations for Desktop Virtualization Projects – Configuration

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 2:42 am

For our virtualization projects like JeOS Prototype / Virtual Appliances / VM Templates we need to have Desktop hardware with latest Hardware Accelerated Virtualization support, currently this mean AMD = AMD-V and Intel = VT-x platforms.

Today is avaiable next (SECOND) generation of Hardware Accelerated Virtualization support focused onto improve memory performance AMD = RVI (Rapid Virtualization Technology) with Phenom CPU platform and Intel EPT (Extended Page Table) with Core i7 CPU platform.

This entry is part of HW for Virtualization Workshop

This hardware was used to create OpenSolaris 200906 JeOS Prototype VM images in 10+ Virtualization formats – Download

Main Motivations
   Todays Virtualization Technologies Sprawl
   Project HW Requirements
   Budget Constrains = Virtualization Workstation for $1000 each

(more…)

Virutalization reality 2010 – It will be a multi-hypervisor world !!!

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 1:38 am

I found one interesting comment in this blog:

Four Virtualization Realities of 2010

Reality #2: It will be a multi-hypervisor world.

Will VMware be the main Data Center Operating System? Not with Microsoft, Citrix, Oracle, RedHat and IBM having a say. There’s Hyper-V, IBM’s AIX/LPARs, Citrix XenServer, RedHat’s KVM, and with Oracle’s ultimate solution TBD, there will be lots of potential options.

Microsoft will be successful working from the bottom up. Their product is improving and they have a solid value proposition in Windows-centric enterprises. It will be tough for VMware to compete with free. Hyper-V’s penetration will continue its growth in 2010.

Oracle and Sun may have the best end-to-end (Application to Storage) stack from any single vendor. How they will manage it all remains unclear, but I believe it’s an opportunity for them. They would need end-to-end management from the end-user to the bits on the disk, but I believe Oracle will be a significant player in the virtualization space starting in 2010.

VMware clearly is the incumbent, but it will not be the only player. 2010 will be an interesting year, as other data center hypervisor solutions become more viable.

December 16, 2009

Part 1: Glassfish V3 Pet Catalog sample DEMO in VM Template – Preparation

Filed under: glassfish, jeos, mysql, opensolaris, virtualbox, Virtualization, vmware — natiku @ 7:14 am

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.

Preparation: Create basic Glassfish V3 VM Template outline
   1. Learn more about VM Templates creation process
   2. Plan carefully VM Template content and audience
   3. Check if all panned to use products are FOSS based

(more…)

April 15, 2009

Glassfish 2.1 App Server and MySQL 5.1 AMI Pre and Post configurations

Filed under: amazon_aws, cloud, glassfish, opensolaris, Virtualization — natiku @ 1:42 am

This entry is part of ‘OpenSolaris on Amazon EC2′ workshop

(more…)

Glassfish 2.1 App Server and MySQL 5.1 AMI on OpenSolaris 2008.11

Filed under: amazon_aws, cloud, glassfish, opensolaris, Virtualization — natiku @ 1:15 am

We will create a MySQL 5.1 and Glassfish 2.1 developer profile bundle, we will run both applications as non-root user for higher security.
This time I will like to use as much as possible (re)configuration from Glassfish CLI management instead of direct editing Glassfish XML configuration files.

This entry is part of ‘OpenSolaris on Amazon EC2′ workshop


GlassFish/SJS AS in production – which bundle, which profile, …?

Specifics of OpenSolaris setup on Amazon EC2

Amazon AWS is designed for OS configurations, where instance admin login into instance as ROOT with SSH key, ROOT user don’t have password (is locked), so we can’t ‘sudo’ to it. This is imposing some limitations in non-root SW install when some tasks need to be done directly as root user due to known limitations of pfexec command.

Glassfish 2.1 AMI Targets on Amazon EC2

From past Glassfish on Solaris Amazon EC2 user feedback, most users are skilled developers who want to use AMI instances to porting their JAVA apps to Glassfish and/or EC2 Solaris platform. So in this Glassfish 2.1 AMI image we will focus on reasonable secure developer oriented installation in Cloud environment.

AMI creation side
  • Create Glassfish 21 user
  • Install Glassfish 2.1 as non-root user
  • Create basic SMF Glassfish integration
  • Add Glassfish tools to Glassfish user path
  • Allow Glassfish user to control Glassfish SMF service
  • Secure admin to use SSL and bind to ‘localhost’ only
  • Tune Glassfish 2.1 memory usage
  • Clean install data and logs
AMI deployment side
  • User will change Glassfish admin password
  • User will generate new SSL key
  • Optionaly: User will open admin domain to all public IPs, so it can be accessed by WEB
  • User will restart Glassfish 2.1 to load new installation

Create MySQL 5.1 AMI-752CCB1C instance and install there GF 2.1

Use pre-created AMI with MySQL 5.1 AMI-752CCB1C

Check snapshots

zfs list -t snapshot
NAME                             USED  AVAIL  REFER  MOUNTPOINT
rpool/ROOT/opensolaris@install   140M      -  2.65G  -
zfs list
NAME                     USED  AVAIL  REFER  MOUNTPOINT
rpool                   4.07G  5.53G    72K  /rpool
rpool/ROOT              3.21G  5.53G    18K  legacy
rpool/ROOT/opensolaris  3.21G  5.53G  3.07G  /
rpool/dump               293M  5.53G   293M  -
rpool/export              56K  5.53G    19K  /export
rpool/export/home         37K  5.53G    37K  /export/home
rpool/swap               586M  6.10G    16K  -
root@jsc-xen-14:~# zfs list -t snapshot
NAME                             USED  AVAIL  REFER  MOUNTPOINT
rpool/ROOT/opensolaris@install   140M      -  2.65G  -
zfs destroy rpool/ROOT/opensolaris@install
zfs list
NAME                     USED  AVAIL  REFER  MOUNTPOINT
rpool                   3.93G  5.66G    72K  /rpool
rpool/ROOT              3.07G  5.66G    18K  legacy
rpool/ROOT/opensolaris  3.07G  5.66G  3.07G  /
rpool/dump               293M  5.66G   293M  -
rpool/export              56K  5.66G    19K  /export
rpool/export/home         37K  5.66G    37K  /export/home
rpool/swap               586M  6.24G    16K  -

Check PKG IPS setup

1. Check if image is cleaned

du -s -h /var/pkg/download/
34M     /var/pkg/download/
du -s -h /var/pkg/index/
36M     /var/pkg/index/

2. Check if PKG IPS is set up to auto clean cache

No, set it

pkg property -H flush-content-cache-on-success
flush-content-cache-on-success False
pkg set-property flush-content-cache-on-success True

Install JDK6 from OpenSolaris release repo

pkg install SUNWj6dev

Install ANT from OpenSolaris release repo

pkg install SUNWant

Install MySQL 5.1 and J Connector

1. We will use AMI with MySQL 5.1, until this version will be in official OpenSolaris REPO

Use pre-created AMI with MySQL 5.1 AMI-752ccb1c

2. Install Mysql Connector/J 5.1

Note: We will use version 5.1 from official OpenSolaris REPO

pkg install SUNWmysql5jdbc

Glasshish 2.1 Install from JAR distribution as non-root user

GlassFish Project – v2.1 FinalBuild

The Open Sourcing Clustering features are included in this promotion.

Create non-root runtime user (account locked by default)

groupadd gf21
useradd -d /export/home/gf21 -m -s /usr/bin/bash -g gf21 gf21

Note: User will don’t have enough privileges to start/stop GF service, I consider to add to it profile , see separate section for it

1. Install glassfish 2.1

mkdir /opt/gf21; chown gf21:gf21 /opt/gf21
su - gf21
cd /opt/gf21
wget  http://java.net/download/javaee5/v2.1_branch/promoted/SunOS_X86/glassfish-installer-v2.1-b60e-sunos_x86.jar
java -Xmx256m -jar glassfish-installer-v2.1-b60e-sunos_x86.jar
Accept license with "A"
Installation will by unpacked in ./glassfish

2. Configure glassfish 2.1 (Create domain1)

cd /opt/gf21/glassfish
chmod -R +x lib/ant/bin
lib/ant/bin/ant -f setup.xml
create.domain:
[exec] Using port 4848 for Admin.
[exec] Using port 8080 for HTTP Instance.
[exec] Using port 7676 for JMS.
[exec] Using port 3700 for IIOP.
[exec] Using port 8181 for HTTP_SSL.
[exec] Using default port 3820 for IIOP_SSL.
[exec] Using default port 3920 for IIOP_MUTUALAUTH.
[exec] Using default port 8686 for JMX_ADMIN.
[exec] Domain being created with profile:developer, as specified by variable AS_ADMIN_PROFILE in configuration file.
[exec] ------ Using Profile [developer] to create the domain ------
....
[exec] Security Store uses: JKS
[exec] Domain domain1 created.
[exec] Login information relevant to admin user name [admin] for this domain [domain1] stored at
[/export/home/gf21/.asadminpass] successfully.

3. Backup original domain1 configuration

cp /opt/gf21/glassfish/domains/domain1/config/domain.xml /opt/gf21/glassfish/domains/domain1/config/domain.xml.org

4. Put glassfish tools into path

echo export PATH=$PATH:/opt/gf21/glassfish/bin >>~/.profile
exit
su - gf21

5) Create minimal Glassfish SMF script for automatic start / stop

How to Create a Service Management Facility (SMF) Manifest

cat >/opt/gf21/smf-glassfish.xml <<EOF
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='glassfish:domain1'>
<service name='application/glassfish/domain1' type='service' version='1'>
<create_default_instance enabled='true' />
<single_instance />
<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
<dependency name='network-service' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/network/service' />
</dependency>
<method_context>
<method_credential user='gf21'  group='gf21' />
</method_context>
<exec_method type='method' name='start' exec='/opt/gf21/glassfish/bin/asadmin start-domain domain1' timeout_seconds='600' />
<exec_method type='method' name='stop' exec='/opt/gf21/glassfish/bin/asadmin stop-domain domain1' timeout_seconds='600' />
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='transient' />
</property_group>
<stability value='Unstable' />
<template>
<common_name>
<loctext xml:lang='C'>Glassfish V2.1 Simple non-root user SMF</loctext>
</common_name>
</template>
</service>
</service_bundle>
EOF

6. Load SMF this XML definition and start service

Execute as root, pfexec as gf21 fail on these ?
exit
whoami
root
/usr/sbin/svccfg validate /opt/gf21/smf-glassfish.xml
/usr/sbin/svccfg import /opt/gf21/smf-glassfish.xml
/usr/sbin/svcadm enable svc:/application/glassfish/domain1:default
svcs /application/glassfish/domain1
STATE          STIME    FMRI
online*        12:50:01 svc:/application/glassfish/domain1:default
Wait after is service is online
svcs /application/glassfish/domain1
online         12:05:29 svc:/application/glassfish/domain1:default

7. Add line to create authorization into auth_attr

Good Article: Less known Solaris features: RBAC and Privileges
Part 1: Introduction
Part 2: Role based access control
Part 3: Privileges

as root
echo "solaris.smf.manage.glassfish/domain1:::Glassfish Domain1 Server management::" >> /etc/security/auth_attr

8. Add service authorization to user gf21

usermod -A solaris.smf.manage.glassfish/domain1 gf21

9. Add authorization to restart and manage service

svccfg -s glassfish/domain1 setprop general/action_authorization=astring: 'solaris.smf.manage.glassfish/domain1'
svccfg -s glassfish/domain1 setprop general/value_authorization=astring: 'solaris.smf.manage.glassfish/domain1'
svcadm refresf glassfish/domain1

10. Secure default instance domain1 admin interface by using SSL and localhost

su - gf21
asadmin get  server.http-service.http-listener.admin-listener.address
server.http-service.http-listener.admin-listener.address = 0.0.0.0
asadmin set server.http-service.http-listener.admin-listener.address=127.0.0.1
asadmin  get server.http-service.http-listener.admin-listener.security-enabled
server.http-service.http-listener.admin-listener.security-enabled = false
asadmin  set server.http-service.http-listener.admin-listener.security-enabled=true

11. Optional: Tuning Glassfish configuration for Amazon EC2 c1.small

Tune JVM HEAP memory in /opt/glassfish/domains/domain1/config/domain.xml,
Amazon AWS m1.small which have 1700MB RAM, so for Solaris for JeOS we can put there 1024MB
(But we need to keep in mind also memory needs of MySQL and ZFS ARCH chache ?)

Chane Java Heap memory from 512M to 1024M

asadmin  create-jvm-options --  "-Xmx1024m"
cat /opt/gf21/glassfish/domains/domain1/config/domain.xml | grep Xmx
<jvm-options>-Xmx512m</jvm-options>
<jvm-options>-Xmx1024m</jvm-options>
asadmin delete-jvm-options -- -Xmx512m
cat /opt/gf21/glassfish/domains/domain1/config/domain.xml | grep Xmx
<jvm-options>-Xmx1024m</jvm-options>

Note: c1.small have only one CPU, do we need optimize threads , need to be investigated together with MySQL setup needs

12. Restart glassfish SMF service

Execute as root, pfexec as gf21 fail on these ? Most work NOW !
exit
whoami
root
/usr/sbin/svcadm disable -t svc:/application/glassfish/domain1:default
/usr/sbin/svcadm enable svc:/application/glassfish/domain1:default
svcs /application/glassfish/domain1
STATE          STIME    FMRI
online*        12:50:01 svc:/application/glassfish/domain1:default
svcs /application/glassfish/domain1
online         12:05:29 svc:/application/glassfish/domain1:default

13. Check running GF2.2 running instance under gf21:gf21 (Still under root)

ps -ef |grep gf21
gf21 16270     1   0 08:20:29 ?           0:42 /usr/jdk/instances/jdk1.6.0/jre/../bin/java -Dcom.sun.aas.instanceRoot=/opt/gf2
svcs glassfish/domain1
STATE          STIME    FMRI
online          8:21:12 svc:/application/glassfish/domain1:default
svcs -l glassfish/domain1 | grep logfile
lofile /var/svc/log/application-glassfish-domain1:default.log
tail  /var/svc/log/application-glassfish-domain1:default.log
Domain listens on at least following ports for connections:
[8080 8181 4848 3700 3820 3920 8686 ].
Domain does not support application server clusters and other standalone instances.
netstat -an | egrep "8080|8181|4848|3700|3820|3920|8686"
*.3700               *.*                0      0 49152      0 LISTEN
*.3820               *.*                0      0 49152      0 LISTEN
*.3920               *.*                0      0 49152      0 LISTEN
*.8686               *.*                0      0 49152      0 LISTEN
*.8080               *.*                0      0 49152      0 LISTEN
*.8181               *.*                0      0 49152      0 LISTEN
127.0.0.1.4848         *.*                0      0 49152      0 LISTEN
*.3700               *.*                0      0 49152      0 LISTEN
*.3820               *.*                0      0 49152      0 LISTEN
*.3920               *.*                0      0 49152      0 LISTEN
*.8686               *.*                0      0 49152      0 LISTEN
*.8080               *.*                0      0 49152      0 LISTEN
*.8181               *.*                0      0 49152      0 LISTEN

September 11, 2008

AMI simple deployment: OpenSolaris 2008.05-91 Glassfish and MySQL AMI image

Filed under: amazon_aws, cloud, glassfish, opensolaris, Virtualization — natiku @ 5:51 am

This entry is part of ‘OpenSolaris on Amazon EC2′ workshop

ami-3cf81c55 aki-b78367de ari-b68367df sun-osol/opensol2008.05-b91-GF-MySQL.img

Amazon EC2 OpenSolaris 200805-91 AMI Image with Glassfish V2 and MySQL 5.1 based on ami-89ef0be0 MySQL 5.1.x AMI image , origin is OpenSolaris 2008.05-91 ami-41e70328 image.

MySQL use for data /export/home/data2, I will use it for Glassfish installation too, so I can build a persistent storage solution (EBS) using this Glassfish and MySQL image.

Prepare Java 6 Environment

By default only Java 6 JRE is installed on OpenSolaris 200805-91, but we need JDK, we also need MySQL JDBC drivers.

1. Update package system

pkg refresh
pkg install -nv SUNWipkg@0.5.11-0.91
Before evaluation:
UNEVALUATED:
+pkg:/SUNWipkg@0.5.11,5.11-0.91:20080807T173946Z
After evaluation:
pkg:/SUNWipkg@0.5.11,5.11-0.91:20080620T101740Z -> pkg:/SUNWipkg@0.5.11,5.11-0.91:20080807T173946Z
None
pkg install  SUNWipkg@0.5.11-0.91
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1     154/154     1.40/1.40
PHASE                                        ACTIONS
Removal Phase                                    1/1
Update Phase                                 136/136
Install Phase                                  22/22
  1. Install Java 6 JDK
pkg install SUNWj6dev
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1       56/56   48.18/48.18
PHASE                                        ACTIONS
Install Phase                                  86/86
pkg list SUNWj6dev
NAME (AUTHORITY)                              VERSION         STATE      UFIX
SUNWj6dev                                     0.5.11-0.91     installed  u---

3. Install MySQL 5 jdbc driver

pkg install SUNWmysql5jdbc
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1       12/12     1.29/1.29
PHASE                                        ACTIONS
Install Phase                                  22/22
pkg list SUNWmysql5jdbc
NAME (AUTHORITY)                              VERSION         STATE      UFIX
SUNWmysql5jdbc                                5.1.5-0.95      installed  ----
pkg contents SUNWmysql5jdbc | grep jar
usr/mysql/connectors/jdbc/5.1/mysql-connector-java-5.1.5-bin.jar

Install Glassfish V2 U2

cd /export/home/data/2

  1. Select Glassfish distribution (I select simple devel one)
https://glassfish.dev.java.net/downloads/v2ur2-b04.html
  1. Get Glassfish install JAR
wget http://www.java.net/download/javaee5/v2ur2/promoted/SunOS_X86/glassfish-installer-v2ur2-b04-sunos_x86-ml.jar
  1. Install Glassfish into /export/home/data2
java -Xmx256m -jar  glassfish-installer-v2ur2-b04-sunos_x86-ml.jar
create.domain:
[exec] Using port 4848 for Admin.
[exec] Using port 8080 for HTTP Instance.
[exec] Using port 7676 for JMS.
[exec] Using port 3700 for IIOP.
[exec] Using port 8181 for HTTP_SSL.
[exec] Using default port 3820 for IIOP_SSL.
[exec] Using default port 3920 for IIOP_MUTUALAUTH.
[exec] Using default port 8686 for JMX_ADMIN.
[exec] Domain being created with profile:developer, as specified by variable AS_ADMIN_PROFILE
in configuration file.
[exec] Security Store uses: JKS
[exec] Domain domain1 created.
[exec] Admin login information for host [localhost] and port [4848] is being overwritten with
credentials provided. This is because the --savelogin option was used during
create-domain command.
[exec] Login information relevant to admin user name [admin] for this domain [domain1] stored
at [/root/.asadminpass] successfully.
[exec] Make sure that this file remains protected. Information stored in this file will be used
by asadmin commands to manage this domain.
[delete] Deleting: /export/home/data2/glassfish/passfile
  1. Check installed Galssfish V2 U2
cd /export/home/data2/glassfish
./bin/asadmin start-domain domain1
Starting Domain domain1, please wait.
Log redirected to /export/home/data2/glassfish/domains/domain1/logs/server.log.
Redirecting output to /export/home/data2/glassfish/domains/domain1/logs/server.log
Domain domain1 is ready to receive client requests. Additional services are being started in background.
Domain [domain1] is running [Sun Java System Application Server 9.1_02 (build b04-fcs)] with
its configuration and logs at: [/export/home/data2/glassfish/domains].
Admin Console is available at [https://localhost:4848].
Use the same port [4848] for "asadmin" commands.
User web applications are available at these URLs:
[http://localhost:8080 https://localhost:8181 ].
Following web-contexts are available:
[/web1  /__wstx-services ].
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
[service:jmx:rmi:///jndi/rmi://domU-12-31-39-00-88-61.compute-1.internal:8686/jmxrmi] for domain management purposes.
Domain listens on at least following ports for connections:
[8080 8181 4848 3700 3820 3920 8686 ].
Domain does not support application server clusters and other standalone instances.

5. Check login to Glassfish administration

http://amazon_public_honstname:4848/
User: admin
Password:adminadmin

May 22, 2008

Pre-build OpenSolaris 2008.05 JeOS RNJS AMI images

Filed under: amazon_aws, cloud, glassfish, opensolaris, Virtualization — natiku @ 5:42 am

For creating of pre-build PUBLIC OpenSolairs AMIs I select Glassfish MySQL and WebStack AMP bundles, they are very easy to deploy and configure so they are ideal for Virtual Appliances as PoC (Proof-of-Concept) software.

This entry is part of ‘OpenSolaris on Amazon EC2′ workshop

AMI Net Install Image: os200805 JeOS + Glassfish & MySQL or AMP stack

ami-0d50b564 aki-7846a311 ari-7d46a314 sun-osol/2008.05_JeOS_32_1.0.img.manifest.xml

In fact this an another example how composite image can be created, this time I will use IPS net based install from default OpenSolaris repository.

Advanced ec2ify: ssh_indent_key + data disks formated with ZFS and mounted /mnt, user-data, updater, syncer

<p
See install steps bellow:
Get & Inst: Net based install of IPS packages into OpenSolaris 2008.05

Get & Inst: Net based install of IPS packages into OpenSolaris 2008.05

Filed under: amazon_aws, cloud, glassfish, ips, opensolaris, Virtualization — natiku @ 5:28 am

In fact this an another example how composite image can be created, this time I will use IPS net based install from default OpenSolaris repository.

This entry is part of ‘OpenSolaris on Amazon EC2′ workshop

New IPS packaging system

(more…)

May 16, 2008

Download & Run: WebSynergy – Demonstrating AMI update from ZIP on S3

Filed under: amazon_aws, cloud, glassfish, opensolaris, Virtualization — natiku @ 2:06 pm

In this type of AMI image use, I will send a control data in form of ZIP file to AMI on instance start which will download from S3 prepackaged and zipped application stack, this way we don’t need to rebuild AMI and we can update it on boot time.

This entry is part of ‘OpenSolaris on Amazon EC2′ Workshop
(more…)

Inst&Conf: SGMJ (Solaris Glassfish MySQL Java) Stack

Filed under: amazon_aws, cloud, glassfish, Virtualization — natiku @ 4:15 am

For now it is just JIT (Just Install software) Virtual Appliance, developers will post-configure it using DOCs

This entry is part of ‘OpenSolaris on Amazon EC2′ Workshop
(more…)

May 15, 2008

Inst&Conf: Liferay 5.0 on Glassfish bundle DEMO

Filed under: amazon_aws, cloud, glassfish, opensolaris, Virtualization — natiku @ 9:05 am

Installation of Liferay Glassfish bundle DEMO is easy and is identical to install of empty Glassfish.

This entry is part of ‘OpenSolaris on Amazon EC2′ Workshop
(more…)

May 12, 2008

Pre-build SXDE79 JeOS RNJS AMI images

Filed under: amazon_aws, cloud, glassfish, jeos, opensolaris, Virtualization — natiku @ 7:59 am

For creating of PUBLIC AMIs I select Glassfish bundles, they don’t have absolutely latest version of Glassfish, but they are very easy to deploy and configure so they are ideal for Virtual Appliances as PoC (Proof-of-Concept) software.

This entry is part of ‘OpenSolaris on Amazon EC2′ Workshop

(more…)

May 5, 2008

‘OpenSolaris on Amazon EC2′ Workshop

Filed under: amazon_aws, cloud, glassfish, jeos, opensolaris, Virtualization — natiku @ 10:30 am

As part of Alliances with Global Partners program SUN announce OpenSolaris on Amazon EC2 Beta private program and SUN also announce http://www.mysql.com/news-and-events/press-release/release_2008_16.html”;> MySQL support for Amazon EC2 users

See also: Getting started with OpenSolaris on Amazon EC2 and Official EC2 blog


Bellow I try to summarize my Solaris on Amazon AWS (EC2 , S3) field experience reusing my Linux, Solaris , xVM / XEN theme related knowledge:

  • Encourage experimenting: Try & See in Amazon AWS (EC2, S3) enviroment
  • Theme: Shocking Blue Green. Blog at WordPress.com.

    Follow

    Get every new post delivered to your Inbox.