Dynamically Adding Virtual Servers in GlassFish
GlassFish (and SJSAS 9.0) supports a nice feature where you can add virtual-server (host) and http-listener on the fly, without having to reboot the server. You can do it using the admin GUI or the admin CLI. The admin CLI has a nice way to interact with GlassFish, so I will use it first.
Let's add a new virtual-server (make sure GlassFish is running):
% asadmin create-virtual-server -u admin --hosts localhost myHost
% asadmin create-virtual-server -u admin --hosts localhost myHostThat's it. Now let's add a new http-listener so we can do some http transactions:
% asadmin create-http-listener -u admin --listeneraddress 0.0.0.0--listenerport 8888 --defaultvs myHost --servername localhost.localdomain --acceptorthreads 1 myHttpListener
Now you can access the newly created virtual-server and http-listener by just doing:
http://localhost:8888/
For peoples that doesn't like kilometers of typing but like clicks, you can do the same using the admin gui
First, logs in and click on the left tree until you get.

Enter the required info and press save

You should see your newly created virtual-server.

Now, for the http-listener, browse the left tree until you get the http-listener screen and click add

Enter the required info and press save

You should see your newly created http-listener:

Then with your browser, just add the new address:

C'est tout!!!
Under the hood, the dynamic Grizzly is watching you....
technorati: grizzly virtual server glassfish
- Login or register to post comments
- Printer-friendly version
- jfarcand's blog
- 3575 reads





