Liberty 集合の構成

Liberty サーバーを集合に編成して、複数の Liberty サーバーに対して機能するクラスター化、管理、および他の操作をサポートできます。集合を使用して、アプリケーション・サービスをアプリケーションに効率的かつ正確に提供できます。

始める前に

Liberty を管理フィーチャーとともにインストールします。インストールの説明については、集合を使用した、Liberty 用のサーバー管理環境のセットアップの『始める前に』のセクションを参照してください。Liberty の管理フィーチャーにより、集合、クラスター、スケーリング、動的ルーティング、および Admin Center のための、複数サーバー管理フィーチャーが提供されます。

For distributed platformsFor IBM i platformscollectiveController-1.0 フィーチャーとその機能は、WebSphere® Application Server Network Deployment Liberty および WebSphere Application Server for z/OS® Liberty でのみ提供されています。このフィーチャーは、WebSphere Application Server LibertyWebSphere Application Server Liberty Core では使用できません。WebSphere Application Server Network Deployment Liberty のインストール済み環境がある場合は、その collectiveController-1.0 フィーチャーを使用して、WebSphere Application Server LibertyWebSphere Application Server Liberty Core のインストール済み環境の集合メンバーを操作することができます。

このタスクについて

Liberty 集合とは、同じ管理および操作ドメインの一部として構成された Liberty サーバーの集合のことです。

Liberty 集合の構成データおよび状態データは、アクティブな運用リポジトリーに格納されます。

Liberty 集合内のメンバーシップはオプションです。Liberty サーバーは、集合コントローラーに登録してメンバーになることで、集合に参加します。メンバーは、コントローラーの運用リポジトリーを通じてそれぞれについての情報を共有します。

以下のルールが適用されます。
  • Liberty サーバーは、ただ 1 つの集合のメンバーになることができます。
  • 同じホスト上の異なる Liberty サーバーは、異なる集合に入れることができます。
  • 同じ集合のメンバーである、同じホスト上の Liberty サーバーは、集合のメンバーではない Liberty サーバーと共存できます。
  • 集合のすべてのメンバーは同じデータ・センターに属していなければなりません。集合は、データ・センターで拡散されてはなりません。

マルチメディアご覧ください: Video: Introduction to creating a collective は、この手順を示しています。このビデオ、および集合に関するその他の情報は、WASdev Web サイトから入手できます。[トランスクリプト]

手順

  1. コントローラーを作成および構成します。
    1. 集合コントローラーとして機能するサーバーを作成します。
      wlp/bin/server create myController
    2. 集合コントローラー構成を作成します。

      集合コントローラー構成は主に、コントローラーとメンバーの間のセキュア通信に使用する、管理ドメインのセキュリティー構成から成ります。

      wlp/bin/collective create myController --keystorePassword=controllerKSPassword
      デフォルトでは、この集合コマンドはすべての出力をコンソール画面に書き込みます。次のステップでは、構成出力を server.xml にコピーします。構成をコンソール画面ではなくファイルに書き込むには、--createConfigFile=outputFilePath パラメーターを指定します。例えば、以下のようにします。
      wlp/bin/collective create myController --keystorePassword=controllerKSPassword --createConfigFile=c:/wlp/usr/servers/myController/collective-create-include.xml
      create コマンドを実行すると、使用する include ステートメントが表示されます。 出力されたファイルを集合構成に含めるには、以下の例のように、include ステートメントを server.xml ファイルに追加します。
      <include location="c:¥wlp¥usr¥servers¥myController¥collective-create-include.xml" />
    3. 集合コントローラーの server.xml ファイルを更新します。
      • 出力をコピーし、貼り付けます。

        コマンドで出力がコンソール画面に書き込まれた場合、以下のステップに進みます。

        1. 集合コマンドからの出力をコピーし、server.xml ファイルに貼り付けます。
        2. 集合の管理ユーザー ID とパスワードの値を指定します。 例えば、
          <quickStartSecurity userName="" userPassword="" />
          を次のように変更します:
          <quickStartSecurity userName="adminUser" userPassword="adminPassword" />
        集合コントローラーの server.xml ファイルのデフォルト・パスは ${wlp.install.dir}/usr/servers/myController/server.xml ですが、 server.env ファイルまたはコマンド・ウィンドウで $WLP_USER_DIR 変数が設定されている場合には $WLP_USER_DIR/servers/myController/server.xml になります。 編集後のファイルは、以下の例のようになっています。
        <server description="controller server">
        
            <!-- Enable features -->
        
            <featureManager>
                <feature>jsp-2.2</feature>
            </featureManager>
            <httpEndpoint id="defaultHttpEndpoint"
                          host="*"
                          httpPort="9080"
                          httpsPort="9443" />
        
            <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="controllerHostname" />
        
            <!-- TODO: Set the security configuration for Administrative access -->
        
            <quickStartSecurity userName="adminUser" userPassword="adminPassword" />
        
            <!-- 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 trust keystore -->
            <keyStore id="collectiveTrust" password="yourPassword"
                      location="${server.config.dir}/resources/collective/collectiveTrust.jks" />
            <!-- collective root signers keystore -->
            <keyStore id="collectiveRootKeys" password="yourPassword"
                      location="${server.config.dir}/resources/collective/rootKeys.jks" />
        </server>
      • include ステートメントを追加します。
        --createConfigFile=outputFilePath パラメーターを使用して出力をファイルに書き込んだ場合は、include ステートメントを $WLP_USER_DIR/servers/myController/server.xml に追加して、出力されたファイルを集合構成に含めます。 編集後のファイルの内容は、以下の例のようになります。
        <server description="controller server">
        
            <!-- Enable features -->
        
            <featureManager>
                <feature>jsp-2.2</feature>
            </featureManager>
            <httpEndpoint id="defaultHttpEndpoint"
                          host="*"
                          httpPort="9080"
                          httpsPort="9443" />
        
            <include location="c:¥wlp¥usr¥servers¥myController¥collective-create-include.xml" />
        </server>
        以下の例のように、出力されたファイルに、集合の管理ユーザー ID とパスワードの値が設定されていることを確認します。
        <quickStartSecurity userName="adminUser" userPassword="adminPassword" />
    4. 集合コントローラー・サーバーを始動します。
      wlp/bin/server start myController
      図 1. 1 つから成る集合
      1 つから成る集合
    5. 集合コントローラー・サーバーが適切に始動し、メンバーの受け入れが可能であることを確認します。
      1. 集合コントローラーのメッセージ・ログ $WLP_USER_DIR/servers/myController/logs/messages.log でエディターを開きます。
      2. 次のメッセージを探します。
        CWWKX9003I: CollectiveRegistration MBean が使用可能です。
  2. メンバーを作成し、集合に結合するように構成します。

    コントローラーとメンバーは、別々のホスト上に存在できます。この例では、コントローラーとメンバーは、同一ホスト上にあります。

    1. メンバー・サーバーを作成します。
      wlp/bin/server create myMember
    2. 当該メンバーを加えます。

      collective join コマンドを実行し、サーバーをメンバーとして集合に結合します。 メンバー・ホストの Liberty インストール済み環境で join コマンドを実行します。

      join コマンドでは、集合コントローラーへのネットワーク接続と、集合コントローラーに対して MBean 操作を実行するための管理ユーザー ID とパスワードが必要です。 集合コントローラーの server.xml ファイルで、 --host--port--user、および --password の各パラメーターの値を見つけます。 --keystorePassword には、メンバーの鍵ストア・パスワードに使用する値 (memberKSPassword など) を設定します。 集合に結合された各サーバーごとに、異なる --keystorePassword 値を指定できます。

      wlp/bin/collective join myMember --host=controllerHostname --port=9443 --user=adminUser --password=adminPassword --keystorePassword=memberKSPassword

      オプション・パラメーター --hostname では、システムで使用するホスト名を指定します。 --hostname を設定するのは、システムに複数のホスト名がある場合か、ホスト名が構成されていない場合のみです。設定した値は、server.xml ファイルに定義されている defaultHostName 変数に一致している必要があります。

      [18.0.0.1 and later]必要なオプションの数を減らすには、--user--password--host、および --port の代わりに、--controller オプションを使用します。

      wlp/bin/collective join myMember 
      --controller=user[:password]@host:HttpsPort 
      --keystorePassword=memberKSPassword
      この集合コマンドの出力をコンソール画面ではなくファイルに書き込むには、オプションの --createConfigFile=outputFilePath パラメーターを指定します。次に、以下のように、include ステートメントをメンバーの server.xml ファイルに追加して、出力されたファイルを集合構成に含めます。
      <include location=outputFilePath />

      デフォルトで、join 操作では、リモート・プロシージャー呼び出し (RPC) のクレデンシャルは未定義のままになります。rpcUserrpcUserPassword、およびメンバー・サーバーが存在しているホストのオペレーティング・システムのログイン・ユーザーとパスワードの値を指定する必要があります。メンバー・ホストが集合コントローラーに登録されていて、メンバー・ホストで SSH が有効になっていない場合、オプションの --useHostCredentials パラメーターを指定して、メンバーがコントローラー上のホスト登録から RPC クレデンシャルを継承できるようにします。 通常、Linux ホストでは SSH が有効になっていて、Windows ホストでは SSH が有効になっていないため、 --useHostCredentials パラメーターは、Windows メンバー・ホストの場合に便利です。 --useHostCredentials を指定すると、<hostAuthInfo useHostCredentials="true" /> がメンバーの server.xml ファイルに追加されます。これにより、メンバーはホストからクレデンシャルを継承するため、集合メンバー・サーバーのコマンド (startstop など) を、RPC クレデンシャルを指定せずに実行できます。 hostAuthInfo--useHostCredentials パラメーター、および集合コントローラーのサーバーへの接続については、 Liberty サーバー・ホスト情報のオーバーライドを参照してください。ホスト・コンピューターでの SSH の有効化 については、Liberty 集合操作用 RXA のセットアップを参照してください。

      これらの必須パラメーターとオプション・パラメーターについては、コマンド・ラインで collective help join を実行してください。

    3. 証明書チェーンの受け入れを要求するプロンプトが出されたら、y (yes) を入力します。
    4. メンバーの server.xml ファイルを更新します。
      • 出力をコピーし、貼り付けます。

        コマンドで出力がコンソール画面に書き込まれた場合、以下のステップに進みます。

        1. 集合コマンドからの出力をコピーし、メンバーの server.xml ファイルに貼り付けます。
        2. サーバーが HTTP ポートを開くことができるように、ポートを変更します。メンバーの server.xml では、そのホストの固有の HTTP ポート番号を必ず設定してください。 例えば、集合コントローラーと同じホスト上にメンバーが存在する場合、HTTP ポート番号を次のように変更します。
          <httpEndpoint id="defaultHttpEndpoint" httpPort="9081" httpsPort="9444" />
          また、オプションで、リモート・クライアントからメンバー・サーバーにアクセスするために、 httpEndpoint エレメントに host="*" を設定します。
        編集後のファイル $WLP_USER_DIR/servers/myMember/server.xml は、以下の例のようになります。
        <server description="member server">
        
            <!-- Enable features -->
        
            <featureManager>
                <feature>jsp-2.2</feature>
            </featureManager>
            <httpEndpoint id="defaultHttpEndpoint"
                          host="*"
                          httpPort="9081"
                          httpsPort="9444" />
            <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="controllerHostname"
                              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" /></server>
      • include ステートメントを追加します。
        --createConfigFile=outputFilePath パラメーターを使用して出力をファイルに書き込んだ場合は、include ステートメントを $WLP_USER_DIR/servers/myMember/server.xml に追加して、出力されたファイルを含めます。以下に例を示します。
        <server description="member server">
        
            <!-- Enable features -->
        
            <featureManager>
                <feature>jsp-2.2</feature>
            </featureManager>
            <httpEndpoint id="defaultHttpEndpoint"
                          host="*"
                          httpPort="9081"
                          httpsPort="9444" />
            <include location="c:¥wlp¥usr¥servers¥myMember¥collective-join-include.xml" />
        
        </server>
    5. join コマンドに --useHostCredentials を指定しておらず、 メンバー・ホストで SSH が有効になっていない場合、メンバーの server.xml ファイルまたは出力されたファイルに、hostAuthInfo の RPC クレデンシャルを設定します。 メンバー・サーバーの RPC クレデンシャルは、以下の 2 つのいずれかの方法で設定できます。
      • hostAuthInfo の RPC ユーザーおよびパスワードの値を設定します。 rpcUser には、メンバー・サーバーが存在するホストのオペレーティング・システム・ログイン・ユーザー ID を設定し、 rpcUserPassword には、ユーザー ID のオペレーティング・システム・ログイン・パスワードを設定します。 例えば、ユーザー test1、パスワード test1pwd でメンバー・コンピューターにログインする場合は、 hostAuthInfo エレメントを次のように変更します。
        <hostAuthInfo rpcUser="test1" rpcUserPassword="test1pwd" />
      • メンバー・ホストが集合コントローラーに登録されている場合は、メンバー・サーバーがそのホストから RPC クレデンシャルを継承するように、 hostAuthInfouseHostCredentialstrue を設定します。
        <hostAuthInfo useHostCredentials="true" />

      hostAuthInfo の設定について、およびメンバー・ホストの登録方法と、 --useHostCredentials を指定した join コマンドの実行方法の例については、 Liberty サーバー・ホスト情報のオーバーライドを参照してください。

    6. メンバー・サーバーを始動します。
      wlp/bin/server start myMember
      図 2. 単純な集合
      単純な集合
    7. メンバー・サーバーが適切に始動し、コントローラーに情報を公開していることを確認します。
      1. メンバーのメッセージ・ログ $WLP_USER_DIR/servers/myMember/logs/messages.log でエディターを開きます。
      2. 任意の順序で以下のメッセージを探します。
        CWWKX8112I: サーバーのホスト情報が正常に集合リポジトリーにパブリッシュされました。
        CWWKX8114I: サーバーのパスが正常に集合リポジトリーにパブリッシュされました。
        CWWKX8116I: サーバーの開始済み状態が正常に集合リポジトリーにパブリッシュされました。
    8. オプション: [18.0.0.1 and later]testConnection コマンドを使用して、接続を検証します。 このコマンドは、コントローラーと、メンバーが存在しているホストとの間の RXA 接続を検証します。また、集合コントローラーと集合メンバーとの間の JMX セキュア接続の検証も行います。
      wlp/bin/collective testConnection hostName,usrDirPath,serverName  --host=controllerHost
      --port=controllerHTTPSPort --user=controllerAdmin 
      --password=controllerAdminPassword--autoAcceptCertificates
      ここで、hostName,usrDirPath,serverName は、参加したばかりのメンバー・サーバーを記述するタプルです。hostName は、集合メンバーが存在しているホストの名前です。 userDirPath は、集合メンバーの usr ディレクトリーです。serverName は、集合メンバーの名前です。
      [18.0.0.1 and later]代替方法として、単純化された --controller オプションを使用してコントローラー固有の情報を指定できます。
      wlp/bin/collective testConnection hostName,usrDirPath,serverName 
      --controller=user[:password]@host:HttpsPort 
      --autoAcceptCertificates

トピックのタイプを示すアイコン タスク・トピック

ファイル名: tagt_wlp_configure_collective.html