Thursday Feb 12, 2009

OpenSolaris Zones Clusters VideoBlog

Here's a very interesting video talking about virtual clustering using Solaris Zones by Ellard Roush.

Enjoy It!

For more information on how to set up zones and Glassfish refer to:

http://blogs.sun.com/arbore/entry/glassfish_zone_zfs_isolation_over

[Read More]

Wednesday Feb 04, 2009

Glassfish over a Zone over OpenSolaris

Hi all!

Today I'll try to show you guys how to create a zone in OpenSolaris and install a glassfish application server on the top of it.

First of all, you need a native installation of Solaris10/OpenSololaris or a virtual machine with one of these installed. Here you can find how to set up a vm with OpenSolaris.

You can refer to the Zones Administration Guide too.

To see the zones on the system:

# zoneadm list -vi
ID  NAME     STATUS    PATH   BRAND    IP
0   global   running   /      native   shared

Let's configure one more called glasszone for us:

zonecfg -z glasszone
glasszone: No such zone configuredUse 'create' to begin configuring a new zone.
zonecfg:glasszone> create
zonecfg:glasszone> set zonepath=/export/home/glasszone
zonecfg:glasszone> set autoboot=true

Zonepath is the place that solaris will create the filesystem for the new zone. If you don't want your zone to start running automatically at the boot time, you can set autoboot=false or just leave it.

Now, let's add a virtual network interface, commit the zone, install it on the system, boot and login( -C option is used in the first time you start the zone to configure the hostname, dns server, root password and some other stuff).

zonecfg:glasszone> add net
zonecfg:glasszone:net> set address=10.0.2.20/24
zonecfg:glasszone:net> set physical=e1000g0
zonecfg:glasszone:net> set defrouter=10.0.2.2
zonecfg:glasszone:net> end
zonecfg:glasszone> commit
zonecfg:glasszone> exit
# zoneadm -z glasszone install
# zoneadm -z glasszone boot
# zlogin -C glasszone

The address is the ip of your subnet that the zone will use, and 24 is the number of 1's of the bitmask of the subnet mask that you have. More info on this here.

Remember that the interface will be shared, and the glasszone will be visible to the outsiders. This means that the glasszone and the globalzone will need different ip addresses of the net, and your interface will act like a router.

INFO: Zones doesn't support dhcp yet.

In my case, I'm using VirtualBox to virtualize the OpenSolaris system. It created a subnet for the system with the default router 10.0.2.2 and the default dns server 10.0.2.3 .

Physical is the interface that glasszone will share (must be a configured, plumbed, working interface).

You can see the interfaces information through the ifconfig command in the globalzone.

# ifconfig -a
[...]
e1000g0: flags=201004843 mtu 1500 index 2 inet 10.0.2.15 netmask ffffff00 broadcast 10.0.2.255 ether 8:0:27:31:8b:21
e1000g0:1: flags=201000843 mtu 1500 index 2 zone glasszone inet 10.0.2.20 netmask ffffff00 broadcast 10.0.2.255
[...]

Now the zone should be up and running:

# zoneadm list -vi
   ID    NAME    STATUS       PATH                BRAND    IP
   0    global    running       /                native    shared
   1    global    running       /export/home/glasszone    ipkg    shared

Login to it. We're going to install the glassfish app. Since a zone is an instance of the OpenSolaris operational system, if the fs is not mounted anywhere, the only way to communicate with it is though the network interface (remember that it is a virtual interface, so if you are communicating between zones, minimum delay is expected).

Basically you need two things: The jdk and the glassfish app.

My tip: Download both at once:
http://java.sun.com/javaee/downloads/index.jsp

Of course you can install it separately, but you will have to set some environment variables such as JAVA_HOME and the PATH. It isn't so hard, but it isn't so fast too, so I'll keep my advise.

You can download it logged to globalzone and then move it to the glasszone space. You can use wget to download it directly into your zone too.

TIP: Use -console option to install, because you have just a console in the zone.

You may have to set the execution permission for the downloaded file.

chmod +xxx runnable.bin

Now that you have installed it, you should be able to start a sample domain:

# asadmin start-domain domain1

Once it started, you should be able to see it on the hole subnet by typing in your browser:

http://10.0.2.20:8080
or
http://glasszone:8080

TIP: Probably you will have add the glasszone entry in the /etc/hosts in the globalzone.

#echo “10.0.2.20 glasszone” >> /etc/hosts
#cat /etc/hosts
[…]
127.0.0.1 localhost
10.0.2.20 glasszone

Now you have a "ready to use" web application server enviroment inside a zone inside the OpenSolaris OS.

HAVE FUN!

Please post a comment or send me a email if you have any doubts, suggestions or if you find something here that isn't that right. We're a community and your help is very welcome a encouraged. =)

References and related links:

http://blogs.sun.com/observatory/entry/screencast_installing_opensolaris_in_virtualbox

http://opensolaris.org/os/community/zones/

http://www.sun.com/bigadmin/content/zones/opensolaris_zones_preso.pdf

http://number9.hellooperator.net/articles/2007/03/29/glassfish-in-a-zone

http://docs.sun.com/app/docs/doc/817-1592
⁞[Read More]

Saturday Dec 13, 2008

OpenSolaris 2008.11

"OpenSolaris is the state of the art, cutting edge operating system that provides a rich, coherent platform for building and running applications.

OpenSolaris offers free, built-in features that help you build, debug and deploy new applications faster. It's is an operating system (OS), an open source project licensed under CDDL, and a community.

The project's goals are innovation, collaboration, and the extension of OpenSolaris technology." (www.opensolaris.com)

They just released the 2008.11 version, with some new cool tools like TimeSlider and much more hardware compatibility.

You can download it here: http://www.opensolaris.com/get/index.js

You can see a walk-through the installation here: http://blogs.sun.com/amitsaha/entry/open_solaris_2008_11_on

You can see videos and talks about the release and the new stuff here: http://www.opensolaris.com/learn/

You can get in touch with the community here: http://www.opensolaris.org

You can see the hardware compatibility list here: http://www.sun.com/bigadmin/hcl/

Download it! Try it! Enjoy it!

About

Hi, my name is Marcelo Arbore, I study electrical engineering at University of Sao Paulo, Brazil, and I work for Sun Microsystems. I also like to surf, I love the sea and I will live in California some day. marcelo.arbore@sun.com

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