Jul
02
2010

Change glassfish password – part 2

Recently I already posted a bog about this subject, only it wasn’t sufficient enough. So below the exact steps you have to follow to change your admin password in an glasfish cluster environment.

Log in on the admin console, click on domain > Administrator Password, and put in a new password. Click on save. The password is immediatly changes. This does the same as “asadmin update-file-user –authrealmname admin-realm admin” commando, except the update-file-user expects that there is an other user. Default there is only the admin user. Both actions change the keyfile in $GLASSFISH_HOME/domains/domain1/config. I perfer the change password through the console, since I don’t have a second admin user.

next we have to change the .asadminpassword file in the user home. Start asadmin and enter the following commands:

[glassfish@YSGF01 ~]$ asadmin
Use "exit" to exit and "help" for online help.
asadmin> change-admin-password
Please enter the old admin password> [new password]
Please enter the new admin password> [new password]
Please enter the new admin password again> [new password]
Updated .asadminpass file with new password.
Command change-admin-password executed successfully.

Next we have to make sure the the node-agent are aware of the changed password.

asadmin> stop-node-agent nadev01-yenlo
Command stop-node-agent executed successfully.
asadmin> start-node-agent --startinstances=false nadev01-yenlo
Please enter the admin user name>admin
Please enter the admin password>
Redirecting output to /u00/oracle/product/2.2/glassfishesb/glassfish/nodeagents/nadev01-yenlo/agent/logs/server.log
Redirecting application output to /u00/oracle/product/2.2/glassfishesb/glassfish/nodeagents/nadev01-yenlo/agent/logs/server.log
Command start-node-agent executed successfully.
asadmin> list-instances
indev01-yenlo not running
indev02-yenlo running
Command list-instances executed successfully.
asadmin> start-instance indev01-yenlo
Command start-instance executed successfully.

Log in on every node of the cluster, stop the node agent, then start it again without starting the instance on it (–startinstances=false). Then start the instances on it. On this way you can change your password without any down time.

posted in GlassFish by Rudi Heinen

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

 


Copyright


Yenlo is de ICT dienstverlener in Nederland die volop Sun Glassfish technologie inzet om SOA en ESB projecten te doen slagen.
Voor meer informatie kijk ook op www.yenlo.nl

Glassfish is an official trademark of Sun's solution for Application Servers and SOA/BPEL/ESB middleware.
For more information, please see Sun's official website, http://www.sun.com/software/products/appsrvr