Announcements
Liferay PaaSでのElasticsearchのアップグレード
ja
概要
Liferay PaaS環境で、あるバージョンの検索から別のバージョンの検索に移行するには、単にLCP.jsonを更新するだけでなく、さらにいくつかのステップが必要です。この記事では、検索のアップグレードをスムーズに完了するために必要な追加手順について説明します。
DXP 7.2
デフォルトでは、DXP 7.2は Elasticsearch 6 で動作するように設定されています。これは、バンドルされているコネクタアプリケーションとAPIが Elasticsearch 6 用であることを意味します。Elasticsearch 7 コネクタをインストールする前に、これらを無効にする必要があります。
手順 1: LCP.jsonを更新する
search/LCP.json を新しいElasticsearch 7.xのバージョンに更新し、以下の手順を実行します。(例: "image": "liferaycloud/elasticsearch:7.17.18-5.3.0")
# search/LCP.json
{
"kind": "StatefulSet",
"id": "search",
"image": "liferaycloud/elasticsearch:7.17.18-5.3.0",
[...]
}
手順 2: Elasticsearch 6 コネクタのブラックリスト化
次のような名前で .config ファイルを作成します。
com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config
以下の内容を .config ファイルに追加し、liferay/configs/[ENV]/osgi/configs/ ファイルパスに配置します。
blacklistBundleSymbolicNames=[ \
"com.liferay.portal.search.elasticsearch6.api", \
"com.liferay.portal.search.elasticsearch6.impl", \
"com.liferay.portal.search.elasticsearch6.spi", \
"com.liferay.portal.search.elasticsearch6.xpack.security.impl", \
"Liferay Connector to X-Pack Security [Elastic Stack 6.x] - Impl", \
"Liferay Enterprise Search Security - Impl.lpkg" \
]
手順 3: Elasticsearch 7 コネクタをインストールする
Liferay DXP 7.2 および Elasticsearchサーバーのバージョン(互換性マトリックス)に従って、Elasticsearch 7のLiferay Connectorをダウンロードします。 ダウンロードした lpkgファイルを解凍し、liferay/configs/[ENV]/osgi/marketplace/ ファイルパスに配置します。
手順 4: Liferay DXP 7.2用にコネクタを設定する
次のような名前で .config ファイルを作成します。
com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config
以下の内容を .config ファイルに追加し、liferay/configs/[ENV]/osgi/configs/ ファイルパスに配置します。
operationMode="REMOTE"
indexNamePrefix="liferay-"
transportAddresses="search:9300"
clusterName="liferay_cluster"
liferay/configs/[ENV]/ フォルダは次のようになります。
|- osgi
| |- configs
| | |- com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config
| | |- com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config
| |- marketplace
| | |- Liferay Connector to Elasticsearch 7 - API.1pkg
| | |- Liferay Connector to Elasticsearch 7 - Impl.lpkg
| | |- Liferay Connector to Elasticsearch 7 - SPI.lpkg
手順 5: 起動と再インデックス
以下の手順を実行して、インストールが正常に完了し、サイトにインデックスされていることを確認します。
- 起動時のログに以下のブラックリストに登録されたバンドルメッセージが表示されることを確認する。
INFO [ModuleFramework-Static-Bundles-2][BundleBlacklist:188] Stopping blacklisted bundle com.liferay.portal.search.elasticsearch6.impl_3.0.101
INFO [ModuleFramework-Static-Bundles-2][BundleBlacklist:188] Stopping blacklisted bundle com.liferay.portal.search.elasticsearch6.api_3.1.15 [512]
INFO [ModuleFramework-Static-Bundles-2][BundleBlacklist:188] Stopping blacklisted bundle com.liferay.portal.search.elasticsearch6.spi_4.0.1 [843] - コントロールパネル > 設定 > 検索 > インデックス アクションへ移動し、Elasticsearchのバージョンが更新されていることを確認する。
- コントロールパネルの同じセクションで、実行ボタンをクリックしてすべての検索インデックスを再インデックスし、すべてのスペルチェックインデックスを1つずつ再インデックスしてポータルを完全に再インデックスします。
DXP 7.3 および 7.4
7.3 および 7.4 でElasticsearchをアップグレードする場合は、上記のセクションの手順 1と手順 5のみが必要です。