legacy-knowledge-base
公開されました Jul. 2, 2025

Elasticsearch クラスターを初期化できません。ヘルス ステータスは赤です

written-by

Jose Jimenez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • 検索クラスターが RED の場合、Liferay サービス (DXP) が起動しないか、検索機能なしで起動します。 通常、RED ステータスは、データの損失またはデータの破損により、検索クラスターのステータスが一貫していないことを意味します。
  • Liferay サービスの起動ログに次のエラーが表示されます。
    [dxp] ERROR [main][PortalInstances:271] java.lang.IllegalStateException: Unable to initialize Elasticsearch cluster: {_clusterHealthStatus=RED, _healthStatusMessage='{"cluster_name":"liferay_cluster","status":"red","timed_out":true,"number_of_nodes":3,"number_of_data_nodes":3,"active_primary_shards":22,"active_shards":728,"relocating_shards":0,"initializing_shards":0,"unassigned_shards":8,"delayed_unassigned_shards":0,"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0,"active_shards_percent_as_number":90.29629629629629}'}
  • エラーは、検索サービスのシェルにアクセスし、REST API を使用して確認できます:
    curl -X GET search:9200/_cat/health
    curl -X GET search:9200/_cluster/allocation/explain?かわいい

ソリューション

  • これを解決するにはいくつかの方法があります:

    OPTION 1 (推奨)

    1. 検索インスタンスでシェルを開き、 curl -X GET search:9200/_cat/indices を実行して影響を受けるインデックスを確認し、 red の各インデックスについて、 curl -X DELETE search:9200/ を実行して削除します。 name-of-the-index-in-red
      elasticsearch クラスターは YELLOW に移動し、次に GREEN に移動します。 これは、検索サービス ログまたは curl -X GET search:9200/_cat/healthで確認できます。
    2. Liferay サービスを再起動して、検索エンジン接続を機能させます。
    3. Liferay DXP インスタンスで、管理者としてサインインし、 コントロール パネル > 構成 > 検索 から 完全再インデックス を実行して、インデックス内の情報を復元します。

    オプション 2

    最後のオプションが機能しない場合、これはクリーン/空の検索インストールを取得する方法です。
    1. 検索サービスのデータ パスにマウントされたボリュームに別の名前を構成します。名前は search/LCP.jsonで変更できます。
    2. 実行中の検索サービスをコンソールから削除します。
    3. 変更を加えたビルドをデプロイします。
    4. 最後のステップに Liferay サービスが含まれていない場合は、Liferay を再起動します。これにより、検索エンジン接続が機能します。
    5. Liferay DXP インスタンスで、管理者としてサインインし、 コントロール パネル > 構成 > 検索 から 完全再インデックス を実行して、インデックス内の情報を復元します。

    2 番目のオプションのハンディキャップは、正常な検索クラスターがある場合でも、他の環境でプロセスを繰り返さなければならないことです。これは、検索のボリュームを変更する新しいビルドが含まれているためです。移植可能なビルドが必要な場合は、調整する必要があります。異なる環境でのボリューム名。

追加情報

  • この修正により、次のような状況で Liferay DXP サービスを開始できますが、検索機能が失われます: LPS-121782

did-this-article-resolve-your-issue

legacy-knowledge-base