WAS 創建Profile 端口設定方法

wasprofile 命令
wasprofile 命令行工具在 V6 中創建所有 Application Server 運行時環境。該命令創建概要文件,即爲 獨立應用程序服務器定義運行時環境的文件集合。
也可以使用概要文件創建工具圖形用戶界面來創建和管理概要文件。
 

--------------------------------------------------------------------------------
相關信息
使用命令行工具
描述 V6 概要文件的術語的簡介
wasprofile 命令在稱爲概要文件的文件集中爲 WebSphere Application Server 進程創建運行時環境。該概要文件定義運行時環境幷包括運行時環境中服務器進程可以更改的所有文件。
概要文件創建工具及其圖形用戶界面概要文件創建嚮導是在 V6 中創建運行時環境的唯一方法。
概要文件創建嚮導是多平臺 InstallShield(ISMP)應用程序。您可以使用嚮導輸入本主題中描述的大多數參數。然而,一些參數需要您使用 wasprofile 命令。例如,您必須使用 wasprofile 命令刪除概要文件,因爲概要文件創建嚮導不提供刪除功能。
然而,概要文件創建嚮導還執行 wasprofile 命令不執行的任務。例如,嚮導可以爲它創建的每個概要文件創建 Windows 服務。它還可以根據以前的 V6 端口指定指定非衝突的端口。
wasprofile 腳本的位置
命令文件位於 app_server_root/bin 目錄。
命令文件是一個腳本,它名爲:
  wasprofile.sh
 wasprofile.bat
概要文件創建嚮導是命令行工具的圖形用戶界面。調用概要文件創建嚮導的命令的文件名隨操作系統平臺改變。請參閱使用圖形用戶界面來創建概要文件 ,以瞭解更多信息。
記錄
wasprofile 命令爲它創建的每個概要文件創建日誌。日誌位於 app_server_root/logs/wasprofile 目錄中。這些文件以此模式命名:profile_name_create.log。
命令還爲它刪除的每個概要文件創建日誌。日誌位於 app_server_root/logs/wasprofile 目錄中。這些文件以此模式命名:profile_name_delete.log。
並行概要文件創建
重要: 對於一組核心產品文件,此時不支持並行概要文件創建。嘗試並行創建概要文件的結果是生成一個警告,說明已經在創建概要文件。
 
在多個行上輸入 lengthy 命令
wasprofile 命令的長度不能超過正常 shell 窗口的一行 256 個字符的限制。如果命令比限制長,那麼在多個行上發出命令並用反斜槓結束行,按 Enter 鍵,並在下一行繼續命令。
例如,在 Solaris 系統上,在多個行上需要輸入以下命令:
./wasprofile.sh /
-create -profileName bladetcb6profile /
-profilePath /usr/IBM/WebSphere/AppServer/profiles/bladetcb6profile /
-templatePath /usr/WebSphere/AppServer/profileTemplates/default /
-nodeName bladetcb6node /
-cellName bladetcb6Cell /
-hostName bladetcb6.rtp.raleigh.ibm.com
從最後一行省略行連續字符以表明操作系統的命令結束。
 
wasprofile.sh 命令語法
獲取該命令的幫助。
# ./wasprofile.sh -help
# ./wasprofile.sh -augment -help
                
# ./wasprofile.sh -create -help
# ./wasprofile.sh -create -templatePath fully_qualified_path/dmgr -help
# ./wasprofile.sh -create -templatePath fully_qualified_path/default -help
# ./wasprofile.sh -create -templatePath fully_qualified_path/managed -help
                
# ./wasprofile.sh -delete -help
                
# ./wasprofile.sh -getName -help
# ./wasprofile.sh -getPath -help
                
# ./wasprofile.sh -unaugment -help
                
# ./wasprofile.sh -validateRegistry -help
# ./wasprofile.sh -validateAndUpdateRegistry -help

列出現有的概要文件:
# ./wasprofile.sh -listProfiles
                 [-debug]
                
刪除概要文件:
# ./wasprofile.sh -delete
                  -profileName profile_name
創建新的概要文件:
# ./wasprofile.sh -create
              -profileName profile_name               -profilePath fully_qualified_profile_path
              -templatePath template_path
              -nodeName node_name
              -cellName cell_name
              -hostName host_name
             [-isDefault]
             [-startingPort starting_port | -portsFile file_path]
             [-debug]
            
從現有概要文件的路徑獲取其名稱:
# ./wasprofile.sh -getName
                 -profilePath profile_path
                [-debug]
               
從現有概要文件的名稱獲取其路徑:
# ./wasprofile.sh -getPath
                 -profileName profile_name                 [-debug]
               
檢查概要文件註冊表的完整性:
# ./wasprofile.sh -validateRegistry
                [-debug]
               
檢查概要文件註冊表的完整性,除去未找到的概要文件:
# ./wasprofile.sh -validateAndUpdateRegistry
                 [-backup file_name]
                 [-debug]
               
使用擴充模板文件更新現有的概要文件:
# ./wasprofile.sh -augment
              -profileName profile_name               -templatePath fully_qualified_template_path
除去概要文件的最新擴充:
# ./wasprofile.sh -unaugment
              -profileName profile_name
 
wasprofile.bat 命令語法
獲取該命令的幫助。
# ./wasprofile.bat -help
# ./wasprofile.bat -augment -help
                
# ./wasprofile.bat -create -help
# ./wasprofile.bat -create -templatePath fully_qualified_path/dmgr -help
# ./wasprofile.bat -create -templatePath fully_qualified_path/default -help
# ./wasprofile.bat -create -templatePath fully_qualified_path/managed -help
                
# ./wasprofile.bat -delete -help
                
# ./wasprofile.bat -getName -help
# ./wasprofile.bat -getPath -help
# ./wasprofile.bat -unaugment -help
                
# ./wasprofile.bat -validateRegistry -help
# ./wasprofile.bat -validateAndUpdateRegistry -help

列出現有的概要文件:
# ./wasprofile.bat -listProfiles
             [-debug]
            
刪除概要文件:
# ./wasprofile.bat -delete
              -profileName profile_name | -profilePath profile_path
             [-debug]
            
創建新的概要文件:
# ./wasprofile.bat -create
              -profileName profile_name               -profilePath fully_qualified_profile_path
              -templatePath template_path
              -nodeName node_name
             [-cellName cell_name]
              -hostName host_name
             [-isDefault]
             [-startingPort starting_port | -portsFile file_path]
             [-winserviceCheck true | false]
             [-winserviceAccountType specified_user | localsystem]
             [-winserviceUserName your_user_name]
             [-winservicePassword your_password]
             [-winserviceStartupType manual | automatic | disabled]
             [-debug]
            
當不使用 -startingPort 參數時,概要文件創建工具使用 serverindex.xml 文件中指定的缺省端口設置。
從現有概要文件的路徑獲取其名稱:
# ./wasprofile.bat -getName
               -profilePath fully_qualified_profile_path
              [-debug]
            
從現有概要文件的名稱獲取其路徑:
# ./wasprofile.bat -getPath
               -profileName profile_name               [-debug]
            
檢查概要文件註冊表的完整性:
# ./wasprofile.bat -validateRegistry
             [-debug]
            
檢查概要文件註冊表的完整性,除去任何未找到的概要文件:
# ./wasprofile.bat -validateAndUpdateRegistry
             [-backup file_name]
             [-debug]
            
使用擴充模板文件更新現有的概要文件:
# ./wasprofile.bat -augment
               -profileName profile_name                -templatePath fully_qualified_template_path
除去概要文件的最新擴充:
# ./wasprofile.bat -unaugment
               -profileName profile_name
要獲取創建概要文件的特定示例,請參閱示例:使用命令來創建概要文件一節。
參數
支持的參數包括:
-augment
使用 augment 參數以通過擴充模板對現有概要文件進行更改。augment 參數導致 wasprofile 使用 templatePath 參數中的模板更新或擴充在 profileName 參數中標識的概要文件。您可以使用哪些擴充模板取決於您的環境中安裝的 IBM 產品及其版本。
注:隨 WebSphere Application Server 附帶的模板只能用於創建概要文件,不能用於擴充現有的概要文件。此外,不要手動修改 install_dir/ profileTemplates 目錄中的文件。例如,如果要在創建概要文件期間修改端口,那麼使用“概要文件創建”嚮導,或對 wasprofile 命令使用 -startingPort 或 -portsFile 參數,而不要修改概要文件模板目錄中的文件。
當調用擴充操作時,wasprofile 命令嘗試訪問指定的模板路徑中的 actionRegistry.xml 文件。然後對指定的概要文件應用在操作註冊表文件中的 Config Actions 節中定義的操作。
請對 -templatePath 指定標準文件路徑。對 -templatePath 參數指定相對文件路徑會導致不能充分擴充指定的概要文件。
另請參閱 unaugment 參數。
-cellname cell_name
指定概要文件的單元名。請對每個概要文件使用唯一單元名。
這是 WebSphere Application Server 的可選參數。
如果您省略該參數,那麼將指定缺省單元名。
-create
創建概要文件。
指定 wasprofile -create -templatePath fully_qualified_file_path_to_template -help 以獲取關於創建概要文件的特定信息。可用的模板包括:
dmgr - Deployment Manager
缺省值 - 獨立應用程序服務器
受管 - 定製節點
-debug
打開 wasprofile 命令使用的 Ant 實用程序的調試功能。
-delete
刪除概要文件。刪除概要文件不會刪除概要文件目錄。例如,假定您在 /usr/WebSphere/AppServer/profiles/managedProfile 目錄中創建一個概要文件。在您刪除概要文件之後,該目錄仍然存在。
刪除概要文件之前,請縮小已執行的任何擴充。
您可以刪除或保留該目錄。然而,profile_dir/logs 目錄包含關於卸載概要文件的信息。例如,您可以保留 _nodeuninst.log 文件以確定在卸載過程中發生的任何問題的原因。
delete 參數不會自動執行縮小。必須在刪除概要文件之前手動執行縮小。
-getName
獲取以給定的 -profilePath 參數註冊的概要文件的名稱。
-getPath
獲取給定名稱的概要文件的文件系統位置。需要 -profileName 參數。
-help
顯示命令語法。
-hostName host_name
指定您創建概要文件的主機名。這應該與您在初始產品安裝過程中指定的主機名相匹配。
-isDefault
指定由一起使用的 -profileName 參數標識的概要文件在註冊後將成爲缺省概要文件。當發出針對缺省概要文件的命令時,那麼不必使用命令的 -profileName 屬性。
-listProfiles
列出所有定義的概要文件。
-nodeName node_name
指定用新概要文件創建的節點的節點名。在或機器上使用唯一值。每個共享同一個產品二進制文件集的概要文件必須具有唯一節點名。
-portsFile file_path
指定文件路徑的可選參數,該文件定義新概要文件的端口設置。省略時,wasprofile 工具查找 app_server_root/profileTemplates/profile_type /actions/portsUpdate/bin/portdef.props 文件。
不要在使用 -startingPort 參數時使用此參數。
-profileName profile_name
指定概要文件的名稱。創建概要文件時使用唯一值。每個共享同一個產品二進制文件集的概要文件必須具有唯一名稱。
-profilePath profile_path
指定到概要文件的標準路徑。
 如果標準路徑包含空格,那麼將該值包括在引號中。
-startingPort startingPort
指定用於生成概要文件的所有端口的起始端口號。如果未指定,wasprofile 命令使用 serverindex.xml 文件中指定的缺省端口。
請不要將此參數與 _portsFile 參數配合使用。
-templatePath template_path
指定安裝根目錄中模板文件的目錄路徑。
profileTemplates 目錄包含對應於不同概要文件類型的各種目錄,並且這些目錄隨所安裝產品的類型而異。
這些概要文件目錄是您在使用 -templatePath 選項時指示的路徑。
可指定不在安裝根目錄中的概要文件模板(如果碰巧有的話)。
如果您指定相對路徑,那麼指定的模板位置缺省爲 app_server_root/profileTemplates 目錄。
例如,以下幾個成對的指定各自指向相同的模板路徑:
 
-templatePath /usr/WebSphere/AppServer/profileTemplates/default
  
-templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default
 
-templatePath C:/Program Files/IBM/WebSphere/AppServer/profileTemplates/default
-unaugment
擴充是將已更改的模板應用到現有概要文件的能力。當您縮小已擴充的現有概要文件時,將根據先前指定的概要文件模板撤銷更改。如果執行了一系列 wasprofile 擴充,那麼縮小操作將首先撤銷最後的擴充操作。
當調用縮小操作時,wasprofile 嘗試訪問在擴充命令中指定的模板路徑中的 deleteRegistry.xml 文件。然後對指定的概要文件應用在刪除註冊表文件中的 Config Actions 節中定義的操作。
另請參閱 augment 參數。
-validateAndUpdateRegistry
檢查概要文件註冊表中列出的所有概要文件,以查看文件系統中是否存在這些概要文件。從註冊表除去任何缺少的概要文件。返回從註冊表刪除的缺少的概要文件列表。
-validateRegistry
檢查概要文件註冊表中列出的所有概要文件,以查看文件系統中是否存在這些概要文件。返回缺少的概要文件的列表。
-winserviceAccountType type_of_owner_account 
爲概要文件創建的 Windows 服務的所有者帳戶的類型可以是指定的用戶名或值 localsystem。localsystem 值在創建概要文件的用戶的本地帳戶下運行 Windows 服務。
-winserviceCheck value 
該值可以爲 true 或 false。指定 true 爲概要文件內創建的服務器進程創建 Windows 服務。指定 false 以便不創建 Windows 服務。
-winservicePassword your_password 
爲將擁有 Windows 服務的指定用戶或本地帳戶指定密碼。
-winserviceStartupType startup_type 
可能的 startup_type 值爲:
manual
automatic
disabled
請參閱WASService 命令 獲取有關 Windows 服務的更多信息。
-winserviceUserName user_ID 
指定用戶標識以便 Windows 可以驗證您是否能作爲創建 Windows 服務的標識。您的用戶標識必須屬於管理員組,而且具有下列高級用戶權限:
作爲操作系統的一部分
作爲服務登錄
用例方案
用例是工具使用的一般任務的描述。
方案:刪除概要文件
爲了可讀性,以下命令位於多個行上。在一行輸入命令來刪除名爲 shasti 的概要文件:
wasprofile.sh -delete
                     -profileName shasti
方案:使用預定義的端口號
當您使用不具有 -startingPort 參數的 wasprofile 工具時,該工具使用 app_server_root/profileTemplates/profile_type /actions/portsUpdate/bin/portdef.props 文件來設置初始端口。
示例
複製文件、編輯端口設置然後按以下示例所示使用 -portsFile 參數使用副本:
wasprofile.bat
   -create
   -profileName Wow_Profile
   -profilePath
       profile_root
   -templatePath
       app_server_root/profileTemplates/default
   -nodeName Wow_node
   -cellName Wow_cell
   -hostName lorriemb
   -portsFile C:/temp/ports/portdef.props
假設 portdef.props 文件具有以下值:
WC_defaulthost=39080
WC_adminhost=39060
WC_defaulthost_secure=39443
WC_adminhost_secure=39043
BOOTSTRAP_ADDRESS=32809
SOAP_CONNECTOR_ADDRESS=38880
SAS_SSL_SERVERAUTH_LISTENER_ADDRESS=39401
CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS=39403
CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS=39402
ORB_LISTENER_ADDRESS=39100
DCS_UNICAST_ADDRESS=39353
SIB_ENDPOINT_ADDRESS=37276
SIB_ENDPOINT_SECURE_ADDRESS=37286
SIB_MQ_ENDPOINT_ADDRESS=35558
SIB_MQ_ENDPOINT_SECURE_ADDRESS=35578
結果 serverindex.xml 文件看似以下示例:
<?xml version="1.0" encoding="UTF-8"?>
<serverindex:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
...
   <specialEndpoints xmi:id="NamedEndPoint_..."
                                         endPointName="BOOTSTRAP_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="lorriemb" port="32809"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                                   endPointName="SOAP_CONNECTOR_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="lorriemb" port="38880"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                   endPointName="SAS_SSL_SERVERAUTH_LISTENER_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="lorriemb" port="39401"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                  endPointName="CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="lorriemb" port="39403"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                 endPointName="CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="lorriemb" port="39402"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                                      endPointName="WC_adminhost">
      <endPoint xmi:id="EndPoint_..." host="*" port="39060"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                                    endPointName="WC_defaulthost">
      <endPoint xmi:id="EndPoint_..." host="*" port="39080"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                                  endPointName="DCS_UNICAST_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="lorriemb" port="39353"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                                endPointName="WC_adminhost_secure">
      <endPoint xmi:id="EndPoint_..." host="*" port="39043"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                                endPointName="WC_defaulthost_secure">
      <endPoint xmi:id="EndPoint_..." host="*" port="39443"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                               endPointName="SIB_ENDPOINT_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="*" port="37276"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                         endPointName="SIB_ENDPOINT_SECURE_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="*" port="37286"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                              endPointName="SIB_MQ_ENDPOINT_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="*" port="35558"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                       endPointName="SIB_MQ_ENDPOINT_SECURE_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="*" port="35578"/>
    </specialEndpoints>
    <specialEndpoints xmi:id="NamedEndPoint_..."
                                endPointName="ORB_LISTENER_ADDRESS">
      <endPoint xmi:id="EndPoint_..." host="lorriemb" port="39100"/>
    </specialEndpoints>
  </serverEntries>
</serverindex:ServerIndex>
wasprofile 命令在 profile_root/logs 目錄中創建當前 portdefs.props 文件的副本。
不要在使用 startingPort 參數時使用 portsFile 參數。這兩個參數相互排斥。
方案:從起始點增加缺省端口號
使用 -startingPort 參數,wasprofile 可以根據您在命令行給定的起始端口值指定端口號。繼而,該工具從起始端口號值指定端口號。
端口指定的順序是任意的。預測指定是不可能的。
例如,用 -startingPort 20002 創建的端口將與以下示例類似那樣出現:
爲 Application Server 概要文件指定端口
WC_defaulthost=20002
WC_adminhost=20003
WC_defaulthost_secure=20004
WC_adminhost_secure=20005
BOOTSTRAP_ADDRESS=20006
SOAP_CONNECTOR_ADDRESS=20007
SAS_SSL_SERVERAUTH_LISTENER_ADDRESS=20008
CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS=20009
CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS=20010
ORB_LISTENER_ADDRESS=20011
DCS_UNICAST_ADDRESS=20012
SIB_ENDPOINT_ADDRESS=20013
SIB_ENDPOINT_SECURE_ADDRESS=20014
SIB_MQ_ENDPOINT_ADDRESS=20015
SIB_MQ_ENDPOINT_SECURE_ADDRESS=20016
示例
以下是使用 wasprofile 命令從初始值 20002 創建端口的示例,附帶前面的示例中顯示的內容:
wasprofile.bat -create
               -profileName shasti
               -profilePath profile_root
               -templatePath template_path
               -nodeName W2K03
               -cellName W2K03_Cell01
               -hostName planetnt
               -startingPort 20002
                           
示例:使用命令來創建概要文件
以下示例顯示如何使用 wasprofile 命令來創建概要文件。
請在一行上發出以下任何示例中的命令。每個示例都以多行顯示命令來增加可讀性。
創建獨立應用程序服務器概要文件
請使用以下命令創建名爲 Default01 的應用程序服務器概要文件:
 
app_server_root/bin wasprofile -create
    -profileName Default01
    -profilePath profile_root
    -templatePath app_server_root/profileTemplates/default
    -nodeName Default01Node
    -cellName Default01Cell
    -hostName myhost.mycity.mycompany.com
    -isDefault false
    -winserviceCheck true
    -winserviceAccountType user
    -winserviceUserName my_user_id
    -winservicePassword my_password
    -winserviceStartupType manual
    -startingPort 21000
 
app_server_root/bin/manageprofiles.sh -create
   -profileName Default01
   -profilePath profile_root
   -templatePath app_server_root/profileTemplates/default
   -nodeName Default01Node
   -cellName Default01Cell
   -hostName myhost.mycity.mycompany.com
   -isDefault
   -startingPort 21000

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章