참고 글
(레드헷 JBoss 문서)
(관련 블로그 글)
https://chanchan-father.tistory.com/773
https://fliedcat.tistory.com/10
exploded 모드 deploy
archived 모드에서는 hot deploy가 동작하지 않는다.
exploded 모드를 (디렉토리 형태로 deploy) 사용하는 것이 편리하다.
deploy 대상 디렉토리 이름은 자유롭게 설정 가능하다.
다만 JBoss 상에 deploy 할 시에 RUNTIME_NAME 항목에 war 확장자를 반드시 붙여주어야 한다.
Standalone Mode
deploy.sh
#JAVA_HOME
export JAVA_HOME=/usr/jdk/jdk1.8.0_202
#---------------------------------------------------------------------------
#server_properties
JBOSS_HOME=/app/jboss/jboss-eap-7.4
IP_ADDRESS=1.1.1.1
MANAGEMENT_PORT=7000
#---------------------------------------------------------------------------
#application_properties
APPLICATION_DIRECTORY=/appsource/was/jboss
APP_NAME=ROOT
RUNTIME_NAME=ROOT.war
#---------------------------------------------------------------------------
#deploy_and_enable
#exploded
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment deploy-file $APPLICATION_DIRECTORY --unmanaged --name=$APP_NAME --runtime-name=$RUNTIME_NAME"
#archived
#$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment deploy-file /appsource/test/test.war --name=$APP_NAME --runtime-name=$RUNTIME_NAME"
undeploy.sh
#JAVA_HOME
export JAVA_HOME=/usr/jdk/jdk1.8.0_202
#---------------------------------------------------------------------------
#server_properties
JBOSS_HOME=/app/jboss/jboss-eap-7.4
IP_ADDRESS=1.1.1.1
MANAGEMENT_PORT=9100
#---------------------------------------------------------------------------
#application_properties
APP_NAME=ROOT
#---------------------------------------------------------------------------
#deploy_and_enable
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment undeploy $APP_NAME"
deployment_status.sh (deployment 상태 확인)
#JAVA_HOME
export JAVA_HOME=/usr/jdk/jdk1.8.0_202
#---------------------------------------------------------------------------
#server_properties
JBOSS_HOME=/app/jboss/jboss-eap-7.4
IP_ADDRESS=1.1.1.1
MANAGEMENT_PORT=9100
#---------------------------------------------------------------------------
#deploy_and_enable
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment info"
Domain Mode
(주의사항)
하나의 Server Group 에 동일한 Context-root 를 가진 어플리케이션이 동시에 deploy 될 수 없다.
다만, 서로 다른 Server Group 간에는 동일한 Context-root가 존재할 수 있다.
deploy.sh
#java home
export JAVA_HOME=/usr/jdk/jdk1.8/jdk1.8.0_202
#---------------------------------------------------------------------------
#server_properties
JBOSS_HOME=/app/jboss/jboss-eap-7.4
IP_ADDRESS=1.1.1.1
MANAGEMENT_PORT=7000
#---------------------------------------------------------------------------
#application_properties
APPLICATION_DIRECTORY=/src/wildfly/gtplus_test_source/exploded
APP_NAME=ROOT
RUNTIME_NAME=ROOT.war
GROUP_NAME=D
#---------------------------------------------------------------------------
#deploy_and_enable
#exploded
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment deploy-file $APPLICATION_DIRECTORY --unmanaged --name=$APP_NAME --runtime-name=$RUNTIME_NAME --server-groups=$GROUP_NAME"
#archived
#$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment deploy-file /appsource/test/test.war --name=$APP_NAME --runtime-name=$RUNTIME_NAME --server-groups=$GROUP_NAME"
undeploy.sh
#java home
export JAVA_HOME=/usr/jdk/jdk1.8/jdk1.8.0_202
#---------------------------------------------------------------------------
#server_properties
JBOSS_HOME=/app/jboss/jboss-eap-7.4
IP_ADDRESS=1.1.1.1
MANAGEMENT_PORT=7000
#---------------------------------------------------------------------------
#application_properties
APP_NAME=ROOT
#---------------------------------------------------------------------------
#deploy_and_enable
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment undeploy $APP_NAME --all-relevant-server-groups"
deployment_status.sh (deployment 상태 확인)
#JAVA_HOME
export JAVA_HOME=/usr/jdk/jdk1.8.0_202
#---------------------------------------------------------------------------
#server_properties
JBOSS_HOME=/app/jboss/jboss-eap-7.4
IP_ADDRESS=1.1.1.1
MANAGEMENT_PORT=9100
SERVER_GROUP=TEST_GROUP
#---------------------------------------------------------------------------
#deploy_and_enable
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$IP_ADDRESS:$MANAGEMENT_PORT --command="deployment info --server-group=$SERVER_GROUP"
'WAS - JBoss,WildFly > 각종 설정' 카테고리의 다른 글
[JBoss_WildFly] Domain mode를 사용하지 말아야 하는 이유 (0) | 2023.04.09 |
---|---|
[JBoss/WildFly] 불필요한 포트 없애기 (iiop, modcluster) (0) | 2023.03.21 |
[JBoss_WildFly] Proxy Address Forwarding 옵션 (0) | 2023.03.09 |
[JBoss_WildFly] 보안취약점 진단 & 성능 진단 튜닝 예시 (0) | 2023.02.27 |
[JBoss_WildFly] 데이터소스 - DB 접속 계정 password 암호화 (JBoss7.4.7버전) (0) | 2022.12.21 |