コンポーネントの再インストールと復元

このドキュメントでは、Edge コンポーネントの再インストールと復元について説明します。バックアップから復元する前に、Edge コンポーネントを再インストールする必要がある場合は、この手順を使用します。

Apache ZooKeeper

スタンドアロンのノードを 1 つ復元する

  1. ZooKeeper を停止します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper stop
  2. 既存の ZooKeeper ディレクトリを削除します。
    /opt/apigee/data/apigee-zookeeper
    /opt/apigee/etc/apigee-zookeeper.d
  3. ZooKeeper を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper install
  4. ZooKeeper を復元します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. すべてのコンポーネントを再起動します。
    /opt/apigee/apigee-service/bin/apigee-all restart

クラスタノードを 1 つ復元する

ZooKeeper アンサンブルのうちのノードの 1 つに障害が発生した場合、同じホスト名/IP アドレスで新しいノードを作成し、ZooKeeper を再インストールできます。新しい ZooKeeper ノードが ZooKeeper アンサンブルに参加すると、リーダーから最新のスナップショットを取得して、クライアントへの提供を始めることができます。このインスタンスにデータを復元する必要はありません。

  1. ZooKeeper を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper install
  2. 元のノードをインストールするときに使用したのと同じ構成ファイルを使用して、ZooKeeper ノードでセットアップを実行します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper setup -f configFile
  3. ZooKeeper を起動します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper start

クラスタ全体を復元する

  1. クラスタ全体を停止させます。
  2. 上記の単一ノードの場合と同様に、バックアップ ファイルからすべての ZooKeeper ノードを復元します。
  3. ZooKeeper クラスタを起動します。
  4. すべてのコンポーネントを再起動します。

Apache Cassandra

スタンドアロンのノードを 1 つ復元する

  1. Cassandra を停止します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra stop
  2. 既存の Cassandra ディレクトリを削除します。
    /opt/apigee/data/apigee-cassandra
  3. Cassandra を再インストールします。
    /apigee/apigee-service/bin/apigee-service apigee-cassandra install
  4. Cassandra を復元します。
    /apigee/apigee-service/bin/apigee-service apigee-cassandra restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. すべてのコンポーネントを再起動します。
    /apigee/apigee-service/bin/apigee-all restart

クラスタノードを 1 つ復元する

アンサンブルに属する Cassandra ノードの 1 つに障害が発生した場合は、同じホスト名/IP アドレスで新しいノードを作成できます。必要な作業は Cassandra を再インストールすることと、いくつかの追加の手順を行うことだけです。バックアップからデータを復元する必要はありません。他のノードで使用可能なレプリカを使用して、障害が発生したノードのデータを復元できます。通常、これらの手順は、ハードウェアの誤動作などが原因で Cassandra クラスタのノードがクラッシュした場合に適用されます。

障害が発生したノードにアクセスできなくなった場合は、ノードを破棄し、ネットワークを分離して、誤って Cassandra クラスタに再参加できないようにします。次に、元のノードと同じ IP アドレスで新しいノードを起動し、通常の Apigee ブートストラップ手順を実行します。

ノードにまだアクセスでき、再利用する場合は、次の操作を行います。

  1. ノードで Cassandra プロセスを停止します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra stop
  2. ノードから Cassandra ソフトウェアをアンインストールします。
    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra uninstall
  3. ノードからデータ ディレクトリをワイプします。
    rm -rf /opt/apigee/data/apigee-cassandra

上記の手順を完了すると、障害が発生したノードと同じ IP アドレスを持つノードが作成され、Apigee ソフトウェアのインストールが可能になります。次の手順を行います。

  1. データセンターのシードノードを特定します。
    1. 復元するノードと同じデータセンター内の動作中の Cassandra ノードで、次のコマンドを実行します。
      apigee-service apigee-cassandra configure -search conf_cassandra_seeds
    2. 次のような出力が表示されます。
      Found key conf_cassandra_seeds, with value, "127.0.0.1", in /opt/apigee/apigee-cassandra/token/default.properties
      Found key conf_cassandra_seeds, with value, 127.0.0.1, in /opt/apigee/apigee-cassandra/token/application/cassandra.properties
      Found key conf_cassandra_seeds, with value, "10.1.0.1,10.1.0.2", in /opt/apigee/token/application/cassandra.properties
      apigee-configutil: apigee-cassandra: # OK
    3. 出力の最後の行を参照してください。カンマ区切りの IP アドレスは、このデータセンターのノードで使用されるシードノードです。
  2. 復元する新しいノードで、次のファイルを作成または編集します。
    vi /opt/apigee/customer/application/cassandra.properties
  3. Add the following line:
    conf_jvm_options_custom_settings=-Dcassandra.replace_address=<ip-address-of-dead-node>
  4. このノードがシードノードの 1 つである場合(ノードの IP アドレスがステップ 1 のシードノード リストに表示される場合)、ファイルに別の行を追加します。
    conf_cassandra_seeds="<comma-separated-seed-list-except-this-node’s-ip>"
    1. たとえば、上記のインスタンスでは、シードリストに 2 つの IP(10.1.0.1 と 10.1.0.2)があります。復元するノードが 10.1.0.1 の場合は、次のような行を追加します。
      conf_cassandra_seeds="10.1.0.2"
  5. ファイルを保存し、Apigee ユーザーが所有して読み取れることを確認します。
    chown apigee:apigee /opt/apigee/customer/application/cassandra.properties
  6. Cassandra ソフトウェアをインストールします。
    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra install
  7. Cassandra の設定を実行します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra setup -f <configFile>
  8. セットアップは、内部で Cassandra サービスのブートストラップを試みます。他のノードからストリーミングするデータの量やネットワーク スループットなどによっては、時間がかかることがあります。
  9. [高度なオプション] ノードで次の nodetool コマンドを実行すると、データのストリーミングを高速化できます。
    nodetool setstreamthroughput <value>
    nodetool setcompactionthroughput <value>
  10. Cassandra ノードが復旧したら、次のような標準コマンドを使用して、ノードがリングに正常に参加したことを確認します。
    /opt/apigee/apigee-cassandra/bin/nodetool ring
    /opt/apigee/apigee-cassandra/bin/nodetool status
  11. ノードが正常に起動して実行されていることを確認したら、/opt/apigee/customer/application/cassandra.properties ファイルを再度編集し、この手順のステップ 3 と 4 で追加した行を削除します。
  12. ノードで Cassandra サービスを再起動します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra restart

クラスタ全体を復元する

  1. クラスタ全体を停止させます。
  2. バックアップ ファイルから、すべての Cassandra ノードを復元します。
  3. Cassandra クラスタを起動します。
  4. すべてのコンポーネントを再起動します。

PostgreSQL データベース

PosgreSQL をスタンドアロンまたはマスターとして実行する

  1. すべてのノードで Management Server、Qpid Server、Postgres Server を停止します。
    /apigee/apigee-service/bin/apigee-service edge-management-server stop
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server stop
    /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
  2. PostgreSQL データベースを再インストールします。
    /apigee/apigee-service/bin/apigee-service apigee-postgresql install 
  3. PostgreSQL を起動します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql start
  4. バックアップ ファイルから PostgreSQL データベースを復元します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql restore 2019.03.17,14.40.41

    PostgreSQL コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「.dump」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. すべてのノードで Management Server、Qpid Server、Postgres Server を起動します。
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server start
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server start
    /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server start

PosgreSQL をスタンバイとして実行する

  1. PostgreSQL データベースを再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql install
  2. インストールの際と同じ構成ファイルを使用して、PostgreSQL データベースを再構成します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup -f configFile
  3. PostgreSQL を起動します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql start 

Postgres Server

  1. すべてのマスターノードとスタンバイ ノードで Postgres Server を停止します。
    /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
  2. 既存の Postgres Server ディレクトリを削除します。
    /opt/apigee/data/edge-postgres-server /opt/apigee/etc/edge-postgres-server.d
  3. Postgres Server を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server install
  4. バックアップ ファイルから Postgres Server を復元します。
    /opt/apigee/apigee-service/bin/apigee-service edge-postgre-server restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. すべてのマスターノードとスタンバイ ノードで Postgres Server を起動します。
    /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server start

Qpid Server と Qpidd

  1. すべてのノードで Qpidd、Qpid Server、Postgres Server を停止します。
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server stop
    /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
    /opt/apigee/apigee-service/bin/apigee-service apigee-qpidd stop
  2. 既存の Qpid Server と Qpidd ディレクトリを削除します。
    /opt/apigee/data/edge-qpid-server
    /opt/apigee/etc/edge-qpid-server.d
    /opt/apigee/data/apigee-qpidd
    /opt/apigee/etc/apigee-qpidd.d 
  3. Qpidd を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service apigee-qpidd install 
  4. Qpidd を復元します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-qpidd restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. Qpidd を起動します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-qpidd start 
  6. Qpid Server を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server install
  7. Qpid Server を復元します。
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  8. すべてのノードで Qpid Server、Qpidd、Postgres Server を再起動します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-qpidd restart
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server restart
    /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server restart

SymasLDAP

  1. SymasLDAP を停止します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-openldap stop
  2. SymasLDAP を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service apigee-openldap install
  3. 既存の SymasLDAP ディレクトリを削除します。
    /opt/apigee/data/apigee-openldap /opt/apigee/etc/apigee-openldap.d
  4. SymasLDAP を復元します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-openldap restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. SymasLDAP を再起動します。
    /opt/apigee/apigee-service/bin/apigee-service apigee-openldap start
  6. すべての Management Server を再起動します。
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart

管理サーバー

  1. Management Server を停止します。
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server stop
  2. 既存の Management Server ディレクトリを削除します。
    /opt/apigee/data/edge-management-server /opt/apigee/etc/edge-management-server.d
  3. Management Server を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server install
  4. バックアップ ファイルから Management Server を復元します。
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. Management Server を再起動します。
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server start

Message Processor

  1. Message Processor を停止します。
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor stop
  2. 既存の Message Processor ディレクトリを削除します。
    /opt/apigee/data/edge-message-processor
    /opt/apigee/etc/edge-message-processor.d
  3. Message Processor を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor install
  4. バックアップ ファイルから Message Processor を復元します。
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. Message Processor を再起動します。
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor start

ルーター

  1. ルーターを停止します。
    /opt/apigee/apigee-service/bin/apigee-service edge-router stop
  2. 既存のルーターのディレクトリを削除します。
    /opt/apigee/data/edge-router
    /opt/apigee/etc/edge-router.d
  3. Router を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service edge-router install
  4. バックアップ ファイルからルーターを復元します。
    /opt/apigee/apigee-service/bin/apigee-service edge-router restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. ルーターを再起動します。
    /opt/apigee/apigee-service/bin/apigee-service edge-router start

Edge UI

  1. UI を停止します。
    /opt/apigee/apigee-service/bin/apigee-service edge-ui stop
  2. 既存の UI のディレクトリを削除します。
    /opt/apigee/data/edge-ui
    /opt/apigee/etc/edge-ui.d
  3. UI を再インストールします。
    /opt/apigee/apigee-service/bin/apigee-service edge-ui install
  4. バックアップ ファイルから UI を復元します。
    /opt/apigee/apigee-service/bin/apigee-service edge-ui restore 2019.03.17,14.40.41

    コンポーネントを復元する場合、バックアップ ファイルにディレクトリ パスを指定しないでください。また、「backup-」接頭辞や「.tar.gz」接尾辞を指定しないでください。バックアップ ファイル名の日付と時刻のみを指定します。

    必要に応じて、restore コマンドのバックアップ ファイルを省略できます。その場合、コンポーネントのバックアップ ディレクトリ内の最新のバックアップ ファイルが使用されます。

  5. UI を再起動します。
    /opt/apigee/apigee-service/bin/apigee-service edge-ui start

Site Recovery を完了する

  1. すべてのコンポーネント ノードを停止します。サブシステムを停止する順序は重要なので注意してください。先にすべての Edge ノードを停止し、その後すべてのデータストア ノードを停止します。
  2. 上記のように、すべてのコンポーネントを復元します。
  3. 次に、すべてのコンポーネントを次の順序で起動します。サブシステムの起動順序は重要です。
    1. ZooKeeper クラスタを起動する
    2. Cassandra クラスタを起動する
    3. SymasLDAP が稼働していることを確認する
    4. qpid を起動します。
    5. PostgreSQL データベースが起動していることを確認します。
    6. Management Server を起動する
    7. ルーターと Message Processor を起動する
    8. Qpid Server を起動します。
    9. Postgres Server を起動する
    10. Apigee UI を起動する