본문 바로가기

WAS - JBoss,WildFly/각종 설정

[JBoss_WildFly] Application Deploy (Standalone & Domain Mode)

참고 글

(레드헷 JBoss 문서)

https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html/configuration_guide/deploying_applications#deploy_app_managed_domain_cli

 

(관련 블로그 글)

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"