1.約定:shell
根據bindings-jboss-beans的規則,ports-default配置是在7101基礎上+100即,所對應的Naming Service,Remote classloading service,Remoting Connector,RMI/JRMP,HA Pooled invoker等,都會自適應+100;若是是ports-02就會加200,依此類推。數據庫
這裏以新增部署 fenxiaopromotion jboss容器爲例vim
2.先到 /data/jboss/serverbash
cp -r default fenxiaopromotionapp
注意:default 正確的包大小必定是 26875(精確到字節),若是發現大小不一致請從其餘jboss機器拷貝default包dom
3.vim /data/jboss/server/fenxiaopromotion/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xmlide
修改26行 增長 <inject bean="Ports04Bindings"/>svn
<!-- The binding sets -->spa
<parameter>rest
<set>
<inject bean="PortsDefaultBindings"/>
<inject bean="Ports01Bindings"/>
<inject bean="Ports02Bindings"/>
<inject bean="Ports03Bindings"/>
<inject bean="Ports04Bindings"/>
</set>
</parameter>
在第100行的地方增長
<!-- The ports-04 binding are obtained by taking ports-default and adding 400 to each port value -->
<bean name="Ports04Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
<constructor>
<parameter>ports-04</parameter>
<!-- the name of the set -->
<!-- Default host name -->
<parameter>${jboss.bind.address}</parameter>
<parameter>400</parameter>
<!-- Set of bindings to which the "offset by X" approach can't be applied -->
<parameter><null/></parameter>
</constructor>
</bean>
4.複製重啓腳本並重命名
jboss_fenxiaopromotion_restart.sh
#/bin/bash
~/shell/jbosskill.sh fenxiaopromotion 172.24.144.86 7501
增長domain ip 端口
vim ~/shell/jbosskill.sh 增長7501的判斷
if [ "$port" = "7201" ];
then
sh ${JBOSS_HOME}/bin/run.sh -b ${DOMAIN_IP} -c ${DOMAIN_NAME} -Djboss.service.binding.set=ports-01 2>&1 | /usr/sbin/rotatelogs2 ${JBOSS_REDIRECT_LOG}.%Y%m%d 86400 480 &
elif [ "$port" = "7301" ];
then
sh ${JBOSS_HOME}/bin/run.sh -b ${DOMAIN_IP} -c ${DOMAIN_NAME} -Djboss.service.binding.set=ports-02 2>&1 | /usr/sbin/rotatelogs2 ${JBOSS_REDIRECT_LOG}.%Y%m%d 86400 480 &
elif [ "$port" = "7401" ];
then
sh ${JBOSS_HOME}/bin/run.sh -b ${DOMAIN_IP} -c ${DOMAIN_NAME} -Djboss.service.binding.set=ports-03 2>&1 | /usr/sbin/rotatelogs2 ${JBOSS_REDIRECT_LOG}.%Y%m%d 86400 480 &
elif [ "$port" = "7501" ];
then
sh ${JBOSS_HOME}/bin/run.sh -b ${DOMAIN_IP} -c ${DOMAIN_NAME} -Djboss.service.binding.set=ports-04 2>&1 | /usr/sbin/rotatelogs2 ${JBOSS_REDIRECT_LOG}.%Y%m%d 86400 480 &
elif [ "$port" = "7601" ];
then
sh ${JBOSS_HOME}/bin/run.sh -b ${DOMAIN_IP} -c ${DOMAIN_NAME} -Djboss.service.binding.set=ports-05 2>&1 | /usr/sbin/rotatelogs2 ${JBOSS_REDIRECT_LOG}.%Y%m%d 86400 480 &
else
sh ${JBOSS_HOME}/bin/run.sh -b ${DOMAIN_IP} -c ${DOMAIN_NAME} 2>&1 | /usr/sbin/rotatelogs2 ${JBOSS_REDIRECT_LOG}.%Y%m%d 86400 480 &
fi
fi
重啓看下nestat -tnlap | grep 7501 是否已經啓動
5.數據源文件以ds.xml結尾
因爲數據源是鏈接數據庫的因此會涉及到數據庫的帳戶和密碼的問題的,因此這部分開發會先發郵件給專門負責人員來操做.
6.部署應用
部署應用仍是和走平時的發佈流程,打包和發佈,若是碰到很緊急的狀況下沒有把新增的模塊加入到發佈腳本里,那就只需手動打包和發佈
大概步驟:
svn co ....
mvn clan package -Denv=xxx -Dversion=xxxx
...
cd target
scp ...上傳到/data/jboss/server/fenxiaopromotion/deploy 下就能夠了