jboss_eap_general_configuration_script

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
jboss_eap_general_configuration_script [2020/02/27 13:59]
koov [add-user.sh]
jboss_eap_general_configuration_script [2020/02/27 14:07] (현재)
koov
줄 6: 줄 6:
 <code vim add-user.sh>​ <code vim add-user.sh>​
 #!/bin/sh #!/bin/sh
 +##############################################​
 +# instance ​   : template
 +# description : add-user script
 +# date        : 2014-10-07
 +# author ​     : kwlee2@linuxdata.co.kr
 +##############################################​
 ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)" ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
 PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​ PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​
줄 20: 줄 26:
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
 +
 +===== heapdump.sh =====
 +<WRAP prewrap>
 +<code vim heapdump.sh>​
 +#!/bin/sh
 +##############################################​
 +# instance ​   : template
 +# description : heapdump script
 +# date        : 2014-10-07
 +# author ​     : kwlee2@linuxdata.co.kr
 +##############################################​
 +ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
 +PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir
 +#​DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ #​ root dir
 +
 +. $ABSOLUTE_PATH/​jboss.env
 +
 +PID=`ps -ef | grep java | grep "​NODE_NAME=$NODE_NAME"​ | grep "​jboss.server.base.dir=$SERVER_BASE_DIR"​ | awk '​{print $2}'`
 +echo "​PID:​$PID"​
 +
 +if [ "​$PID"​ == ""​ ]
 +then
 +    echo "​$NODE_NAME is not running";​
 +    exit 1;
 +fi
 +
 +echo "jmap -dump:​live,​format=b,​file=$PID-heapdump-$DATE.bin $PID"
 +jmap -dump:​live,​format=b,​file=$PID-heapdump-$DATE.bin $PID
 +# EOF
 +</​code>​
 +</​WRAP>​
 +
  
 ===== jboss.env ===== ===== jboss.env =====
줄 33: 줄 72:
 UNAME=`id -u -n` UNAME=`id -u -n`
  
-JBOSS_USER="​root+JBOSS_USER="​jboss
-NODE_NAME="​node11"+NODE_NAME="​sample"
  
 ##################################################​ ##################################################​
 # JBOSS Common Setup # JBOSS Common Setup
 ##################################################​ ##################################################​
-JBOSS_HOME="/​software/jboss7"+JBOSS_HOME="/​app/jboss"
  
 SERVER_HOME="​$JBOSS_HOME/​SERVERS"​ SERVER_HOME="​$JBOSS_HOME/​SERVERS"​
 SERVER_BASE_DIR="​$SERVER_HOME/​$NODE_NAME"​ SERVER_BASE_DIR="​$SERVER_HOME/​$NODE_NAME"​
 +SERVER_BIN_DIR="​$SERVER_BASE_DIR/​bin"​
  
 LOG_HOME="​$SERVER_BASE_DIR/​logs"​ LOG_HOME="​$SERVER_BASE_DIR/​logs"​
  
-BIND_ADDR="​192.168.0.73+BIND_ADDR="​192.168.0.71
-MGNT_ADDR="​192.168.0.73+MGNT_ADDR="​192.168.0.71
-PRIVATE_ADDR="​192.168.0.73"+PRIVATE_ADDR="​192.168.0.71"
 UNSECURE_ADDR="​127.0.0.1"​ UNSECURE_ADDR="​127.0.0.1"​
  
줄 73: 줄 113:
 # Configration File # Configration File
 ##################################################​ ##################################################​
-SERVER_CONFIG_FILE="​standalone-full-ha.xml"​+SERVER_CONFIG_FILE="​standalone-ha.xml"​
  
 ##################################################​ ##################################################​
줄 141: 줄 181:
  JAVA_OPTS="​$JAVA_OPTS -XX:​PermSize=256M"​  JAVA_OPTS="​$JAVA_OPTS -XX:​PermSize=256M"​
  JAVA_OPTS="​$JAVA_OPTS -XX:​MaxPermSize=256M"​  JAVA_OPTS="​$JAVA_OPTS -XX:​MaxPermSize=256M"​
 + JAVA_OPTS="​$JAVA_OPTS -Djava.security.egd=file:/​dev/​./​urandom"​
 fi fi
  
줄 213: 줄 254:
 echo "​HOST_ADDR=$HOST_ADDR"​ echo "​HOST_ADDR=$HOST_ADDR"​
 echo "​SERVER_CONFIG_FILE=$SERVER_CONFIG_FILE"​ echo "​SERVER_CONFIG_FILE=$SERVER_CONFIG_FILE"​
 +echo "​JAVA_VER=$JAVA_VER"​
 echo "​JAVA_OPTS=$JAVA_OPTS"​ echo "​JAVA_OPTS=$JAVA_OPTS"​
 echo "​LD_LIBRARY_PATH=$LD_LIBRARY_PATH"​ echo "​LD_LIBRARY_PATH=$LD_LIBRARY_PATH"​
줄 218: 줄 260:
  
 # EOF # EOF
 +
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
줄 232: 줄 275:
 org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING=true org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING=true
 org.hornetq.core.message.impl.HDR_DUPLICATE_DETECTION_ID=$NODE_NAME org.hornetq.core.message.impl.HDR_DUPLICATE_DETECTION_ID=$NODE_NAME
 +# Cluster Property
 +jvmRoute=$NODE_NAME
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
줄 249: 줄 294:
 ##############################################​ ##############################################​
 ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)" ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
-DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​+PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​ 
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir 
 +#DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ # root dir
  
 . $ABSOLUTE_PATH/​jboss.env . $ABSOLUTE_PATH/​jboss.env
줄 262: 줄 309:
 echo "​$JBOSS_HOME/​bin/​jboss-cli.sh ​ --controller=$MGNT_ADDR:​$((MGNT_HTTP_PORT + PORT_OFFSET)) --connect $@" echo "​$JBOSS_HOME/​bin/​jboss-cli.sh ​ --controller=$MGNT_ADDR:​$((MGNT_HTTP_PORT + PORT_OFFSET)) --connect $@"
 $JBOSS_HOME/​bin/​jboss-cli.sh ​ --controller=$MGNT_ADDR:​$((MGNT_HTTP_PORT + PORT_OFFSET)) --connect $@ $JBOSS_HOME/​bin/​jboss-cli.sh ​ --controller=$MGNT_ADDR:​$((MGNT_HTTP_PORT + PORT_OFFSET)) --connect $@
 +
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
  
 +===== jstat.sh =====
 +<WRAP prewrap>
 +<code vim jstat.sh>​
 +#!/bin/sh
 +##############################################​
 +# instance ​   : template
 +# description : jvm status script
 +# date        : 2014-10-07
 +# author ​     : kwlee2@linuxdata.co.kr
 +##############################################​
 +ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
 +PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir
 +#​DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ #​ root dir
 +
 +. $ABSOLUTE_PATH/​jboss.env
 +
 +INTERVAL=${1:​-1}
 +
 +PID=`ps -ef | grep java | grep "​NODE_NAME=$NODE_NAME"​ | grep "​jboss.server.base.dir=$SERVER_BASE_DIR"​ | awk '​{print $2}'`
 +echo "​PID:​$PID"​
 +
 +if [ "​$PID"​ == ""​ ]
 +then
 +    echo "​$NODE_NAME is not running";​
 +    exit 1;
 +fi
 +
 +echo "jstat -gc $PID $((INTERVAL*1000))"​
 +jstat -gc $PID $(($INTERVAL*1000))
 +# EOF
 +</​code>​
 +</​WRAP>​
  
 ===== kill.sh ===== ===== kill.sh =====
줄 278: 줄 359:
 ##############################################​ ##############################################​
 ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)" ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
-DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​+PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​ 
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir 
 +#DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ # root dir
  
 . $ABSOLUTE_PATH/​jboss.env . $ABSOLUTE_PATH/​jboss.env
줄 296: 줄 379:
 echo "​Killing down SERVER $NODE_NAME..."​ echo "​Killing down SERVER $NODE_NAME..."​
 sleep 10 sleep 10
 +
 +</​code>​
 +</​WRAP>​
 +
 +===== multicast_receive.sh =====
 +<WRAP prewrap>
 +<code vim multicast_receive.sh>​
 +#!/bin/sh
 +##############################################​
 +# instance ​   : template
 +# description : jvm status script
 +# date        : 2014-10-07
 +# author ​     : kwlee2@linuxdata.co.kr
 +##############################################​
 +ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
 +PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir
 +#​DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ #​ root dir
 +
 +. $ABSOLUTE_PATH/​jboss.env
 +
 +java -cp $JBOSS_HOME/​bin/​client/​jboss-client.jar org.jgroups.tests.McastSenderTest -mcast_addr $MULTICAST_ADDR -port 5555
 +# EOF
 +</​code>​
 +</​WRAP>​
 +
 +===== multicast_receive.sh =====
 +<WRAP prewrap>
 +<code vim multicast_send.sh>​
 +#!/bin/sh
 +##############################################​
 +# instance ​   : template
 +# description : jvm status script
 +# date        : 2014-10-07
 +# author ​     : kwlee2@linuxdata.co.kr
 +##############################################​
 +ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
 +PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir
 +#​DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ #​ root dir
 +
 +. $ABSOLUTE_PATH/​jboss.env
 +
 +java -cp $JBOSS_HOME/​bin/​client/​jboss-client.jar org.jgroups.tests.McastReceiverTest -mcast_addr $MULTICAST_ADDR -port 5555
 +# EOF
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
줄 311: 줄 439:
 ##############################################​ ##############################################​
 ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)" ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
-DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​+PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​ 
 +DIR_NAME="​${PROFILE_PATH##​*/​}" ​ # bin dir 
 +#DIR_NAME="​${ABSOLUTE_PATH##​*/​}" ​       # root dir 
 + 
 +. $ABSOLUTE_PATH/​jboss.env 
 + 
 +PID=`ps -ef | grep java | grep "​NODE_NAME=$NODE_NAME " | awk '​{print $2}'​` 
 +echo "​PID:​$PID"​ 
 + 
 +if [ "​$PID"​ == ""​ ] 
 +then 
 +    echo "JBoss SERVER - [$NODE_NAME] is NOT RUNNING..."​ 
 +    exit 1; 
 +fi 
 + 
 +#echo -n "​Account:"​ 
 +#read USERNAME 
 +#echo -n "​Password:"​ 
 +#read -s PASSWORD 
 +#echo ""​ 
 + 
 +if [ "​$PORT_OFFSET"​ != ""​ ] 
 +then 
 + MGNT_HTTP_PORT=$(( $MGNT_HTTP_PORT + $PORT_OFFSET )) 
 +fi 
 + 
 +if [ "​$MGNT_ADDR"​ == "​0.0.0.0"​ ] 
 +then 
 + MGNT_ADDR="​127.0.0.1"​ 
 +fi 
 + 
 +echo "​$JBOSS_HOME/​bin/​jboss-cli.sh --connect --controller=$MGNT_ADDR:​$MGNT_HTTP_PORT --command=shutdown"​ 
 +$JBOSS_HOME/​bin/​jboss-cli.sh --connect --controller=$MGNT_ADDR:​$MGNT_HTTP_PORT --command=shutdown 
 + 
 +if [ $? != 0 ] 
 +then 
 +        exit 1 
 +fi 
 + 
 +echo "​Server $NODE_NAME Shutting Down..."​ 
 +while true 
 +do 
 +PID=`ps -ef | grep java | grep "​NODE_NAME=$NODE_NAME " | awk '​{print $2}'​` 
 +echo "​PID:​$PID"​ 
 + 
 +        if [ "​$PID"​ == ""​ ] 
 +        then 
 + echo "​Shutdown complete"​ 
 +                break 
 +        fi 
 +        sleep 2 
 +done 
 +echo "​Done."​ 
 + 
 +</​code>​ 
 +</​WRAP>​ 
 + 
 +===== shutdown_pw.sh ===== 
 + 
 +<WRAP prewrap>​ 
 +<code vim shutdown_pw.sh>​ 
 +#!/bin/sh 
 +##############################################​ 
 +# instance ​   : template 
 +# description : instance start script 
 +# date        : 2014-10-07 
 +# author ​     : kwlee2@linuxdata.co.kr 
 +##############################################​ 
 +ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)" 
 +PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​ 
 +DIR_NAME="​${PROFILE_PATH##​*/​}" ​ # bin dir 
 +#​DIR_NAME="​${ABSOLUTE_PATH##​*/​}" ​       # root dir
  
 . $ABSOLUTE_PATH/​jboss.env . $ABSOLUTE_PATH/​jboss.env
줄 363: 줄 562:
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
 +
  
 ===== start.sh ===== ===== start.sh =====
줄 376: 줄 576:
 ##############################################​ ##############################################​
 ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)" ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
-DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​+PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​ 
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir 
 +#DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ # root dir
  
 . $ABSOLUTE_PATH/​jboss.env . $ABSOLUTE_PATH/​jboss.env
줄 399: 줄 601:
 then then
  echo -e "​\e[33mWARNING\e[0m : \e[32mDIRECTORY and NODE_NAME are not same\e[0m"​  echo -e "​\e[33mWARNING\e[0m : \e[32mDIRECTORY and NODE_NAME are not same\e[0m"​
 + echo -e "​ABSOLUTE_PATH=$ABSOLUTE_PATH"​
 + echo -e "​PROFILE_PATH=$PROFILE_PATH"​
 + echo -e "​DIR_NAME=$DIR_NAME"​
 + echo -e "​NODE_NAME=$NODE_NAME"​
  echo -e "​\e[33mWARNING\e[0m : Program Exit."  echo -e "​\e[33mWARNING\e[0m : Program Exit."
  exit 2  exit 2
줄 419: 줄 625:
 fi fi
  
-nohup $JBOSS_HOME/​bin/​standalone.sh -P=$SERVER_BASE_DIR/​jboss.properties >> $LOG_HOME/​jboss_console.log 2>&1 &+nohup $JBOSS_HOME/​bin/​standalone.sh -P=$SERVER_BIN_DIR/​jboss.properties >> $LOG_HOME/​jboss_console.log 2>&1 &
  
 exit 0 exit 0
 # EOF # EOF
 +
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
 +===== thread_dump.conf =====
  
 +<WRAP prewrap>
 +<code vim thread_dump.conf>​
 +#!/bin/sh
 +##############################################​
 +# instance ​   : template
 +# description : java thread dump script
 +# date        : 2014-10-07
 +# author ​     : kwlee2@linuxdata.co.kr
 +##############################################​
 +ABSOLUTE_PATH="​$(cd $(dirname "​$0"​) && pwd -P)"
 +PROFILE_PATH="​${ABSOLUTE_PATH%/​*}"​
 +DIR_NAME="​${PROFILE_PATH##​*/​}"​ #​ bin dir
 +#​DIR_NAME="​${ABSOLUTE_PATH##​*/​}"​ #​ root dir
 +
 +. $ABSOLUTE_PATH/​jboss.env
 +
 +PID=`ps -ef | grep java | grep "​NODE_NAME=$NODE_NAME"​ | grep "​jboss.server.base.dir=$SERVER_BASE_DIR"​ | awk '​{print $2}'`
 +echo "​PID:​$PID"​
 +
 +if [ "​$PID"​ == ""​ ]
 +then
 +    echo "​$NODE_NAME is not running";​
 +    exit 1;
 +fi
 +
 +for count in {1..5}
 +do
 +    echo "​`date` Thread Dump : $count"​
 +
 +    echo "​jstack -l $PID >> $PID-thread_dump-$DATE-$count.dmp"​
 +    jstack -l $PID >> $PID-thread_dump-$DATE-$count.dmp
 +
 +    echo "sleep 1 sec"
 +    sleep 1
 +done
 +
 +</​code>​
 +</​WRAP>​
  
 ===== sysctl.conf ===== ===== sysctl.conf =====
  • jboss_eap_general_configuration_script.txt
  • 마지막으로 수정됨: 2020/02/27 14:07
  • 저자 koov