ノードを使用したイベントサービスデータの移行

イベントサービス 4.5.x から 24.x バージョンへの移行に必要な時間は、データ量によって異なる場合があります。したがって、差分データとメタデータを複数回に分けて移行し、イベントサービス 24.x でカットオーバー後のデータを最小限に抑えることを推奨します。

移行のためのイベントサービス 4.5.x データの準備

  1. $APPDYNAMICS_HOME/platform/events-service/processor/conf/event-service-api-store.properties に移動し、イベントサービス 4.5.x プラットフォームで次のプロパティを有効にします。
    ad.es.node.http.enabled=true
    注: イベントサービスクラスタの各ノードでこの手順を繰り返します。
  2. Enterprise Console からイベントサービス 4.5 プラットフォームを再起動します。
  3. イベントサービス 24.x で INDEX_COMPACTION_PARENT_JOB に対するジョブ圧縮を無効にします。
    curl -H 'Content-type: application/json' -XPOST 'http://<ELB_hostname_of_Events_Service_24.x>:<ElasticSearch_Port>/job_framework_job_details_v1/_update_by_query' -d '{
    "query": {
    "term": {
    "name": "INDEX_COMPACTION_PARENT_JOB"
    }
    },
    "script": {
    "inline": "ctx._source.jobDataMap.enabled = false",
    "lang": "painless"
    }
    }'
    注: Elasticsearch の HTTP ポートは、対応するイベント サービス インスタンスの $APPDYNAMICS_HOME/platform/events-service/processor/conf/events-service-api-store.properties ファイルにある ad.es.node.http.port プロパティから検索できます。
  4. イベントサービス 24.x プラットフォームで $APPDYNAMICS_HOME/platform/events-service/processor/conf/events-service-api-store.yml 構成ファイルを編集し、reindex.remote.whitelist プロパティをカンマ区切りリスト形式で追加します。このリストの構成は次のとおりです。
    • Elasticsearch 2.x のホスト名とポート。
    • Elasticsearch 8.x のホスト名とポート。

      reindex.remote.whitelist を更新する構文

      - className: com.appdynamics.analytics.processor.elasticsearch.configuration.ElasticsearchConfigManagerModule
      properties:
      nodeSettings:
      cluster.name: ${ad.es.cluster.name}
      reindex.remote.whitelist: "<ELB_hostname_of_Events_Service_4.5.x>:<Port>,<ELB_hostname_of_Events_Service_24.x>:<Port>,<node1_hostname_of_Events_Service_4.5.x>:<Port>,<node2_hostname_of_Events_Service_4.5.x>:<Port>"
      reindex.remote.whitelist: "es2.elb.amazonaws.com:9200,es8.elb.amazonaws.com:10200,es2node1.amazonaws.com:9200,es2node2.amazonaws.com:9200,10.20.30.40:9200,10.20.30.41:9200,10.20.30.42:9200"
  5. Enterprise Console からイベントサービス 24.x プラットフォームを再起動します。
  6. 移行ユーティリティをダウンロードしたフォルダに application.yml ファイルを作成します。

    フォルダ構造

    /home/username/
    - analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar
    - config
    - application.yml

    es:
    # Target Elasticsearch hostname and port for the data migration
    #(Get this from $APPDYNAMICS_HOME/platform/events-service/processor/conf/events-service-api-store.properties ad.es.node.http.port from events-service 24.x)
    targetHostName: poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com
    targetPort: 10200
    username: admin
    password: password
    # Source Elasticsearch hostname and port for the data migration
    #(Get this from $APPDYNAMICS_HOME/platform/events-service/processor/conf/events-service-api-store.properties ad.es.node.http.port from events-service 4.x)
    sourceHostName: poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com
    sourcePort: 9200
    # Maximum number of retries per index during the migration
    maxRetriesPerIndex: 3
    # Delay in milliseconds between each retry attempt
    delayBetweenRetry: 2000
    # Set this to true if you want to use an external version for iteration 2 and subsequent,
    # or false if you want to use an internal version for migration.
    useExternalVersion: true
    clusters:
    source:
    api:
    keys:
    # Controller API key for the source Elasticsearch v2.x cluster
    #(Get this from $APPDYNAMICS_HOME/platform/events-service/processor/conf/events-service-api-store.properties ad.accountmanager.key.controller  from events-service 4.x)
    CONTROLLER: ba1140cb-ad2b-4a74-8f2f-2ba3648a99c5
    # OPS API key for the source Elasticsearch v2.x cluster
    #(Get this from $APPDYNAMICS_HOME/platform/events-service/processor/conf/events-service-api-store.properties ad.accountmanager.key.ops  from events-service 4.x)
    OPS: "ba339ff3-4244-4aa5-a458-acb66332aeb6"
    # API hostname and port of the source events-service cluster
    # Get the port from the events-service-api-store.properties file ad.dw.http.port from events-service 4.x
    api: http://poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com:9080
    # Provide the absolute path of the certificate (if needed) for the source events-service cluster
    cert: ""
    # Set this to true if you want to verify the hostname when creating the SSL context
    # or false to skip the hostname verification.
    check: false
    elasticsearch:
    # URL and internal URL of the source Elasticsearch v2.x cluster
    #(Get this from $APPDYNAMICS_HOME/appdynamics/platform/events-service/processor/conf/events-service-api-store.properties ad.es.node.http.port from events-service 4.x)
    url: http://poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com:9200
    internal: http://poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com:9200
    # Elasticsearch version of the source cluster (v2.x in this case)
    version: 2
    protocol: http #Provide the scheme to connect to the elasticsearch Valid option : {http}
    destination:
    # URL and internal URL of the destination Elasticsearch v8.x cluster
    api:
    keys:
    # URL and internal URL of the source Elasticsearch v2.x cluster
    #(Get this from $APPDYNAMICS_HOME/appdynamics/platform/events-service/processor/conf/events-service-api-store.properties ad.es.node.http.port from events-service 4.x)
    CONTROLLER: ba1140cb-ad2b-4a74-8f2f-2ba3648a99c5
    # OPS API key for the destination Elasticsearch v8.x cluster
    # Get this from $APPDYNAMICS_HOME/platform/events-service/processor/conf/events-service-api-store.properties ad.accountmanager.key.ops from events-service 24.x
    OPS: "ba339ff3-4244-4aa5-a458-acb66332aeb6"
    # API hostname and port of the destination events-service cluster (not Elasticsearch v8.x cluster)
    # Get the port from the events-service-api-store.properties file ad.dw.http.port from events-service 4.x
    api: "http://poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com:10080"
    # Provide the absolute path of the certificate (if needed) for the source events-service cluster
    cert: ""
    # Set this to true if you want to verify the hostname when creating the SSL context
    # or false to skip the hostname verification.
    check: false
    elasticsearch:
    # URL and internal URL of the source Elasticsearch v2.x cluster
    #(Get this from $APPDYNAMICS_HOME/appdynamics/platform/events-service/processor/conf/events-service-api-store.properties ad.es.node.http.port from events-service 4.x)
    url: http://poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com:10200
    internal: http://poc-3tb-console-1177482667.us-west-2.elb.amazonaws.com:10200
    # Elasticsearch version of the source cluster (v2.x in this case)
    version: 8
    protocol: http #Provide the scheme to connect to the elasticsearch Valid options : {http, https}
    trustStoreFile: "client-ca.cer"
    elasticsearchUsername: ""
    elasticsearchPassword: ""
    migration:
    # Number of search hits per request during migration,
    search_hits: 5000
    # Number of concurrent reindex requests during migration (based on CPU cores), maximum value recommended is 8.
    reindex_concurrency: 4
    # Batch size for scrolling through search results during migration, reduce this if you hit the exception : Remote responded with chunk size
    reindex_scroll_batch_size: 5000
    # Number of reindex requests per second during migration
    reindex_requests_per_second: 8000
    # Threshold size in bytes for large rollovers during migration (60GB in this case)
    # TO DO: Detailed property explanation
    large_rollover_threshold_size_bytes: 60000000000 # 60 GB
    # Threshold size in bytes for small rollovers during migration (20GB in this case)
    small_rollover_threshold_size_bytes: 20000000000 # 20 GB
    # Required low disk size watermark during migration (85% in this case)
    required_low_disk_size_watermark: 85
    #SQLite3 configuration for status monitoring
    spring:
    jpa:
    properties:
    hibernate:
    # Hibernate dialect for SQLite database
    dialect: org.hibernate.community.dialect.SQLiteDialect

カットオーバー方法を使用したイベントサービスデータの移行

  1. イベントサービス 4.5.x プラットフォームを送信元として、イベントサービス 24.x を宛先として維持し、移行ユーティリティを実行します。
    1. イベントサービス 4.5.x インデックスをロールオーバーします。
      nohup java -jar analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar rollover > rollover_output.log 2>&1 &
    2. データとメタデータをイベントサービス 4.5.x から 24.x に移行します。
      nohup java -jar analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar data > data_output.log 2>&1 &
      nohup java -jar analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar metadata > metadata_output.log 2>&1 &
  2. 差分をイベントサービス 4.5.x から 24.x プラットフォームに移行します。
    nohup java -jar analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar data > delta_data_output.log 2>&1 &
    nohup java -jar analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar metadata > delta_metadata_output.log 2>&1 &
    注:
    • イベントサービス 4.5.x の差分が最小になるまで、この手順を繰り返すことをお勧めします。ログを使用して、差分を移行するために各反復でどのくらいの時間がかかるかを判断します。反復にかかった合計時間が以前よりも大幅に短い場合は、イベントサービス 4.5.x クラスタの差分が減少したことを示します。最後の 2 回の反復で移行にほぼ同じ時間がかかる場合は、反復を停止できます。たとえば、最後の反復で 30 秒かかり、前の反復でも 30 秒近くかかっている場合、差分は最小であると見なすことができます。

    • 差分の移行とカットオーバー移行後の時間差を短縮します。これにより、カットオーバー後に移行するデータが最小限に抑えられます。

    2023-08-09T21:52:43.116+05:30  INFO 87453 --- [           main] c.a.analytics.onprem.MigrationTool       : Total time taken: 30 seconds

    イベントサービス 4.5.x クラスタの差分が最小の場合、ロードバランサポートを更新できます。イベントサービス 4.5.x トラフィックがイベントサービス 24.x に流れるように、ロードバランサ設定のインスタンスポート番号のみを変更します。これにより、イベントサービス 4.5.x の着信トラフィックがイベントサービス 24.x プラットフォームにリダイレクトされ、カットオーバーフェーズが開始されます。次に設定例を示します。

    プラットフォーム ポートロードバランサの設定
    ロードバランサポートインスタンスポート
    イベントサービス 24.x10080、1008110080、1008110080、10081
    イベントサービス 4.5.x9080、90819080、908110080、10081
    注: アクティブなセッションまたはトランザクションがある場合、一部のデータが失われる可能性があります。
  3. 任意のイベントサービスノードのホスト名を送信元および宛先として維持して、application.yml ファイルを更新します。次に、ファイルの例を示します。
    es:
      targetHostName: <Node 1 IP Address>
      targetPort: 10200
      username: admin
      password: password
      sourceHostName: <Node 1 IP Address>
      sourcePort: 9200
      maxRetriesPerIndex: 3
      delayBetweenRetry: 2000
      useExternalVersion: true # Set this to true, if you want to use external version to be used for iteration 2 and subsequent. False, if you want to use internal
    
    clusters:
      source:
        api:
          keys:
            CONTROLLER: ba1140cb-ad2b-4a74-8f2f-2ba3648a99c5
            OPS: "ba339ff3-4244-4aa5-a458-acb66332aeb6"
          api: http://<Node 1 IP Address>:9080
          cert: ""
          check: false
        elasticsearch:
          url: http://<Node 1 IP Address>:9200
          internal: http://<Node 1 IP Address>:9200
          version: 2
          protocol: http #Provide the scheme to connect to the elasticsearch Valid option : {http}
      destination:
        api:
          keys:
            CONTROLLER: ba1140cb-ad2b-4a74-8f2f-2ba3648a99c5
            OPS: "ba339ff3-4244-4aa5-a458-acb66332aeb6"
          api: "http://<Node 1 IP Address>:10080"
          cert: ""
          check: false
        elasticsearch:
          url: http://<Node 1 IP Address>:10200
          internal: http://<Node 1 IP Address>:10200
          version: 8
          protocol: http #Provide the scheme to connect to the elasticsearch Valid options : {http, https}
          trustStoreFile: "client-ca.cer"
          elasticsearchUsername: ""
          elasticsearchPassword: ""
    
    migration:
      search_hits: 5000
      reindex_concurrency: 4
      reindex_scroll_batch_size: 5000
      reindex_requests_per_second: 8000
      large_rollover_threshold_size_bytes: 60000000000 # 60 GB
      small_rollover_threshold_size_bytes: 20000000000 # 20 GB
      required_low_disk_size_watermark: 85
    
    spring:
      jpa:
        properties:
          hibernate:
            dialect: org.hibernate.community.dialect.SQLiteDialect
  4. 次のコマンドを実行して、カットオーバー後のデータをイベントサービス 4.5.x から 24.x に移行します。
    nohup java -jar analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar post_cutover_metadata > post_cutover_metadata_output.log 2>&1 &
    nohup java -jar analytics-on-prem-es2-es8-migration-LATESTVERSION-exec.jar post_cutover_data > post_cutover_data_output.log 2>&1 &
  5. イベントサービス 24.x で INDEX_COMPACTION_PARENT_JOB を有効にします。
    curl -H 'Content-type: application/json' -XPOST 'http://<ELB_hostname_of_Events_Service_24.x>:<ElasticSearch_Port>/job_framework_job_details_v1/_update_by_query' -d '{
    
    
     "query": {
      "term": {
       "name": "INDEX_COMPACTION_PARENT_JOB"
      }
     },
     "script": {
      "inline": "ctx._source.jobDataMap.enabled = true",
      "lang": "painless"
     }
これで、イベントサービス 24.x プラットフォームが同期されました。移行ステータスを確認し、移行が成功した場合は、イベントサービス 4.5.x プラットフォームを削除できます。