[JBoss EAP] JBoss EAP 구성하기
본문 바로가기
IT 이야기/JBoss EAP

[JBoss EAP] JBoss EAP 구성하기

by 찬찬이 아빠 2019. 12. 30.
반응형
  1. 프로그램 다운로드

http://acess.redhat.com 

우선 레드햇에 로그인을 합니다.

다운로드를 클릭해서 다운로드 페이지로 이동합니다.

 

 

JBOSS 개발 및 관리에서 Red Hat JBoss Enterprise Application Platform을 클릭합니다.

 

 

현재 7.3 Bete 버전까지 나와있지만 7.2 정식 버전을 선택해서 Red Hat JBoss Enterprise Application Platform 7.2.0을 다운로드 합니다.

 

 

 

  2. 설치파일 압축해제

 

# unzip jboss-eap-7.2.0.zip -d /JBOSS

 

 

  3. JBoss EAP 엔진 디렉터리에서 standalone 디렉터리 복사

※ 본 구성은 standalone 모드 방식을 설명함

1
2
3
# mkdir /JBOSS/domains
# cd /JBOSS/jboss-eap-7.2
# cp -r standalone /JBOSS/domains/노드명
cs

 

 

 

  4. 필요한 스크립트 파일 생성

 생성한 노드에 /bin 디렉터리를 생성하여 필요한 스크립트 파일을 작성합니다.</p

1
# mkdir /JBOSS/domains/노드명/bin
cs
.

작성된 스크립트 파일에 실행 권한을 설정합니다.

1
# chmod +x *.sh
cs

 

 1) add-user.sh

1
2
3
4
5
#!/bin/sh
 
. ./env.sh
JAVA_OPTS="$JAVA_OPTS -Djboss.server.config.user.dir=$DOMAIN_BASE/$SERVER_NAME/configuration"
$ JBOSS_HOME/bin/add-user.sh $@
cs

 

 2) dump.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
 
. ./env.sh
 
for count in 1 2 3 4 5do
     echo "Thread Dump : $count"
     for i in `ps -ef | grep java | grep "SERVER=$SERVER_NAME " | awk '{print $2}'`; do
     echo "+kill -3 $i"
     kill -3 $i
     echo "sleep 1 sec"
     sleep 1
     done
     sleep 3
done
cs

 

 3) enc-passwd.sh

1
2
3
4
5
6
7
8
9
#!/bin/sh
 
. ./env.sh
 
export CLASSPATH=$JBOSS_HOME/modules/org/picketbox/main/picketbox-4.0.14.Final-redhat-2.jar:$JBOSS_HOME/modules/org/jboss/logging/main/jboss-logging-3.1.2.GA-redhat-1.jar:$CLASSPATH
 
echo "password:$1"
 
java org.picketbox.datasource.security.SecureIdentityLoginModule $1
cs

 

 4) env.properties

1
2
3
4
5
6
7
8
org.apache.catalina.connector.URI_ENCODING=UTF-8                            # 언어 설정
org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING=true
org.apache.coyote.http11.Http11Protocol.MAX_HEADER_SIZE=8192
org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT=60000                        # 연결 시간 설정
org.apache.coyote.http11.DEFAULT_CONNECTION_TIMEOUT=60000
org.apache.tomcat.util.http.Parameters.MAX_COUNT=10000                        # 파라미터 최대 연결 개수 설정
UseJK=true                                                                    # Web 서버 요청 커넥션 유지
#jvmRoute=node10                                                            # 라우팅 노드 지정     
cs

 

 5) env.sh

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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
 
DATE=`date +%Y%m%d%H%M%S`
 
##### JBoss Directory Setup #####
export JBOSS_HOME=/JBOSS/jboss-eap-7.2        # 설치된 JBOSS EAP 버전에 맞는 디렉터리 설정
export JAVA_HOME/usr/lib/jvm/java-1.8.0-openjdk        # 사용하는 JDK 버전에 맞게 설정
export DOMAIN_BASE=/JBOSS/domains                # 도메인 베이스 디렉터리 설정
export SERVER_NAME=node10                            # 생성한 노드명 설정
export HOST_NAME=`hostname`                            # 호스트네임을 서버에 정의된 HOSTNAME으로 자동인식 처리
 
##### Configuration File #####
export CONFIG_FILE=standalone-ha.xml                # 환경 설정 파일 등록
export PORT_OFFSET=0                                # 포트 OFFSET 값 등록
export JBOSS_USER=jboss                                # jboss 유저 등록
 
##### Bind Address #####
export BIND_ADDR=`hostname -i`                        # 시스템에 설정된 etho0의 네트워크 IP 값을 자동으로 인식
export MGMT_ADDR=$BIND_ADDR                            # 관리 주소 등록
export CONTROLLER_IP=$MGMT_ADDR                        # 관리자 IP 등록
# export CONTROLLER_IP=127.0.0.1
let CONTROLLER_PORT=9999+$PORT_OFFSET                # 관리자 포트 값 연산
export CONTROLLER_PORT                                # 관리자 포트 등록
export LAUNCH_JBOSS_IN_BACKGROUND=true
 
# Multicast IP for stndalone-ha.xml #####
##### MIP, change Please #####
export MULTICAST_ADDR=230.20.16.1                    # 멀티 캐스트 ip 설정(같은 클러스터간 동일값)
export JMS_MULTICAST_ADDR=231.20.16.1                # JMS 멀티 캐스트 IP 설정(같은 클러스터간 동일값)
export MODCLUSTER_MULTICAST_ADDR=224.20.16.100
 
export JAVA_OPTS=" $ JAVA_OPTS -Djboss.default.multicast.address=$MULTICAST_ADDR"
export JAVA_OPTS=" $JAVA_OPTS -Djboss.messaging.group.address=$JMS_MULTICAST_ADDR"
export JAVA_OPTS=" $JAVA_OPTS -Djboss.modcluster.multicast.address=$MODCLUSTER_MULTICAST_ADDR"
 
# LOG 디렉터리 위치 설정
export LOG_HOME=/JBOSS/LOG/$SERVER_NAME
#export LOG_HOME=$DOMAIN_BASE/$SERVER_NAME/log
 
# Jboss System module and User module directory #####
export JBOSS_MODULEPATH=$JBOSS_HOME/modules
 
# JVM Options : Server
export JAVA_OPTS="-server $JAVA_OPTS"
 
# JVM Options : Memory
export JAVA_OPTS="$JAVA_OPTS -Xms2048m -Xmx2048m -XX:MaxMetaspaceSize=512m"
 
export JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCTimeStamps"
export JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails"
export JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_HOM/gclog/gc_$DATE.log"
export JAVA_OPTS="$JAVA_OPTS -XX:+UseParallelGC"
#export JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMaskSweepGC"
export JAVA_OPTS="$JAVA_OPTS -XX:+ExplicitGCInvokesConcurrent"
export JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"                            # OOME 발생 시 힘덤프 자동 생성
export JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=$LOG_HOME/gclog/java_pid_$DATE.hprof"        # 힙덤프 파일명에 생성일 추가
 
# 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=$DOMAIN_BASE/$SERVER_NAME"
export JAVA_OPTS="$JAVA_OPTS -Djboss.socket.binding.port-offset=$PORT_OFFSET
export JAVA_OPTS="$JAVA_OPTS -Djboss.node.name=${SERVER_NAME}"
export JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address.management=$MGMT_ADDR"
export JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=$BIND_ADDR
export export JAVA_OPTS="$JAVA_OPTS -Dserver.mode=local"
 
# Use log4j in application
export JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.as.logging.per-deployment=false"
export JAVA_OPTS="$JAVA_OPTS -Djboss.server.log.dir=$LOG_HOME"
 
echo "================================================="
echo "JBOSS_HOME=$JBOSS_HOME"
echo "DOMAIN_BASE=$DOMAIN_BASE"
echo "SERVER_NAME=$SERVER_NAME"
echo "CONFIG_FILE=$CONFIG_FILE"
echo "BIND_ADDR=$BIND_ADDR
echo "PORT_OFFSET=$PORT_OFFSET"
echo "CONTROLLER=$CONTROLLER_IP:$CONTROLLER_PORT"'
echo "jboss.node.name=${SERVER_NAME}"
echo "================================================="
 
#SCOUTER_OPT="-javaagent:/scouter/agent.java_6_7/scouter.agent.jar -Dscouter.config=/scouter/agent.java_6_7/conf/node01.conf"
#export JAVA_OPTS="$JAVA_OPTS$SCOUTER_OPT"
#export JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,scouter"
cs

 

 6) jboss-cli.sh

1
2
3
4
5
6
7
#!/bin/sh
 
. ./env.sh
 
export JAVA_OPTS=" -Djava.awt.headless=false $JAVA_OPTS"
 
$JBOSS_HOME/bin/jboss-cli.sh  --controller=$CONTROLLER_IP:$CONTROLLER_PORT --connect $@
cs

 

 7) jconsole.sh

1
2
3
4
5
6
7
#!/bin/sh
 
. ./env.sh
 
echo "================================================="
echo " JMX URL : service:jmx:remoting-jmx://$MGMT_ADDR:$CONTROLLER_PORT"
echo "================================================="
cs

 

 8) jdr.sh

1
2
3
4
5
#!/bin/sh
 
. ./env.sh
 
$JBOSS_HOME/bin/jdr.sh $@
cs

 

 9) kill.sh

1
2
3
4
5
#!/bin/sh
 
. ./env.sh
 
ps -ef | grep java | grep "SERVER=$SERVER_NAME " | awk {'print "kill -9 " $2'| sh -x
cs

 

 10) shutdown.sh

1
2
3
4
5
6
7
#!/bin/sh
 
. ./env.sh
 
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$CONTROLLER_IP:$CONTROLLER_PORT --command=:shutdown
 
tail -f $LOG_HOME/nohup/$SERVER_NAME.out
cs

 

 11) start.sh

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
#!/bin/sh
 
DATE=`date +%Y%m%d%H%M%S`
 
. ./env.sh
 
PID=`ps -ef | grep java | grep "=$SERVER_NAME" | awk '{print $2}'`
 
echo $PID
 
if [e$PID !="e" ]
then
     echo "JBoss SERVER - $SERVER_NAME is already RUNNING..."
     exit;
fi
 
UNAME=`id --n`
 
if [ e$UNAME != "e$JBOSS_USER" ]
then
     echo "Use $JBOSS_USER account to start JBoss SERVER -$SERVER_NAME..."
     exit;
fi
 
echo $JAVA_OPTS
 
#mv $LOG_HOME/nohup/$SERVER_NAME.out $LOG_HOME/nohup/$SERVER_NAME.out.$DATE
#mv $LOG_HOME/gclog/gc.log $LOG_HOME/gclog/gc.log.$DATE
 
# nohup log 이동 관련 제거, nohup log 파일명에 생성일 추가
nohup $JBOSS_HOME/bin/standalone.sh -DSERVER=$SERVER_NAME -P=$DOMAIN_BASE/$SERVER_NAME/bin/env.properties -c $CONFIG_FILE >> $LOG_HOME/nohup/${SERVER_NAME}_${DATE}.out &
 
#nohup $JBOSS_HOME/bin/standalone.sh -DSERVER=$SERVER_NAME -b $BIND_ADDR -u $MULTICAST_ADDR -P=$DOMAIN_BASE/$SERVER_NAME/env.properties -c $CONFIG_FILE >> $SERVER_NAME.out &
 
if [ e$1 ="enotail" ]
then
     echo "Starting... $SERVER_NAME"
     exit;
fi
 
tail -f $LOG_HOME/server.log    # tail을 nohup 로그에서 server.log로 변경
#tail -f $SERVER_NAME.out
#tail -f $LOG_HOME/nohup/$SERVER_NAME.out
cs

 

 12) status.sh

1
2
3
4
5
#!/bin/sh
 
. ./env.sh
 
ps -ef | grep java | grep "SERVER=$SERVER_NAME"
cs

 

 13) tail.sh

1
2
3
4
5
#!/bin/sh
 
. ./env.sh
 
tail -f $LOG_HOME/server.log
cs

 

 

  5. 관리자 등록
1
2
3
4
5
6
7
8
9
# cd /JBOSS/jboss-eap-7.2/bin
 
#./add-user.sh
 
a) Management User (mgmt-user.properties)
 
b) Application User (application-user.properties)
 
(a) : a 선택 후 진행
cs

 

 

  6. 로그 디렉터리 생성
1
2
3
4
# mkdir /JBOSS/LOG
# mkdir /JBOSS/LOG/노드명
# mkdir /JBOSS/LOG/노드명/gclog
# mkdir /JBOSS/LOG/노드명/nohup
cs

 

 

  7. 보안 취약점 조치

 1) 관리자 콘솔 관리(접속 포트 변경)

1
2
3
4
5
6
7
# vim /JBOSS/domains/노드명/configuration/standalone-ha.xml
 
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
 
 
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9991}"/>
cs

 

 2) JSP 파일 자동 로딩 금지 및 powered-by 출력 금지

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# vim /JBOSS/domains/노드명/configuration/standalone-ha.xml
 
※ JBoss EAP 7.x
<servlet-container name="default">
     <jsp-config x-powered-by="false" development="false" check-interval="60"/>
     <websockets/>
</servlet-container>
 
 
※ JBoss EAP 6.4.x
<subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server"default-host" instance-id="${jboss.node.name}" native="false">
     <configuration>
          <jsp-configuration development="true" check-interval=5" modification-test-interval="5" recompile-on-fail="true" x-powered-by="false"/>
     </configuration>
cs

 

 3) 패스워드 파일 관리

1
2
# cd /JBOSS/domains/노드명/configuration
chmod 640 mgmt-* application-*
cs

 

 4) 설정파일 디렉터리 퍼미션 변경

1
# chmod 700 /JBOSS/domains/노드명/configuration/standalone_xml_history
cs

 

 5) 로깅 디렉터리 및 파일 권한 관리

1
2
3
4
5
6
7
8
9
10
# vim /JBOSS/jboss-eap-7.2/bin/standalone.conf
 
if [ "x$GC_LOG" = "x" ]; then
     GC_LOG="false"
else
     echo "GC_LOG set in environment to $GC_LOG"
fi
 
# find /JBOSS/LOG -type f | xargs chmod 640
# find /JBOSS/LOG -type d | xargs chmod 750
cs

 

 6) 샘플 디렉터리 삭제

1
# rm -rf /JBOSS/jboss-eap-7.2/docs/examples
cs

 

 

  8. 데이터 소스 설정

 1) datasources 검색 후 설정

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
<datasources>
     <datasource jta="false" jndi-name="java:jboss/cubridDS" pool-name="cubrid" enabled="true" use-ccm="false">
          <connection-url>jdbc:cubrid:test-dbms1:33000:DB_NAME:::?charset=utf-8</connection-url>
          <driver-class>cubrid.jdbc.driver.CUBRIDDriver</driver-class>
          <driver>cubrid</driver>
          <pool>
               <min-pool-size>30</min-pool-size>            # DB 최소 연결 개수 설정
               <max-pool-size>100</max-pool-size>            # DB 최대 연결 개수 설정
               <prefill>true</prefill>                        # 최소한의 연결수로 풀을 미리 채울것인지 여부 설정
               <use-strict-min>true</use-strict-min>
          </pool>
          <security>
               <user-name>DB_USER_NAME</user-name>
               <password>DB_PASSWORD</password>
          </security>
          <validation>
               <check-valid-connection-sql>select 1</check-valid-connection-sql>    # Connection 상태 체크를 위한 SQL 명시
               <validate-on-match>true</validate-on-match>                            # 연결 유효성 검사
               <background-validation>false</background-validation>
          </validation>
          <statement>
               <share-prepared-statements>false</share-prepared-statements>
          </statement>
     </datasource>
     <drivers>
          <driver name="cubrid" module="com.cubrid">
               <driver-class>cubrid.jdbc.driver.CUBRIDDriver</driver-class>
           </driver>
     </drivers>
</datasources>
cs

 

 2) Java EEE7 스펙에 의한 default datasource 추가

1
<default-bindings context-service="javaa:jboss/ee/concurrency/context/default" datasource="java:jboss/cubridDS" managed-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
cs

 

 

  9. AP 배포 설정
1
2
3
4
5
6
7
8
9
# vim /JBOSS/domains/노드명/configuration/standalone-ha.xml
 
deployments 로 검색
 
<deployments>
     <deployment name="sample.war" runtime-name="sample.war">
          <fs-exploded path="/WebApp/deploy/sample.war" />
     </deployment>
</deployments>
cs

 

 

  10. CUBRID JDBC 드라이버 설치 및 모듈 생성

 1) DBMS 서버의 JDBC 디렉터리에서 Cubrid JDBC 파일을 FTP로 다운로드

   ex) JDBC-10.1.1.7691-cubrid.jar

 

 2) JBoss EAP 엔진 디렉터리에 cubid 디렉터리 생성

1
2
# mkdir /JBOSS/jboss-eap-7.2/modules/system/layers/base/cubrid
# mkdir /JBOSS/jboss-eap-7.2/modules/system/layers/base/cubrid/main
cs

 

 3) 다운받은 Cubrid JDBC 파일 복사

1
# cp /JDBC-10.1.1.7691-cubrid.jar /JBOSS/jboss-eap-7.2/modules/system/layers/base/cubrid/main
cs

 

 4) Cubrid JDBC 드라이버 모듈 생성

1
2
3
4
5
6
7
8
9
10
11
12
# vim /JBOSS/jboss-eap-7.2/modules/system/layers/base/cubrid/main/module.xml
 
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="cubrid">
     <resources>
          <resource-root path="JDBC-10.1.1.7691-cubrid.jar" />   # JDBC 버전에 맞게 수정
     </resources>
     <dependencies>
          <module name="javax.api"/>
          <module name="javax.transaction.api"/>
     </dependencies>
</module>
cs

 

 

  11. JBoss EAP 실행 및 중지 스크립트 작성

※ 실행 및 중지 스크립트를 만들어서 /home/jboss 디렉터리에 저장

※ chmod +x *.sh 명령어로 실행권한 부여

 

 1) jboss_start.sh

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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
 
JBOSS_DIR=/JBOSS/domains
 
if [ `ls $JBOSS_DIR | wc -l` -eq 1 ]; then
     node_list=`ls -F $JBOSS_DIR | grep / | cut -d/ -f1`
     DATE=`date +%Y%m%d%H%M%S`
     . ${JBOSS_DIR}/${node_list}/bin/env.sh
 
     PID=`ps -ef | grep java | grep "=$SERVER_NAME " | awk '{print $2}'`
     echo $PID
 
     if [ e$PID != "e" ]; then
          echo "JBoss SERVER - $SERVER_NAME is already RUNNING..."
          exit;
     fi
 
     UNAME=`id --n`
 
     if [ e$UNAME != "e$JBOSS_USER" ]; then
          echo "Use $JBOSS_USER account to start JBoss SERVER - $SERVER_NAME..."
          exit;
     fi
 
     echo $JAVA_OPTS
 
     nohup $JBOSS_HOME/bin/standalone.sh -DSERVER=$SERVER_NAME -P=$DOMAIN_BASE/$SERVER_NAME/bin.env.properties -c $CONFIG_FILE >> $LOG_HOME/nohup/${SERVER_NAME}_${DATE}.out &
 
     if [ e$1 = "enotail" ]; then
          echo "Staring... $SERVER_NAME"
          exit;
     fi
 
     tail -f $LOG_HOME/server.log
 
else
     echo -"\nInput JBoss Node Name."
     echo -"Node List : $(ls -F $JBOSS_DIR | grep / | cut -d/ -f1 | grep -v -e '^$' | tr "\n" "\t")\n"
     read -" [ JBoss Node Name ] : " ID
 
     JBOSS_NODE=$JBOSS_DIR/${ID}
 
     if [[ $ID == "" ]]; then
          echo -"\nSpace or Enter is not allowed..."
          echo -"Node List : $(ls -F $JBOSS_DIR | grep / \ cut -d/ -f1 | grep -v -e '^$' | tr "\n" "\t")\n"
          echo -"Return script after node name resolution\n"
          exit;
     elif [ -d $JBOSS_NODE ]; then
          DATE=`date + %Y%m%d%H%M%S`
          . ${JBOSS_NODE}/bin/env.sh
 
          PID=`ps -ef | grep java | grep "=$SERVER_NAME " | awk '{print $2}'`
          echo $PID
 
          if [ e$PID != "e" ]; then
               echo "JBoss SERVER - $SERVER_NAME is already RUNNING..."
               exit;
          fi
 
          UNAME=`id --n`
 
          if [ e$UNAME != "e$JBOSS_USER" ]; then
               echo "Use $JBOSS_USER account to start JBoss SERVER - $SERVER_NAME..."
              exit;
          fi
 
          echo $JAVA_OPTS
          nohup $JBOSS_HOME/bin/standalone.sh -DSERVER=$SERVER_NAME -P=$DOMAIN_BASE/$SERVER_NAME/bin/env.properties-c $CONFIG_FILE >> $LOG_HOME/nohup/${SERVER_NAME}_${DATE}.out &
 
          if [ e$1 = "enotail" ]; then
               echo "Starting... $SERVER_NAME"
               exit;
          fi
          tail -f $LOG_HOME/server.log
     else
          echo -"\nNo Search Node Name : ${ID}"
          echo -"Node List : $(ls -F $JOBSS_DIR | grep / | cut -d/ -f1 | grep -v -e '^$' | tr "\n" "\t")\n"
          echo -"Return script after node name resolution\n"
          exit;
     fi
fi
cs

 

 2) jboss_stop.sh

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
#!/bin/sh
 
JBOSS_DIR=/JBOSS/domains
 
if [ `ls -F $JBOSS_DIR | grep / | wc -l` -eq 1 ]; then
     node_list=`ls -F $JBOSS_DIR | grep / | cut -d/ -f1`
     DATE=`date +%Y%m%d%H%M%S`
     . ${JBOSS_DIR}${node_list}/bin/env.sh
     ps -ef | grep java | grep "${SERVER_NAME}" | awk {'print "kill -9 " $2'| sh -x
else
     echo -"\nInput JBoss Node Name."
     echo -"Node List : $(ls -F $JBOSS_DIR | grep / | cut -d/ -f1 | grep -v -e '^$' | tr "\n" "\t")\n"
     read -"[ JBoss Node Name ] : " ID
 
     JBOSS_NODE=$JBOSS_DIR/${ID}
 
     if [[ $ID == "" ]]; then
          echo -"\nSpace or Enter is not allowed..."
          echo -"Node List : $(ls -F $JBOSS_DIR | grep / | cut -d/ -f1 | grep -v -e '^$' | tr "\n" "\t")\n"
          echo -"Return script after node name resolution\n"
          exit;
     elif [ -d $JBOSS_NODE ]; then
          . ${JBOSS_NODE}/bin/env.sh
          ps -ef | grep java | grep "${SERVER_NAME}" | awk {'print "kill -9 " $2'| sh -x
     else
          echo -"\nNo Search Node Name : ${ID}"
          echo -"Node List : $(ls -F $JBOSS_DIR | grep / | cut -d -f1 | grep -v -e '^$' | tr "\n" "\t")\n"
          echo -"Return script after node name resolution\n"
          exit;
     fi
fi
cs

 

 

  12. JBoss EAP 실행
1
2
# su - jboss
# ./jboss_start.sh
cs

 

 

  참고사항

 

1. WAS 서버에서 AP 접속 하기

1
# links http://test-was1:접속포트(기본 8081+offset 값)으로 접속
cs

 

2. JBoss JGroups 통신에 필요한 OS 파라미터 설정

1
2
3
4
5
6
7
8
9
10
11
# vim /etc/sysctl.conf
 
# Allow a 25MB UDP receive buffer for JGroups
 
net.core.rmem_max = 26214400
net.core.wmem_max = 26214400
 
# sysctl -p    # 즉시 적용
 
# ./jboss_stop.sh
# ./jboss_start.sh
cs
반응형

댓글