2012年11月21日 星期三

JBoss EAP 5 Multi Apps Services

說明 JBoss EAP 5.0 新增 Nodes,新增的 JBoss Nodes 執行於不同的 JVM。


準備執行環境

主要為JBoss EAP 5.0,預設 Server 已配置這裡不再贅述
  • JDK (Java Development Kit) version 1.6
  • JBoss Enterprise Application Platform 5.0



JBoss Server Configuration

  1. 設定系統變數JBOSS_HOME。

  2. 複製%JBOSS_HOME%\server\all,並改名為%JBOSS_HOME%\server\appService

  3. 修改新增的Application Port,之前會用修改 %JBOSS_HOME%\server\appService\deploy\jbossweb.sar\server.xml 的方式;現在改用修改%JBOSS_HOME%\server\appService\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml,如下修改line-24ports-default 改為 ports-01,修改後%JBOSS_HOME%\server\appService Appliaction 所有的Port將推移100,如8080 -> 8180、8009 -> 8109以此類推。
  4. <!-- Provides management tools with a ProfileService ManagementView 
            interface to the SBM and its components -->
       <bean name="ServiceBindingManagementObject" 
             class="org.jboss.services.binding.managed.ServiceBindingManagementObject">
             
          <constructor>
             <!-- The name of the set of bindings to use for this server -->
             <parameter>${jboss.service.binding.set:ports-01}</parameter>
              
             <!--  The binding sets -->
             <parameter>
                <set>
                   <inject bean="PortsDefaultBindings"/>
                   <inject bean="Ports01Bindings"/>
                   <inject bean="Ports02Bindings"/>
                   <inject bean="Ports03Bindings"/>
                </set>
             </parameter>
             
             <!-- Base binding metadata that is used to create bindings for each set -->
             <parameter><inject bean="StandardBindings"/></parameter>
             
          </constructor>
       </bean>
    


    ports-01設定如下,line-61、65都可修改,Port推移100就是這邊的設定:
    <!-- The ports-01 bindings are obtained by taking the base bindings and adding 100 to each port value -->
       <bean name="Ports01Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
          <constructor>
             <!--  The name of the set -->
             <parameter>ports-01</parameter>
             <!-- Default host name -->
             <parameter>${jboss.bind.address}</parameter>
             <!-- The port offset -->
             <parameter>100</parameter>
             <!-- Set of bindings to which the "offset by X" approach can't be applied -->
             <parameter><null/></parameter>
          </constructor>
       </bean>
    
    


  5. %JBOSS_HOME%下建立目錄,目錄結構為%JBOSS_HOME%\appService\bin,並將%JBOSS_HOME%\bin下所有檔案複製到%JBOSS_HOME%\appService\bin%JBOSS_HOME%\appService\bin\run.bat更名為runAppService.bat接著如下修改line-136

  6. org.jboss.Main -c appService %*


  7. 接下來修改%JBOSS_HOME%\server\appService Appliaction 的console配置,將%JBOSS_HOME%\server\default\conf\props\路徑下的web-console-roles.propertiesweb-console-users.properties,這二個檔案複製到%JBOSS_HOME%\server\appService\conf\props\;接著修改此路徑下的jmx-console-users.propertiesweb-console-users.properties只要將第2行開頭的#拿掉即可。


  8. 設定UsersRolesLoginModule的路徑,如下修改%JBOSS_HOME%\server\appService\conf\login-config.xml ,於web-console加上props路徑即可。
  9. <!-- A template configuration for the web-console web application. This
        defaults to the UsersRolesLoginModule the same as other and should be
        changed to a stronger authentication mechanism as required.
      -->
      <application-policy name="web-console">
        <authentication>
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
            flag="required">
            <module-option name="usersProperties">props/web-console-users.properties</module-option>
            <module-option name="rolesProperties">props/web-console-roles.properties</module-option>
          </login-module>
        </authentication>
      </application-policy>
    


  10. 開啟DOS視窗,切換到路徑%JBOSS_HOME%\appService\bin執行runAppService.bat


  11. 開啟Borwser執行以下連結,帳/密輸入 admin/admin。

  12. http://127.0.0.1:8180/web-console/



相關設定可參考:
Jboss5.1+Multi-Apps_Services
JBOSS5配置


沒有留言:

張貼留言