1 |
您好,我叫 Mike Thompson,是 WebSphere Liberty 的開發人員。我今天要為您簡介 Liberty 的新管理網域,也就是所謂的群體。 |
顯示對著鏡頭說話的開發人員。 |
2 |
我們一開始就已經安裝好 Liberty Network Deployment,現在要建立一個簡單的群體。可以用八個步驟來完成這項作業。第一個步驟是建立伺服器來作為管理伺服器。我要將它命名為 myController。 |
顯示在 wlp/bin 中開啟的指令視窗,執行 server create myController,然後顯示訊息:已建立 myController 伺服器。
|
3 |
建立好 myController 伺服器之後,我們需要建立群體配置,讓伺服器能夠當作控制器來執行。在進行配置的過程中,我們要指定金鑰儲存庫密碼。金鑰儲存庫密碼未預先定義。我們沒有提供預先定義的使用者名稱或密碼。因此,使用金鑰儲存庫密碼 demoPassword,將會建立適用於群體控制器的配置。 |
顯示在 wlp/bin 中開啟的指令視窗,然後執行指令:collective create myController --keystorePassword=demoPassword
|
4 |
這大概需要 3 秒鐘,基本上會建立一些 SSL 憑證。我們需要複製列印在畫面中的配置,並更新伺服器配置檔。 |
顯示指令產生的訊息,並標示下列要複製的訊息:<featureManager>
<feature>collectiveController-1.0</feature>
</featureManager>
<!-- Define the host name for use by the collective.
If the host name needs to be changed, the server should be
removed from the collective and re-joined or re-replicated. -->
<variable name="defaultHostName" value="myhost.ibm.com" />
<!-- TODO: Set the security configuration for Administrative access -->
<quickStartSecurity userName="" userPassword="" />
<!-- clientAuthenticationSupported set to enable bidirectional trust -->
<ssl id="defaultSSLConfig"
keyStoreRef="defaultKeyStore"
trustStoreRef="defaultTrustStore"
clientAuthenticationSupported="true" />
<!-- inbound (HTTPS) keystore -->
<keyStore id="defaultKeyStore" password="{xor}OzoyMA8+LCwoMC07"
location="${server.config.dir}/resources/security/key.jks" />
<!-- inbound (HTTPS) truststore -->
<keyStore id="defaultTrustStore" password="{xor}OzoyMA8+LCwoMC07"
location="${server.config.dir}/resources/security/trust.jks" />
<!-- server identity keystore -->
<keyStore id="serverIdentity" password="{xor}OzoyMA8+LCwoMC07"
location="${server.config.dir}/resources/collective/serverIdentity.jks" />
<!-- collective trust keystore -->
<keyStore id="collectiveTrust" password="{xor}OzoyMA8+LCwoMC07"
location="${server.config.dir}/resources/collective/collectiveTrust.jks" />
<!-- collective root signers keystore -->
<keyStore id="collectiveRootKeys" password="{xor}OzoyMA8+LCwoMC07"
location="${server.config.dir}/resources/collective/rootKeys.jks"/>
|
5 |
我們可以使用「記事本」來這麼做,因為這是非常簡單的 XML,我們可以直接將它貼在 server.xml 的內容中。 |
顯示在「記事本」編輯器中開啟 myController server.xml 檔,然後將複製的訊息貼到 server.xml 檔中的結束標籤 </server> 之前。 |
6 |
除了將它貼上之外,我們還需要指定管理名稱。所以我要使用 admin,並以 adminpwd 作為密碼。 |
在編輯器中,設定使用者名稱和密碼:<quickStartSecurity userName="admin" userPassword="adminpwd" />
|
7 |
配置好伺服器之後,即可將它啟動。 |
顯示在 wlp/bin 中開啟的指令視窗,執行 server start myController,然後顯示訊息:正在啟動伺服器 myController
|
8 |
現在,群體控制器已經在執行中,我可以建立伺服器來加入群體中。我要建立一部名為 myMember 的伺服器,並將這部伺服器加入群體中。這項作業可以使用群體的 join 指令來執行。而我們需要指定的是:群體控制器在 HTTPS 埠上接聽的主機和埠、管理使用者名稱和密碼,以及金鑰儲存庫密碼。這個密碼可以和我們建立群體控制器時所使用的密碼相同或不同。 |
顯示在 wlp/bin 中開啟的指令視窗,執行
server create myMember,然後顯示訊息:已建立 myMember 伺服器。
然後執行 collective join myMember --host=localhost --port=9443 --user=admin --password=adminpwd --keystorePassword=demoPassword。 |
9 |
因為這是透過 SSL 連接至群體控制器,所以會提示我們提供 SSL 信任。這裡顯示的憑證是來自我們所辨識的群體控制器。我們將會接受此憑證,而在背景中,群體控制器會為這個特定成員建立一些 SSL 憑證,以便交還並放置在檔案系統中。 |
顯示 collective join 指令所產生的訊息。訊息顯示發證者 DN 是 controllerRoot。在您要接受上述憑證鏈嗎?(y/n) 訊息之後,請輸入 y,以接受憑證。 |
10 |
我們複製配置,就像對控制器所做的一樣,然後我們要更新成員的配置檔。重要: 產生的配置有一個 hostAuthInfo 元素,在製作此視訊後,已新增到產品中。完成 hostAuthInfo 元素的方式有兩種:
|
顯示關於金鑰儲存庫和信任儲存庫參照所產生的訊息,並標示下列要複製的訊息:<featureManager>
<feature>collectiveMember-1.0</feature>
</featureManager>
<!-- Define the host name for use by the collective.
If the host name needs to be changed, the server should be
removed from the collective and re-joined or re-replicated. -->
<variable name="defaultHostName" value="memberHostname" />
<!-- Remote host authentication configuration -->
<hostAuthInfo rpcUser="admin_user_id" rpcUserPassword="admin_user_password" />
<!-- Connection to the collective controller -->
<collectiveMember controllerHost="localhost"
controllerPort="9443" />
<!-- clientAuthenticationSupported set to enable bidirectional trust -->
<ssl id="defaultSSLConfig"
keyStoreRef="defaultKeyStore"
trustStoreRef="defaultTrustStore"
clientAuthenticationSupported="true" />
<!-- inbound (HTTPS) keystore -->
<keyStore id="defaultKeyStore" password="yourPassword"
location="${server.config.dir}/resources/security/key.jks" />
<!-- inbound (HTTPS) truststore -->
<keyStore id="defaultTrustStore" password="yourPassword"
location="${server.config.dir}/resources/security/trust.jks" />
<!-- server identity keystore -->
<keyStore id="serverIdentity" password="yourPassword"
location="${server.config.dir}/resources/collective/serverIdentity.jks" />
<!-- collective truststore -->
<keyStore id="collectiveTrust" password="yourPassword"
location="${server.config.dir}/resources/collective/collectiveTrust.jks" />
|
11 |
我們也可以使用「記事本」來這麼做。 |
顯示開啟「記事本」編輯器的指令 notepad usr/servers/myMember/server.xml,顯示在「記事本」編輯器中開啟myMember server.xml 檔,然後將複製的訊息貼到 server.xml 檔中的結束標籤 </server> 之前。 |
12 |
更新之後,可以啟動成員伺服器,而成員伺服器會開始將其資訊發佈至控制器中。 就這樣。您現在有了非常基本的群體。如果要新增其他成員,只要在您想建立的任何伺服器上重複加入作業即可。就這麼簡單。新增了成員,群體就會擴大。
|
顯示在 wlp/bin 中開啟的指令視窗,執行 server start myMember,然後顯示訊息:正在啟動 myMember 伺服器
myMember 伺服器已啟動
|