Glassfish Installation and Configuration (OC4J Migration)
Hi,
today I've installed multiple application server domains and instances on different linux machines. I've used a script to simplify the work. Glassfish offers the command line interface (CLI) "asadmin" which enables rapid configuration and installation tasks.
Define some paths:
export PASSWORDFILE=~/glassfish/password
export DOMAIN_ROOTDIR=/shared/mydir/glassfish
export RESOURCEXML=~/glassfish/resource.xml
Define domain and instance name and configure ports
export ACTIVE_DOMAIN=CpDomain
export ACTIVE_DOMAIN_LC=cpDomain
export TARGET_HOST_USER=auser
export TARGET_HOST_DOMAIN=host.domain.com
export TARGET_HOST=${TARGET_HOST_USER}@${TARGET_HOST_DOMAIN}
export ADMIN_PORT=10048
export INSTANCE_PORT=10080
export JMS_PORT=10076
export DOMAIN_JMXPORT=10086
export ORB_LISTENER_PORT=10037
export HTTP_SSL_PORT=10081
export ORB_SSL_PORT=10038
export ORB_MUTUALAUTH_PORT=10039
export DEBUG_PORT=10090
And here you go:
# create password file
ssh $TARGET_HOST "echo \"AS_ADMIN_PASSWORD=adminadmin:AS_ADMIN_ADMINPASSWORD=adminadmin\" | tr \":\" \"\n\" > ${PASSWORDFILE}${ACTIVE_DOMAIN}"
# create domain
ssh $TARGET_HOST "${DOMAIN_ROOTDIR}/bin/asadmin create-domain \
--adminuser admin \
--passwordfile ${PASSWORDFILE}${ACTIVE_DOMAIN} \
--adminport ${ADMIN_PORT} \
--instanceport ${INSTANCE_PORT} \
--echo=true \
--domaindir ${DOMAIN_ROOTDIR}/domain${ACTIVE_DOMAIN} \
--domainproperties \
jms.port=${JMS_PORT}:\
domain.jmxPort=${DOMAIN_JMXPORT}:\
orb.listener.port=${ORB_LISTENER_PORT}:\
http.ssl.port=${HTTP_SSL_PORT}:\
orb.ssl.port=${ORB_SSL_PORT}:\
orb.mutualauth.port=${ORB_MUTUALAUTH_PORT} \
--savemasterpassword=true \
--checkports=true ${ACTIVE_DOMAIN_LC}"
# start domain
ssh $TARGET_HOST "${DOMAIN_ROOTDIR}/bin/asadmin start-domain \
--domaindir ${DOMAIN_ROOTDIR}/domain${ACTIVE_DOMAIN} \
--user admin \
--passwordfile ${PASSWORDFILE}${ACTIVE_DOMAIN} \
--debug=false \
${ACTIVE_DOMAIN_LC}"
# add jdbc resources
ssh $TARGET_HOST "${DOMAIN_ROOTDIR}/bin/asadmin add-resources --user admin --passwordfile ${PASSWORDFILE}${ACTIVE_DOMAIN} --host ${TARGET_HOST_DOMAIN} --port ${ADMIN_PORT} ${RESOURCEXML}"
# configure debug port and enable debug mode
ssh $TARGET_HOST "${DOMAIN_ROOTDIR}/bin/asadmin set --user admin --passwordfile ${PASSWORDFILE}${ACTIVE_DOMAIN} --host ${TARGET_HOST_DOMAIN} --port ${ADMIN_PORT} server.java-config.debug-options=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${DEBUG_PORT}\"; ${DOMAIN_ROOTDIR}/bin/asadmin set --user admin --passwordfile ${PASSWORDFILE}${ACTIVE_DOMAIN} --host ${TARGET_HOST_DOMAIN} --port ${ADMIN_PORT} server.java-config.debug-enabled=true"
# restart domain with debug mode
ssh $TARGET_HOST "${DOMAIN_ROOTDIR}/bin/asadmin stop-domain \
--domaindir ${DOMAIN_ROOTDIR}/domain${ACTIVE_DOMAIN} \
${ACTIVE_DOMAIN_LC}; \
${DOMAIN_ROOTDIR}/bin/asadmin start-domain \
--domaindir ${DOMAIN_ROOTDIR}/domain${ACTIVE_DOMAIN} \
--user admin \
--passwordfile ${PASSWORDFILE}${ACTIVE_DOMAIN} \
--debug=true \
${ACTIVE_DOMAIN_LC}"
Labels: glassfish

3 Comments:
This post has been removed by the author.
11/23/2006 2:11 PM
OC4J knows how to manage Oracle FAN events but Glassfish ?
Oracle JDBC has an option that enable a discussion with all Oracle RAC nodes (port 6200).
This for example permit node 2 to inform your pool manager that node 1 is down, and you should not used this connections anymore.
11/23/2006 2:13 PM
Hi akhen,
If you buy the commercial variant of glassfish, the Sunn Application Server Enterprise Edition you will also get features like FAN events and failover and high availability.
Keep in mind thtat the Glassfish costs nothing whereas the Oracle Application Server costs money. And you are not forced to buy in service.
Please do me a favour and don't compaire OC4J with Glassfish. Don't propose to use OC4J in production.
12/04/2006 11:07 PM
Post a Comment
<< Home