2019/07/10 05:34 1/2 JBoss EAP 6.x Standalone Session Clustering 목차 JBoss EAP 6.x Standalone Session Clustering... 1 설치환경... 1 설치전작업... 1 Kernel/TCP Parameter 설정... 1 즉시적용... 1 영구적용... 1 의존패키지설치... 2 사용자및그룹생성... 2 다운로드... 2 디렉토리구조생성... 2 JBoss 구성... 3 JBoss Server 설치... 3 JBoss Clustering 기본 Node 구성... 3 Standalone Node 복사... 3 Shell Script 생성... 3 설정... 8 JBoss Clustering Node 추가... 10 Standalone Node 복사... 10 실행스크립트복사... 10 환경설정... 10 전체 Node 실행 Shell Script... 11 all-run.sh 전체실행기본스크립트... 11 all-start.sh 전체시작... 12 all-stop.sh 전체종료... 13 all-restart.sh 전체재시작... 13 all-log.sh 콘솔로그전체보기... 13 실행권한부여... 14 소유권변경... 14 Clustering Sample Applicion 생성... 14 web.xml... 14 jboss-web.xml... 15 index.jsp... 15 방화벽설정... 16 실행확인... 17 JBoss Cluster Node 실행... 17 Clustering 동작로그확인... 18 Clustering Sample Applicion 확인... 19 Apache HTTPD Server 연동... 20 연동방법1 mod_jk... 20 연동방법2 mod_cluster 연동... 20 오류관련... 20 JBAS014612 : java.lang.runtimeexception: java.net.unknowntion: standalone01: standalone01... 20 AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 1/22 JBoss EAP 6.x Standalone Session Clustering JBoss EAP 6.x Standalone Session Clustering 원문출처 http://blog.beany.co.kr/archives/3971 : 이상훈 (imfjbh@gmail.com) 설치환경 CentOS 6.5 JBoss EAP 6.2.0 Sun JDK 7 설치전작업 Kernel/TCP Parameter 설정 OS 에설치된기본설정을사용할 JBoss 경우기동시 Socket Buffer 와관련한WARN 메시지가나타날수있습니다. 즉시 적용 아래의명령으로TCP Parameter 값을변경합니다. 재부팅시에는원래의 Parameter 기본값으로돌아옵니다. sysctl -w net.core.rmem_default=26214400 sysctl -w net.core.wmem_default=1048576 sysctl -w net.core.rmem_max=26214400 sysctl -w net.core.wmem_max=1048576 영구적용 아래의명령을실행하여 TCP Parameter 를설정파일을편집합니다. /etc/sysctl.conf net.core.wmem_max = 1048576 net.core.rmem_max = 26214400 net.core.rmem_default = 26214400 net.core.wmem_default = 1048576 AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 의존패키지설치 아래의명령을실행하여의존패키지를설치합니다. yum -y install unzip 사용자및그룹생성 JBoss 기동시사용할사용자 (wasadmin) 계정과그룹 (wasadmin) 을생성합니다. groupadd wasadmin useradd -M -g wasadmin wasadmin 다운로드 JBoss 사이트 (http://www.jboss.org/jbossas/downloads) 에접속하여 JBoss EAP 6.2.0 GA 버전을다운로드받습니다. 디렉토리구조생성 JBoss 설치디렉토리구조는아래와같습니다. /app/jboss-as jboss-eap-6.2 nodes node01 node02... /app/webapps/deployments /var/log/jboss-as 클러스터링을위한 Standalone 노드를설치할폴더를생성합니다. mkdir -p /app/jboss-as/nodes Web Applicion 배포폴더를생성합니다. mkdir -p /app/webapps/deployments http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 3/22 JBoss EAP 6.x Standalone Session Clustering JBoss 구성 JBoss Server 설치 다운로드한 JBoss 설치압축파일을설치위치로이동한후압축을해제합니다. cp jboss-eap-6.2.0.zip /app/jboss-as cd /app/jboss-as unzip jboss-eap-6.2.0.zip JBoss 설치파일을삭제합니다. rm -f /app/jboss-as/jboss-eap-6.2.0.zip JBoss Clustering 기본 Node 구성 Node 별로그를중앙집중적으로관리하기위한로그폴더를생성합니다. mkdir -p /var/log/jboss-as Standalone Node 복사 압축을해제한JBoss 설치디렉토리로이동한 standalone 후폴더를복사한후폴더명을변경합니다. cp -R /app/jboss-as/jboss-eap-6.2/standalone /app/jboss-as/nodes mv /app/jboss-as/nodes/standalone /app/jboss-as/nodes/node01 Shell Script 생성 JBoss Clustering Node 들에대한실행을위한스크립트및설정파일을생성합니다. jboss-env.conf 환경설정파일 아래의명령을실행하여 JBoss Node 별로속성을설정할수 jboss-env.conf 있는파일을생성합니다. vi /app/jboss-as/nodes/node01/jboss-env.conf AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 아래의내용을입력합니다. /app/jboss-as/nodes/node01/jboss-env.conf JAVA_HOME=/opt/jdk1.7.0_55 JBOSS_NODE_NAME=node01 JBOSS_PORT_OFFSET=100 JBOSS_USER=wasadmin JBOSS_HOME=/app/jboss-as/jboss-eap-6.2 JBOSS_NODE_BASE_DIR=/app/jboss-as/nodes JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-$JBOSS_NODE_NAME.pid JBOSS_CONFIG=standalone-ha.xml JBOSS_BASE_LOG_DIR=/var/log/jboss-as JBOSS_CONSOLE_LOG=$JBOSS_BASE_LOG_DIR/$JBOSS_NODE_NAME-console.log JBOSS_GC_LOG=$JBOSS_BASE_LOG_DIR/$JBOSS_NODE_NAME-gc.log JBOSS_BIND_ADDR=0.0.0.0 JBOSS_MANAGEMENT_ADDR=127.0.0.1 JBOSS_CONTROLLER_IP=$JBOSS_MANAGEMENT_ADDR JBOSS_MULTICAST_ADDR=230.0.0.4 JBOSS_JMS_MULTICAST_ADDR=231.7.0.1 JBOSS_MODCLUSTER_MULTICAST_ADDR=224.0.1.105 LAUNCH_JBOSS_IN_BACKGROUND=true STARTUP_WAIT=30 SHUTDOWN_WAIT=30 jboss-env.sh 환경설정 공통환경쉘스크립트파일을생성합니다. vi /app/jboss-as/nodes/node01/jboss-env.sh 아래의내용으로시작쉘스크립트를입력한후저장합니다. /app/jboss-as/nodes/node01/jboss-env.sh #!/bin/sh DATE=`de +%Y%m%d%H%M%S` http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 5/22 JBoss EAP 6.x Standalone Session Clustering BASE_DIR=$(dirname $0) export JBOSS_CONF=$BASE_DIR/jboss-env.conf [ -r "$JBOSS_CONF" ] &&. "${JBOSS_CONF}" let JBOSS_CONTROLLER_PORT=9999+$JBOSS_PORT_OFFSET export JBOSS_CONTROLLER_PORT ########## JBoss System module and User module directory ########## export JBOSS_MODULEPATH=$JBOSS_HOME/modules:$JBOSS_HOME/modules/ext # JVM Options : Server export JAVA_OPTS="-server $JAVA_OPTS" # JVM Options : Memory export JAVA_OPTS=" $JAVA_OPTS -Xms1024m -Xmx1024m -XX:MaxPermSize=256m" export JAVA_OPTS=" $JAVA_OPTS -XX:+PrintGCTimeStamps " export JAVA_OPTS=" $JAVA_OPTS -XX:+PrintGCDetails " export JAVA_OPTS=" $JAVA_OPTS -Xloggc:$JBOSS_GC_LOG" export JAVA_OPTS=" $JAVA_OPTS -XX:+UseParallelGC " #export JAVA_OPTS=" $JAVA_OPTS -XX:+UseConcMarkSweepGC " export JAVA_OPTS=" $JAVA_OPTS -XX:+ExplicitGCInvokesConcurrent " export JAVA_OPTS=" $JAVA_OPTS -XX:-HeapDumpOnOutOfMemoryError " # Linux Large Page Setting #export JAVA_OPTS=" $JAVA_OPTS -XX:+UseLargePages " export JAVA_OPTS=" $JAVA_OPTS -verbose:gc" export JAVA_OPTS=" $JAVA_OPTS -Djava.net.preferIPv4Stack=true" export JAVA_OPTS=" $JAVA_OPTS -Dorg.jboss.resolver.warning=true" export JAVA_OPTS=" $JAVA_OPTS -Dsun.rmi.dgc.client.gcInterval=3600000 " export JAVA_OPTS=" $JAVA_OPTS -Dsun.rmi.dgc.server.gcInterval=3600000" export JAVA_OPTS=" $JAVA_OPTS - Djboss.modules.system.pkgs=org.jboss.byteman" export JAVA_OPTS=" $JAVA_OPTS -Djava.awt.headless=true" export JAVA_OPTS=" $JAVA_OPTS - Djboss.server.base.dir=$JBOSS_NODE_BASE_DIR/$JBOSS_NODE_NAME" export JAVA_OPTS=" $JAVA_OPTS - Djboss.server.log.dir=$JBOSS_BASE_LOG_DIR" export JAVA_OPTS=" $JAVA_OPTS -Djboss.socket.binding.portoffset=$JBOSS_PORT_OFFSET" export JAVA_OPTS=" $JAVA_OPTS -Djboss.node.name=$JBOSS_NODE_NAME" export JAVA_OPTS=" $JAVA_OPTS - Djboss.bind.address.management=$JBOSS_MANAGEMENT_ADDR" export JAVA_OPTS=" $JAVA_OPTS -Djboss.bind.address=$JBOSS_BIND_ADDR" #export JAVA_OPTS=" $JAVA_OPTS -Djboss.bind_addr=$JBOSS_MULTICAST_ADDR" #export JAVA_OPTS=" $JAVA_OPTS -Djboss.default.jgroups.stack=tcp" export JAVA_OPTS=" $JAVA_OPTS - Djboss.default.multicast.address=$JBOSS_MULTICAST_ADDR" export JAVA_OPTS=" $JAVA_OPTS - AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 Djboss.messaging.group.address=$JBOSS_JMS_MULTICAST_ADDR" export JAVA_OPTS=" $JAVA_OPTS - Djboss.modcluster.multicast.address=$JBOSS_MODCLUSTER_MULTICAST_ADDR" export JAVA_OPTS=" $JAVA_OPTS -Dorg.jboss.as.logging.perdeployment=false" export JAVA_OPTS=" $JAVA_OPTS -Dserver.mode=local" export JAVA_OPTS=" $JAVA_OPTS - Djboss.server.config.user.dir=$JBOSS_DOMAIN_BASE_DIR/$JBOSS_DOMAIN_NAME /configurion" export JAVA_OPTS=" $JAVA_OPTS - Djboss.domain.config.user.dir=$JBOSS_DOMAIN_BASE_DIR/$JBOSS_DOMAIN_NAME /configurion" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH echo "==================================================================" echo "JAVA_HOME=$JAVA_HOME" echo "JBOSS_HOME=$JBOSS_HOME" echo "JBOSS_NODE_NAME=$JBOSS_NODE_NAME" echo "JBOSS_NODE_BASE_DIR=$JBOSS_NODE_BASE_DIR" echo "JBOSS_CONFIG=$JBOSS_CONFIG" echo "JBOSS_BIND_ADDR=$JBOSS_BIND_ADDR" echo "JBOSS_PORT_OFFSET=$JBOSS_PORT_OFFSET" echo "JBOSS_MULTICAST_ADDR=$JBOSS_MULTICAST_ADDR" echo "JBOSS_CONTROLLER=$JBOSS_CONTROLLER_IP:$JBOSS_CONTROLLER_PORT" echo "JBOSS_PIDFILE=$JBOSS_PIDFILE" echo "JBOSS_CONSOLE_LOG=$JBOSS_CONSOLE_LOG" echo "JBOSS_GC_LOG=$JBOSS_GC_LOG" echo "==================================================================" jboss-run.sh 실행스크립트 ( 시작 & 종료 ) JBoss Node 실행쉘스크립트파일을생성합니다. vi /app/jboss-as/nodes/node01/jboss-run.sh 아래의내용으로실행쉘스크립트를입력한후저장합니다. /app/jboss-as/nodes/node01/jboss-run.sh http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 7/22 JBoss EAP 6.x Standalone Session Clustering #!/bin/sh BASE_DIR=$(dirname $0). $BASE_DIR/jboss-env.sh if [ "x$1" == "xstart" ]; then if [ -e $JBOSS_CONSOLE_LOG ]; then mv $JBOSS_CONSOLE_LOG $JBOSS_CONSOLE_LOG.$DATE fi if [ -e $JBOSS_GC_LOG ]; then mv $JBOSS_GC_LOG $JBOSS_GC_LOG.$DATE fi fi $JBOSS_HOME/bin/init.d/jboss-as-standalone.sh $1 #tail -f $JBOSS_CONSOLE_LOG jboss-jconsole.sh JConsole JConsole 쉘스크립트파일을생성합니다. vi /app/jboss-as/nodes/node01/jboss-jconsole.sh 아래의내용을 JConsole 쉘스크립트를입력한후저장합니다. /app/jboss-as/nodes/node01/jboss-jconsole.sh #!/bin/sh BASE_DIR=$(dirname $0). $BASE_DIR/jboss-env.sh echo "=======================================================" echo " JMX URL : service:jmx:remotingjmx://$jboss_management_addr:$jboss_controller_port" echo "=======================================================" $JBOSS_HOME/bin/jconsole.sh AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 jboss-cli.sh CLI CLI 쉘스크립트파일을생성합니다. vi /app/jboss-as/nodes/node01/jboss-cli.sh 아래의내용을 CLI 쉘스크립트를입력한후저장합니다. /app/jboss-as/nodes/node01/jboss-cli.sh #!/bin/sh BASE_DIR=$(dirname $0). $BASE_DIR/jboss-env.sh export JAVA_OPTS=" -Djava.awt.headless=false $JAVA_OPTS" $JBOSS_HOME/bin/jboss-cli.sh -- controller=$jboss_controller_ip:$jboss_controller_port --connect $@ 실행권한부여 쉘스크립트에실행권한을부여합니다. chmod 755 /app/jboss-as/nodes/node01/*.sh 설정 Standalone 기반의 Clustering 구성을위하여 standalone-ha.xml 파일을수정합니다. vi /app/jboss-as/nodes/node01/configurion/standalone-ha.xml 아래의항목을다음과같이수정또는추가합니다. deployment-scanner ph : Web Applicion 배포디렉토리를지정합니다. deployment-scanner scan-interval : ph (Web Applicion 배포디렉토리 ) 의파일들에대한변경감지시간을설정합니다. (1/1000 초 ) 0 으로설정시변경감지 deployment-scanner auto-deploy-exploded : true 로설정했을경우 war 파일이아닌디렉토리로설정할수있습니다. instance-id : jvmroute 기능을하기위한설정이며, ${jboss.node.name} 설정값는외부 http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 9/22 JBoss EAP 6.x Standalone Session Clustering 설정값으로대체됩니다. enable-welcome-root : ROOT Context 를사용할경우 false 로설정합니다. true 로설정이되어있을경우Root Context 는 JBoss 에기본으로내장되어있는 Content 를표시하게됩니다. /app/jboss-as/nodes/node01/configurion/standalone-ha.xml <?xml version='1.0' encoding='utf-8'?> <server xmlns="urn:jboss:domain:1.5"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <profile> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1"> <!-- <deployment-scanner ph="deployments" reliveto="jboss.server.base.dir" scan-interval="5000"/> --> <deployment-scanner ph="/app/webapps/deployments" scaninterval="0" auto-deploy-exploded="true" /> </subsystem> <subsystem xmlns="urn:jboss:domain:web:1.5" default-virtualserver="default-host" instance-id="${jboss.node.name}" nive="false"> <connector name="http" protocol="http/1.1" scheme="http" socket-binding="http"/> <connector name="ajp" protocol="ajp/1.3" scheme="http" socket-binding="ajp"/> <virtual-server name="default-host" enable-welcomeroot="false"> <alias name="localhost"/> <alias name="example.com"/> </virtual-server> </subsystem> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ </profile> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ </server> AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 JBoss Clustering Node 추가 하나의물리적인서버에 Clustering Node 추가작업에대한설명입니다. Standalone Node 복사 아래의명령을실행하여기존의 JBoss Home 폴더의 standalone 폴더를복사한후해당 Node 의이름을변경합니다. 현재는기존의 /app/jboss-as/nodes/node01 폴더가존재하기때문에 /app/jbossas/nodes/node02 로설정합니다. cp -R /app/jboss-as/jboss-eap-6.2/standalone /app/jboss-as/nodes mv /app/jboss-as/nodes/standalone /app/jboss-as/nodes/node02 실행스크립트복사 /app/jboss-as/nodes/node01 에서생성한실행스크립트를신규로생성하는 Node 로복사합니다. cp /app/jboss-as/nodes/node01/*.sh /app/jboss-as/nodes/node01/*.conf /app/jboss-as/nodes/node02 환경설정 아래의명령을실행하여 jboss-env.conf 파일을편집합니다. vi /app/jboss-as/nodes/node02/jboss-env.conf 아래의항목을현재설정에맞도록수정한후저장합니다. /app/jboss-as/nodes/node02/jboss.conf JAVA_HOME=/opt/jdk1.7.0_55 JBOSS_NODE_NAME=node02 JBOSS_PORT_OFFSET=200 JBOSS_USER=wasadmin JBOSS_HOME=/app/jboss-as/jboss-eap-6.2 JBOSS_NODE_BASE_DIR=/app/jboss-as/nodes http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 11/22 JBoss EAP 6.x Standalone Session Clustering JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-$JBOSS_NODE_NAME.pid JBOSS_CONFIG=standalone-ha.xml JBOSS_BASE_LOG_DIR=/var/log/jboss-as JBOSS_CONSOLE_LOG=$JBOSS_BASE_LOG_DIR/$JBOSS_NODE_NAME-console.log JBOSS_GC_LOG=$JBOSS_BASE_LOG_DIR/$JBOSS_NODE_NAME-gc.log JBOSS_BIND_ADDR=0.0.0.0 JBOSS_MANAGEMENT_ADDR=127.0.0.1 JBOSS_CONTROLLER_IP=$JBOSS_MANAGEMENT_ADDR JBOSS_MULTICAST_ADDR=230.0.0.4 JBOSS_JMS_MULTICAST_ADDR=231.7.0.1 JBOSS_MODCLUSTER_MULTICAST_ADDR=224.0.1.105 LAUNCH_JBOSS_IN_BACKGROUND=true STARTUP_WAIT=30 SHUTDOWN_WAIT=30 기본 Node 에서 standalone-ha.xml 파일을복사합니다. cp /app/jboss-as/nodes/node01/configurion/standalone-ha.xml /app/jbossas/nodes/node02/configurion/ 전체 Node 실행 Shell Script JBoss Node 기본디렉토리로이동합니다. cd /app/jboss-as/nodes all-run.sh 전체실행기본스크립트 아래의명령을실행하여전체실행시공통으로 run-all.sh 사용할파일을생성합니다. vi /app/jboss-as/nodes/all-run.sh 아래와같이 Shell Script 작성후저장합니다. /app/jboss-as/nodes/all-run.sh #!/bin/sh if [ "x$1" == "x" ]; then AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 fi exit 0 BAKIFS=$IFS; IFS=','; BASE_NODE_DIR=$(dirname $0) WAIT=3 nodes="node01,node02"; nodearray=($nodes); for ((i=0; i<${#nodearray[@]}; ++i)); do echo ">>> Run Node : ${nodearray[$i]}"; runscript="${base_node_dir}/${nodearray[$i]}/jboss-run.sh $1"; eval $runscript sleep $WAIT done IFS=$BAKIFS; all-start.sh 전체 시작 아래의명령을실행하여전체 Shell 시작Script 파일을생성합니다. vi /app/jboss-as/nodes/all-start.sh 아래와같이 Shell Script 작성후저장합니다. /app/jboss-as/nodes/all-start.sh #!/bin/sh BASE_NODE_DIR=$(dirname $0) $BASE_NODE_DIR/all-run.sh start http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 13/22 JBoss EAP 6.x Standalone Session Clustering all-stop.sh 전체 종료 아래의명령을실행하여전체 Shell 종료Script 파일을생성합니다. vi /app/jboss-as/nodes/all-stop.sh 아래와같이 Shell Script 작성후저장합니다. /app/jboss-as/nodes/all-stop.sh #!/bin/sh BASE_NODE_DIR=$(dirname $0) $BASE_NODE_DIR/all-run.sh stop all-restart.sh 전체 재시작 아래의명령을실행하여전체재시작 Shell Script 파일을생성합니다. vi /app/jboss-as/nodes/all-restart.sh 아래와같이 Shell Script 작성후저장합니다. /app/jboss-as/nodes/all-restart.sh #!/bin/sh BASE_NODE_DIR=$(dirname $0) $BASE_NODE_DIR/all-run.sh restart all-log.sh 콘솔로그전체보기 아래의명령을실행하여콘솔로그전체 Shell 보기Script 파일을생성합니다. vi /app/jboss-as/nodes/all-log.sh 아래와같이 Shell Script 작성후저장합니다. AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 /app/jboss-as/nodes/all-log.sh #!/bin/sh tail -n 50 -f /var/log/jboss-as/node*-console.log 실행권한부여 쉘스크립트에실행권한을부여합니다. chmod 755 /app/jboss-as/nodes/*.sh 소유권변경 아래의명령을실행하여 JBoss 설치관련디렉토리의소유권을변경합니다. chown -R wasadmin:wasadmin /app/jboss-as /app/webapps /var/log/jboss-as Clustering Sample Applicion 생성 Sample Applicion 배포폴더를생성합니다. mkdir -p /app/webapps/deployments/clustering.war/web-inf web.xml web.xml 파일을생성합니다. vi /app/webapps/deployments/clustering.war/web-inf/web.xml web.xml 의설정을다음과같이입력한후저장합니다. <distributable/> : Web Applicion 을 Session Clustering 에참여시킵니다. /app/webapps/deployments/clustering.war/web-inf/web.xml http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 15/22 JBoss EAP 6.x Standalone Session Clustering <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocion="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>jboss Sample Web App</display-name> <welcome-file-list> <welcome-file>/index.jsp</welcome-file> </welcome-file-list> <distributable/> </web-app> jboss-web.xml jboss-web.xml 파일을생성합니다. vi /app/webapps/deployments/clustering.war/web-inf/jboss-web.xml jboss-web.xml 을아래와같이설장한후저장합니다. <context-root> : Context Ph 을지정하는옵션입니다. /app/webapps/deployments/clustering.war/web-inf/jboss-web.xml <?xml version="1.0" encoding="utf-8"?> <jboss-web> <context-root>clustering</context-root> </jboss-web> index.jsp index.jsp 파일을생성합니다. vi /app/webapps/deployments/clustering.war/index.jsp 아래의내용을입력한후저장합니다. AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 /app/webapps/deployments/clustering.war/index.jsp <%@ page session="true" %> <html> <head> <title>session Tracking Test</title> </head> <body> <h1>session Tracking Test</h1> Session tracking with JSP is easy <p> <% // Get the session da value Integer ival = (Integer) session.getvalue ("counter"); if (ival == null) ival = new Integer (1); else ival = new Integer (ival.intvalue() + 1); session.putvalue ("counter", ival); %> <h4>server Name : <%=session.getid().substring(session.getid().indexof(".") + 1) %></h4> You have hit this page <%= ival %> times.<br> <% out.println("your Session ID is " + session.getid() + "<br>"); System.out.println("session=" + session.getid() + ", counter=" + ival); %> </body> </html> 방화벽설정 아래의명령을실행하여방화벽정책파일을편집합니다. vi /etc/sysconfig/iptables 방화벽정책은 JBoss 가구성될네트워크의환경에맞도록수정한저장합니다. /etc/sysconfig/iptables -A INPUT -m ste --ste NEW -m tcp -p tcp --dport 8180 -j ACCEPT -A INPUT -m ste --ste NEW -m tcp -p tcp --dport 8280 -j ACCEPT -A INPUT -m iprange --src-range 192.168.122.21-192.168.122.23 -p tcp -m http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 17/22 JBoss EAP 6.x Standalone Session Clustering tcp --dport 7600 -j ACCEPT -A INPUT -m iprange --src-range 192.168.122.21-192.168.122.23 -p tcp -m tcp --dport 54200 -j ACCEPT -A INPUT -m iprange --src-range 192.168.122.21-192.168.122.23 -p tcp -m tcp --dport 57600 -j ACCEPT -A INPUT -s 230.0.0.4/32 -p udp -m udp --dport 45688 -j ACCEPT -A INPUT -s 230.0.0.4/32 -p udp -m udp --dport 45700 -j ACCEPT -A INPUT -s 224.0.1.105/32 -p udp -m udp --dport 23364 -j ACCEPT -A INPUT -m iprange --src-range 192.168.122.21-192.168.122.23 -p udp -j ACCEPT #-A INPUT -s 192.168.122.0/24 -p udp -j ACCEPT 아래의명령을실행하여방화벽정책을적용합니다. service iptables restart 실행확인 JBoss Cluster Node 실행 아래의명령을실행하여 JBoss Cluster Node 를모두실행합니다. /app/jboss-as/nodes/all-start.sh 정상적으로실행되면아래와같이메시지가출력이됩니다. >>> Run Node : node01 ================================================================== JAVA_HOME=/opt/jdk1.7.0_55 JBOSS_HOME=/app/jboss-as/jboss-eap-6.2 JBOSS_NODE_NAME=node01 JBOSS_NODE_BASE_DIR=/app/jboss-as/nodes JBOSS_CONFIG=standalone-ha.xml JBOSS_BIND_ADDR=0.0.0.0 JBOSS_PORT_OFFSET=100 JBOSS_MULTICAST_ADDR=230.0.0.4 JBOSS_CONTROLLER=127.0.0.1:10099 JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-node01.pid JBOSS_CONSOLE_LOG=/var/log/jboss-as/node01-console.log JBOSS_GC_LOG=/var/log/jboss-as/node01-gc.log ================================================================== Starting jboss-as: [ OK ] >>> Run Node : node02 AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 ================================================================== JAVA_HOME=/opt/jdk1.7.0_55 JBOSS_HOME=/app/jboss-as/jboss-eap-6.2 JBOSS_NODE_NAME=node02 JBOSS_NODE_BASE_DIR=/app/jboss-as/nodes JBOSS_CONFIG=standalone-ha.xml JBOSS_BIND_ADDR=0.0.0.0 JBOSS_PORT_OFFSET=200 JBOSS_MULTICAST_ADDR=230.0.0.4 JBOSS_CONTROLLER=127.0.0.1:10199 JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-node02.pid JBOSS_CONSOLE_LOG=/var/log/jboss-as/node02-console.log JBOSS_GC_LOG=/var/log/jboss-as/node02-gc.log ================================================================== Starting jboss-as: [ OK ] Clustering 동작로그확인 아래의명령을실행하여 node01 서버의로그를출력합니다. tail -n 100 /var/log/jboss-as/node01-console.log 아래와같이Cluster member 개수와하단에 node02 가등록되었다는메시지를확인하실수있습니다. 현재 Cluster member 가 1 개로표시된 node01 것은이처음에실행이되어서현재등록되어있는 Cluster member 가존재하지않기때문입니다. 17:16:06,477 INFO [org.infinispan.factories.globalcomponentregistry] (ServerService Thread Pool -- 53) ISPN000128: Infinispan version: Infinispan 'Delirium' 5.2.7.Final 17:16:06,507 INFO [org.jboss.as.clustering] (MSC service thread 1-3) JBAS010238: Number of cluster members: 1 17:16:06,525 INFO [org.infinispan.factories.transactionmanagerfactory] (ServerService Thread Pool -- 54) ISPN000161: Using a bchmode transaction manager ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17:16:06,972 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:10090/management 17:16:06,973 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:10090 17:16:06,973 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redh-14) started in 7154ms - Started 218 of http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 19/22 JBoss EAP 6.x Standalone Session Clustering 348 services (129 services are passive or on-demand) 17:16:15,553 INFO [org.jboss.as.clustering] (Incoming-1,shared=udp) JBAS010225: New cluster view for partition web (id: 1, delta: 1, merge: false) : [node01/web, node02/web] 17:16:15,553 INFO [org.infinispan.remoting.transport.jgroups.jgroupstransport] (Incoming-1,shared=udp) ISPN000094: Received new cluster view: [node01/web 1] [node01/web, node02/web] 아래의명령을실행하여 node02 서버의로그를출력합니다. tail -n 100 /var/log/jboss-as/node02-console.log node01 이실행되고난후 node02 실행된에서는아래와같이 Cluster member 로등록되었다는메시지가나타나게됩니다. 17:16:15,582 INFO [org.infinispan.remoting.transport.jgroups.jgroupstransport] (ServerService Thread Pool -- 57) ISPN000094: Received new cluster view: [node01/web 1] [node01/web, node02/web] 17:16:15,686 INFO [org.infinispan.remoting.transport.jgroups.jgroupstransport] (ServerService Thread Pool -- 57) ISPN000079: Cache local address is node02/web, physical addresses are [0.0.0.0:55400] 17:16:15,694 INFO [org.infinispan.factories.globalcomponentregistry] (ServerService Thread Pool -- 57) ISPN000128: Infinispan version: Infinispan 'Delirium' 5.2.7.Final 17:16:15,709 INFO [org.jboss.as.clustering] (MSC service thread 1-2) JBAS010238: Number of cluster members: 2 17:16:15,752 INFO [org.infinispan.factories.transactionmanagerfactory] (ServerService Thread Pool -- 53) ISPN000161: Using a bchmode transaction manager 17:16:15,752 INFO [org.infinispan.factories.transactionmanagerfactory] (ServerService Thread Pool -- 54) ISPN000161: Using a bchmode transaction manager 17:16:15,756 INFO [org.infinispan.factories.transactionmanagerfactory] (ServerService Thread Pool -- 55) ISPN000161: Using a bchmode transaction manager Clustering Sample Applicion 확인 브라우저를통하여각노드를직접연결하여확인을. Node01 합니다과 Node02 를번갈아가면서새로고침을했을경우 Page Hit 수가연결되어증가하는지확인합니다. AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 Apache HTTPD Server 연동 Apache HTTPD Server 의연동은 mod_jk, mod_cluster, mod_proxy 등을이용하여할수있습니다. 다음의연동방법중한개를선택하셔서구성하시면됩니다. 연동방법 1 mod_jk JBoss EAP 6.x Apache HTTPD 2.2.x + mod_jk 1.2.x Session Clustering 구성문서를참고합니다. 연동 방법 2 mod_cluster 연동 JBoss EAP 6.x Apache HTTPD 2.2.x + mod_cluster 1.2.x Session Clustering 구성문서를참고합니다. 오류관련 JBAS014612 : java.lang.runtimeexception: java.net.unknowntion: standalone01: standalone01 오류상세메시지 JBoss Node 시작시 console 로그에아래와같은오류메시지출력됩니다. 21:28:41,857 ERROR [org.jboss.as.controller.management-operion] (ServerService Thread Pool -- 50) JBAS014612: Operion ("add") failed - address: ([("subsystem" => "webservices")]): java.lang.runtimeexception: java.net.unknowntion: standalone01: standalone01 org.jboss.as.webservices.dmr.wssubsystemadd.creeserverconfig(wssubsystemad d.java:103) org.jboss.as.webservices.dmr.wssubsystemadd.performboottime(wssubsystemadd.j ava:88) org.jboss.as.controller.abstractboottimeaddstephandler.performruntime(abstra ctboottimeaddstephandler.java:57) [jboss-as-controller-7.3.0.finalredh-14.jar:7.3.0.final-redh-14] org.jboss.as.controller.abstractaddstephandler$1.execute(abstractaddstephand ler.java:76) [jboss-as-controller-7.3.0.final-redh-14.jar:7.3.0.finalredh-14] http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34
2019/07/10 05:34 21/22 JBoss EAP 6.x Standalone Session Clustering org.jboss.as.controller.abstractoperioncontext.executestep(abstractoperi oncontext.java:607) [jboss-as-controller-7.3.0.finalredh-14.jar:7.3.0.final-redh-14] org.jboss.as.controller.abstractoperioncontext.docompletestep(abstractoper ioncontext.java:485) [jboss-as-controller-7.3.0.finalredh-14.jar:7.3.0.final-redh-14] org.jboss.as.controller.abstractoperioncontext.completestepinternal(abstra ctoperioncontext.java:282) [jboss-as-controller-7.3.0.finalredh-14.jar:7.3.0.final-redh-14] org.jboss.as.controller.abstractoperioncontext.executeoperion(abstractop erioncontext.java:277) [jboss-as-controller-7.3.0.finalredh-14.jar:7.3.0.final-redh-14] org.jboss.as.controller.parallelbootoperionstephandler$parallelboottask.ru n(parallelbootoperionstephandler.java:343) [jboss-ascontroller-7.3.0.final-redh-14.jar:7.3.0.final-redh-14] java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:11 45) [rt.jar:1.7.0_55] java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:6 15) [rt.jar:1.7.0_55] java.lang.thread.run(thread.java:745) [rt.jar:1.7.0_55] org.jboss.threads.jbossthread.run(jbossthread.java:122) [jbossthreads-2.1.1.final-redh-1.jar:2.1.1.final-redh-1] Caused by: java.net.unknownhostexception: standalone01: standalone01 java.net.inetaddress.getlocalhost(inetaddress.java:1473) [rt.jar:1.7.0_55] org.jboss.ws.common.management.abstractserverconfig.setwebservicehost(abstra ctserverconfig.java:111) org.jboss.as.webservices.dmr.wssubsystemadd.creeserverconfig(wssubsystemad d.java:101)... 12 more Caused by: java.net.unknownhostexception: standalone01 java.net.inet4addressimpl.lookupallhostaddr(nive Method) [rt.jar:1.7.0_55] java.net.inetaddress$1.lookupallhostaddr(inetaddress.java:901) [rt.jar:1.7.0_55] java.net.inetaddress.getaddressesfromnameservice(inetaddress.java:1293) [rt.jar:1.7.0_55] java.net.inetaddress.getlocalhost(inetaddress.java:1469) [rt.jar:1.7.0_55]... 14 more AllThLinux! - http://allthlinux.com/dokuwiki/
Last upde: jboss_eap_6.x_standalone_session_clustering http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering 2016/05/20 14:12 원인 JBoss 시작시오류에찍힌호스트명 (standalone01) 을인식하지못하여발생되는문제입니다. hosts 파일에해당호스트명을등록해야합니다. 해결 아래의명령을실행하여 /etc/hosts 파일을편집합니다. vi /etc/hosts 아래와같이해당호스트명을등록한후저장합니다. /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.0.11 standalone01 # 해당서버의아이피 JBoss Server 을재실행합니다. From: http://allthlinux.com/dokuwiki/ - AllThLinux! Permanent link: http://allthlinux.com/dokuwiki/doku.php?id=jboss_eap_6.x_standalone_session_clustering Last upde: 2016/05/20 14:12 http://allthlinux.com/dokuwiki/ Printed on 2019/07/10 05:34