一旦環境變更,「動態遞送」特性可逕行將 HTTP 要求遞送至 Liberty 群體的成員,而不必重新產生 WebSphere® 外掛程式配置檔。當新增、移除、啟動、停止或修改伺服器、叢集成員、應用程式或虛擬主機時,會將新資訊動態交付給 WebSphere 外掛程式。會根據最新的資訊,來遞送要求。此特性提供「動態遞送」服務,此服務會從群體儲存庫動態擷取遞送資訊,然後將此資訊交付給 WebSphere 外掛程式。此特性亦提供三個新群體指令動作。這些動作會一起使用,來產生外掛程式與「動態遞送」服務進行安全通訊時所需的金鑰儲存庫,以及產生一個用來在 WebSphere 外掛程式中啟用「智慧型管理」的外掛程式配置檔。
開始之前
重要: 如果要使用「動態遞送」特性,必須要有 WebSphere Application Server Web 伺服器外掛程式 APAR 號碼 PI27023 中的智慧型管理 iFix。在啟用「動態遞送」特性之前,您必須先安裝 WebSphere Application Server Web 伺服器外掛程式支援的 Web 伺服器(例如 IBM HTTP Server)、安裝 WebSphere Application Server Web 伺服器外掛程式 8.5.5 或更新版本,然後再安裝 iFix。
- 下載並安裝最新版本的 IBM Installation Manager。如需安裝 IBM Installation Manager 的相關資訊,請參閱安裝 Installation Manager 以及準備安裝產品。
- 使用 Installation Manager 存取線上產品儲存庫,以便安裝 WebSphere Application Server Web 伺服器外掛程式,以及「動態遞送」特性所需的 iFix。選取檔案 > 喜好設定,來開啟 Installation Manager GUI 喜好設定頁面。使用 Installation Manager,從位於下列位置的 Web 型儲存庫來安裝產品:
http://www.ibm.com/software/repositorymanager/com.ibm.websphere.PLGILAN.v85
註: 需要有 IBM ID,才能存取儲存庫。這個儲存庫只適用於分散式平台。
- 使用「安裝」精靈,同時安裝 Web 伺服器外掛程式和必要的 iFix。
- 當精靈提示時,請指定安裝位置,並繼續安裝。
觀看:啟用 IHS 以進行 Liberty 動態遞送視訊顯示如何安裝 IHS、安裝 WebSphere Application Server Web 伺服器外掛程式,以及套用「動態遞送」的 iFix。[文字稿]
關於這項作業
如果要使用「智慧型管理」將 HTTP 要求遞送至 Liberty 群體,使用者必須在群體中的一或多部群體控制器上啟用動態遞送特性。
程序
- 請將下列程式碼新增至控制器 server.xml 中的 featureManager 標籤,以便在該控制器中啟用「動態遞送」。
<feature>dynamicRouting-1.0</feature>
- 啟動所有啟用了「動態遞送」特性的控制器。
- 在其中一部控制器上執行 dynamicRouting setup 指令,來產生金鑰儲存庫和外掛程式配置檔。例如:
./dynamicRouting setup --port=9444 --host=controller1.acme.com --user=admin --password=passw0rd --keystorePassword=webAS --pluginInstallRoot=/opt/HTTPServer_Plugins/ --webServerNames=webserver1
如需「動態遞送」指令的相關資訊,請參閱
「動態遞送」指令。
註: 請確定指定的使用者名稱(--user 引數的值)存在於使用者登錄中,並且已指派管理角色。
- 將產生的 plugin-key.jks 和 plugin-cfg.xml 檔複製到 Web 伺服器主機上的暫存目錄。
- 在 Web 伺服器主機上執行 gskcmd(包含在 IHS 套件中),以便將金鑰儲存庫轉換成 CMS 格式,以及將個人憑證設為預設值。CMS 格式是 WebSphere 外掛程式支援的格式。例如:
gskcmd -keydb -convert -pw webAS -db /tmp/plugin-key.jks -old_format jks -target /tmp/plugin-key.kdb -new_format cms -stash
gskcmd -cert -setdefault -pw <<password>> -db /tmp/plugin-key.kdb -label default
- 將 gskcmd 建立的 plugin-key.kdb、plugin-key.rdb 和 plugin-key.sth 檔,從暫存目錄複製到目錄。<value of the --pluginInstallRootargument>/config/<web server name>/
- 將 plugin-cfg.xml 複製到 IBM HTTP Server (IHS) httpd.conf 中之
WebSpherePluginConfig 指引所指定的目錄。產生的 plugin-cfg.xml 中含有 <IntelligentManagement> 段落。在群體中啟用「動態遞送」時,每一個群體控制器會有一個 <Connector> 段落。
例如:
<IntelligentMangement>
<Property name="webserverName" value="webServer1"/>
<ConnectorCluster enabled="true" maxRetries="-1" name="default" retryInterval="60">
<Property name="uri" value="/ibm/api/dynamicRouting"/>
<Connector host="controller1.acme.com" port="9444" protocol="https">
<Property name="keyring" value="/opt/HTTPServer_Plugins/config/webserver1/plugin-key.kdb"/>
</Connector>
</ConnectorCluster>
</IntelligentManagement>
- 啟動 Web 伺服器,並開始遞送至安裝在群體中的應用程式。
您可以選擇性地將
<dynamicRouting> 標籤新增至控制器的
server.xml,以指定
<ConnectorCluster> 內容,例如
maxRetries 和
retryInterval。例如:
<dynamicRouting maxRetries="4" retryInterval="20" connectorClusterName="collective1"/>
<TraceSpecification name="default" specification=":DEBUG"/>
</dynamicRouting>
產生的
plugin-cfg.xml 類似如下:
<IntelligentMangement>
<TraceSpecification name="default" specification=":DEBUG"/>
<Property name="webserverName" value="webServer1"/>
<ConnectorCluster enabled="true" maxRetries="4" name="collective1" retryInterval="20">
<Property name="uri" value="/ibm/api/dynamicRouting"/>
<Connector host="controller1.acme.com" port="9444" protocol="https">
<Property name="keyring" value="/opt/HTTPServer_Plugins/config/webServer1/plugin-key.kdb"/>
</Connector>
</ConnectorCluster>
</IntelligentManagement>
結果
因啟用了
動態遞送特性,現在「智慧型管理」可動態將 HTTP 要求遞送至 Liberty 群體。