22 07 2014
Apache Httpd 2.2.x + JBoss EAP 6.x + mod-jk + node1,node2 clustering, node3,node4 clustering방법
Contents
이전작업
아래의 링크를 통해 node1,node2가 session clustering 되는 것을 알수 있었는데
Apache Httpd 2.2.x + JBoss EAP 6.x + Tomcat Connector 1.2.x Session Clustering
이번에는 node1,node2가 하나의 사이트 node3,node4가 하나의 사이트가 되도록 해보자.
JBoss 설정
cp node01 node03
cd node03
vi jboss-env.conf
1 2 3 |
JBOSS_PORT_OFFSET=300 (node01= 100, node02=200) JBOSS_NODE_NAME=node03 JBOSS_MULTICAST_ADDR=230.0.0.5 (node01,node02는 230.0.0.4) |
1 |
vi ../node03/configuration/standalone-ha.xml |
1 2 3 4 |
<socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45701"/> <socket-binding name="jgroups-tcp" port="7601"/> <socket-binding name="jgroups-tcp-fd" port="57601"/> <socket-binding name="jgroups-udp" port="55201" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45689"/> |
위의 node01,node02의 설정파일보다 숫자 1씩 증가시킨다.
이번에는 node04를 복사
cp node03 node04
cd node04
1 |
vi jboss-env.conf |
1 2 3 4 5 |
JBOSS_PORT_OFFSET=400 (node01= 100, node02=200, node03=300) JBOSS_NODE_NAME=node04 JBOSS_MULTICAST_ADDR=230.0.0.5 (node01,node02는 230.0.0.4) |
all-run.sh 수정
1 |
vi all-run.sh |
1 2 |
nodes="node01,node02,node03,node04"; nodeArray=($nodes); |
1 2 3 |
여기까지 JBoss설정끝 |
Apache설정
1 2 3 |
httpd.conf에 입력을하든 include를 하던 아래와 같이 설정을 한다. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<VirtualHost *:80> ServerName www.nexkorea.com ServerAlias nexkorea.com DocumentRoot /경로/ROOT.war ServerAdmin shaik@naver.com Alias /data /경로/data SetEnvIf Request_URI "(\.gif|\.GIF|\.jpg|\.JPG|\.png|\.PNG|\.swf|\.ico|\.css|\.js)$" statics_log CustomLog "|/app/httpd/bin/rotatelogs /app/httpd/logs/site_access.log.%Y%m%d 86400" common env=!statics_log CustomLog "|/app/httpd/bin/rotatelogs /app/httpd/logs/site_statics.log.%Y%m%d 86400" common env=statics_log ErrorLog "|/app/httpd/bin/rotatelogs /app/httpd/logs/site_error.log.%Y%m%d 86400" # SSLProxyEngine on # RequestHeader set Fron-End-Https "On" <Directory "/경로/ROOT.war"> Options FollowSymLinks MultiViews AllowOverride None Require all granted </Directory> <Directory "/경로/data"> Options FollowSymLinks MultiViews AllowOverride ALL Require all granted </Directory> </VirtualHost> |
그리고
1 |
vi workers.properites |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
#HTTPD Web Server and Apache Tomcat(ajp) Connector # # Include workers.properties by conf/extra/httpd-modjk.conf worker.list=albnode,blbnode,jkstatus # configuration template worker.template.type=ajp13 worker.template.lbfactor=1 worker.template.socket_timeout=30 worker.template.socket_keepalive=true worker.template.recovery_options=7 worker.template.ping_mode=A worker.template.ping_timeout=10000 worker.template.fail_on_status=-404,-500,503,504 worker.template.connection_pool_size=25 worker.template.connection_pool_minsize=25 worker.template.connection_pool_timeout=30 #worker.template.max_packet_size=65536 ###################################################### # http://a.nuriware.com ###################################################### # configuration node01 worker.node01.reference=worker.template worker.node01.host=127.0.0.1 worker.node01.port=8109 # configuration node02 worker.node02.reference=worker.template worker.node02.host=127.0.0.1 worker.node02.port=8209 # configuration loadbalancer worker.haelbnode.type=lb worker.haelbnode.retries=1 worker.haelbnode.max_reply_timeouts=5000 worker.haelbnode.method=Session worker.haelbnode.sticky_session=True worker.haelbnode.sticky_session_force=False worker.haelbnode.balance_workers=node01,node02 ###################################################### # http://b.nuriware.com ###################################################### # configuration node03 worker.node03.reference=worker.template worker.node03.host=127.0.0.1 worker.node03.port=8309 # configuration node04 worker.node04.reference=worker.template worker.node04.host=127.0.0.1 worker.node04.port=8409 worker.solphcblbnode.type=lb worker.solphcblbnode.retries=1 worker.solphcblbnode.max_reply_timeouts=5000 worker.solphcblbnode.method=Session worker.solphcblbnode.sticky_session=True worker.solphcblbnode.sticky_session_force=False worker.solphcblbnode.balance_workers=node03,node04 worker.jkstatus.type=status |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<VirtaulHost *:80> ServerName a.nuriware.com ServerAlias nuriware.com DocumentRoot "/app/webapps/a/deployments/ROOT.war" ServerAdmin admin@nuriware.com JkMount /*.do albnode JkMount /*.jsp albnode JkUnMount /statics albnode JkMount /jkmanager jkstatus </VirtualHost> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<VirtualHost *:80> ServerName b.nuriware.com ServerAlias nuriware.com DocumentRoot "/app/webapps/b/deployments/ROOT.war" ServerAdmin admin@nuriware.com JkMount /*.do blbnode JkMount /*.jsp blbnode JkUnMount /statics blbnode JkMount /jkmanager jkstatus </VirtualHost> |
물론 SSL이 있으면 SSL도 마찬가지이다.
Tag Library사용시 Html소스에서 공백 없애기 _ 지인으로부터 받음 XSS Filter 사용시 제외 Url 적용 하기