Can I add cluster support to a domain?

Author: Kedar Mhaswade

Basics?

Yes, you can change the profile of a domain from developer to cluster profile in GlassFish v2.
It's fairly simple using the Web Admin Console as explained in this blog or this blog. See the screencast here.

The documentation for adding cluster support to a developer domain is here.

If for some reason you need to revert to using a developer profile, make sure you backup your domain.xml file and restore this file (it's the only one touched in the upgrade process).

What about Windows Service Asking for Password?

All that's great. But why does "asadmin start-domain" now ask for admin user name and admin password?

The answer lies in differences between a developer profile domain and a cluster profile domain or rather
differences between a domain that does not support clusters and the one that does. A cluster-aware domain requires to have admin user and password in its memory to authenticate with node-agent and other server instances as the case may be, for some internal communication. The domain never stores the password statically in configuration files and hence it needs you, as an administrator to provide it every time it needs it.

I see two solutions, there might be more.

  1. After you have upgraded the domain, start the domain and perform: "asadmin login --host localhost --port 4848". It will prompt you for the user name and password and then "save" its representation for you to pick up every time you start the domain.
  2. For the default domain, i.e. the domain created using "ant f setup.xml", you will never have this problem because this domain is crated with "-savelogin" implying the information is already saved.

Was this useful?