GlassFish?????????????? Apache ??? Part1????? ???????????

GlassFish ??????
??? GlassFish ?????????????????

???????
dashost > asadmin start-domain clusterDomain
???? clusterDomain ?????????????????
???????????? /export/home/appserv/domains/clusterDomain/logs/server.log ???
??? /export/home/appserv/domains/clusterDomain/logs/server.log ????????????
???? clusterDomain ????????
???? [clusterDomain] ?????? [Sun GlassFish Enterprise Server v2.1.1 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs)] ???????????? [/export/home/appserv/domains] ??????
???????? [http://localhost:5048] ????????
"asadmin" ??????????? [5048] ???????
????? Web ??????????? URL ???????:
[http://localhost:5080 https://localhost:5081 ]?
?? web-contexts ???????:
[/web1 /__wstx-services ]?
??? JMX ?????? (JConsole ??) ??????????? JMXServiceURL:
[service:jmx:rmi:///jndi/rmi://dashost:5086/jmxrmi] ????????
??????????????????????????:
[5080 5081 5048 5037 5038 5039 5086 ]?
??????????????????????????????????????????????????

????????????
???????????????????????????

nodeagent1 ??????
nodeagent1 > asadmin create-node-agent nodeagent1
???? create-node-agent ????????????
nodeagent1 > asadmin start-node-agent nodeagent1
??? /export/home/appserv/nodeagents/nodeagent1/agent/logs/server.log ????????????
??????????? /export/home/appserv/nodeagents/nodeagent1/agent/logs/server.log ??????????
???? start-node-agent ????????????

nodeagent2 ??????
nodeagent2 > asadmin create-node-agent nodeagent2
???? create-node-agent ????????????
nodeagent2 > asadmin start-node-agent nodeagent2
??? /export/home/appserv/nodeagents/nodeagent2/agent/logs/server.log ????????????
??????????? /export/home/appserv/nodeagents/nodeagent2/agent/logs/server.log ??????????
???? start-node-agent ????????????

??????????????
??????????????????????????????
?????????????
dashost > asadmin create-cluster cluster1
???? create-cluster ????????????
dashost > asadmin create-instance --nodeagent nodeagent1 --cluster cluster1 instance1
???? create-instance ????????????
dashost > asadmin create-instance --nodeagent nodeagent2 --cluster cluster1 instance2
???? create-instance ???????????

???????
???????????????
dashost > asadmin start-cluster cluster1
?????????????? instance1 ???????????
?????????????? instance2 ???????????
???? start-cluster ????????????

?????????????????
??????????????????????
dashost > asadmin deploy --target cluster1 --availabilityenabled=true /sun/glassfish-v2.1.1/samples/quickstart/clusterjsp/clusterjsp.ear
???? deploy ????????????

?????????????????????????????
????????????????????????????????
??????????????
dashost > asadmin create-http-lb-config --target cluster1 lb-config
???? create-http-lb-config ????????????
dashost > asadmin enable-http-lb-server cluster1
???? enable-http-lb-server ????????????
dashost > asadmin enable-http-lb-application --name clusterjsp cluster1
???? enable-http-lb-application ????????????
dashost > asadmin create-http-health-checker --interval 10 --config lb-config cluster1
???? create-http-health-checker ????????????
dashost > asadmin export-http-lb-config --config lb-config /tmp/loadbalancer.xml
????????????: /tmp/loadbalancer.xml
???? export-http-lb-config ????????????

?????????loadbalancer.xml????? Apache ?????????
?????????????????????????
apache > cp /tmp/loadbalancer.xml /usr/local/apache2.2.14/conf/loadbalancer.xml

??????????????? Web Server ??????? loadbalancer.xml ?
????????????????????????????????
autoapplyenabled=true??
dashost > asadmin create-http-lb --target cluster1 --autoapplyenabled=true --devicehost apache.japan.sun.com --deviceport 443 lb-config
???? create-http-lb ????????????
dashost > asadmin apply-http-lb-changes lb-config
???? apply-http-lb-changes ????????????
dashost >

????????????apply-http-lb-changes ???????
Apache ? loadbalancer.xml ??????????????
apache > cat /usr/local/apache2.2.14/conf/loadbalancer.xml



















apache >

?????
?????? Apache ????????????????????
????? Apache ???????????
http://INSTALL_MACHINE/clusterjsp/

Served From Server instance: instance1


?????????"Served From Server instance"??????
???????????????????????????????
????????????????

Enter session attribute data:
??????????????????

??????????????????????????????
dashost > asadmin stop-instance instance1
???? stop-instance ????????????

???????????????[Reload Page]????????????
"Served From Server instance:"?????? instance1??instance2?
?????????????????????????????????????
????????

?????????????????????2?????????
????????????????????????????????????
??????
dashost > asadmin set "cluster1.server-ref.instance2.lb-enabled=false"
cluster1.server-ref.instance2.lb-enabled = false
dashost > asadmin apply-http-lb-changes lb-config
???? apply-http-lb-changes ????????????

?????????????loadbalancer.xml ???????2?????
???????????? (enabled ? false)
apache > cat loadbalancer.xml|grep nodeagent2


??????????????????????????????????
dashost > asadmin set "cluster1.server-ref.instance2.lb-enabled=true"
cluster1.server-ref.instance2.lb-enabled = true
dashost > asadmin apply-http-lb-changes lb-config
???? apply-http-lb-changes ????????????

????loadbalancer.xml ???????2?????????? enabled ? true ???????? apache > cat loadbalancer.xml | grep nodeagent2


??????????????????????????
?????????????????????????
???????????????????????
???????apply-http-lb.-changes ???????????
???????????
dashost > asadmin create-instance --nodeagent nodeagent1 --cluster cluster1 instance3
HTTP_LISTENER_PORT ????? 38,081 ???????
HTTP_SSL_LISTENER_PORT ????? 38,182 ???????
IIOP_SSL_LISTENER_PORT ????? 33,821 ???????
JMS_PROVIDER_PORT ????? 37,677 ???????
IIOP_LISTENER_PORT ????? 33,701 ???????
JMX_SYSTEM_CONNECTOR_PORT ????? 38,687 ???????
IIOP_SSL_MUTUALAUTH_PORT ????? 33,921 ???????
???? create-instance ????????????
dashost > asadmin create-instance --nodeagent nodeagent2 --cluster cluster1 instance4
HTTP_LISTENER_PORT ????? 38,081 ???????
HTTP_SSL_LISTENER_PORT ????? 38,182 ???????
IIOP_SSL_LISTENER_PORT ????? 33,821 ???????
JMS_PROVIDER_PORT ????? 37,677 ???????
IIOP_LISTENER_PORT ????? 33,701 ???????
JMX_SYSTEM_CONNECTOR_PORT ????? 38,687 ???????
IIOP_SSL_MUTUALAUTH_PORT ????? 33,921 ???????
???? create-instance ????????????
dashost > asadmin start-instance instance3
???? start-instance ????????????
dashost > asadmin start-instance instance4
???? start-instance ????????????
dashost > asadmin apply-http-lb-changes lb-config
???? apply-http-lb-changes ????????????


loadbalancer.xml ???????????
?????????????????????????????
apache > cat loadbalancer.xml





















apache >

???????????????????????????????????
????????????????????????????? Web ?????
??????????????????????????????????????
??????????????
?????? GlassFish ?????????????? Apache ?????????
?????Sun Java System Web Server ?? autoapply ???????????????
????????
?????????????????


More...