Upgrading to Elasticsearch 6

Elasticsearch 6 is supported for Digital Enterprise subscribers. The exact supported Elasticsearch version range depends on the Fix Pack Level: consult the compatibility matrix for details. Community Edition users running 7.0 CE GA 7 or greater can use up to Elasticsearch 6.1.x. If you’re not already running a remote Elasticsearch 2.x server, follow the installation guide to install Elasticsearch 6 and the configuration guide to configure the Elasticsearch adapter. Here, you’ll learn to upgrade an existing Elasticsearch 2.x server (or cluster) to Elasticsearch 6.5.x:

  1. Install and configure Elasticsearch 6.5.x.

  2. Download the Elasticsearch 6 adapter from Liferay Marketplace.

  3. Stop the default Elasticsearch adapter.

  4. Stop the Elasticsearch 2.4 server.

  5. Start Elasticsearch 6.

  6. Install and configure the Elasticsearch 6 adapter.

  7. Re-index all search and spell check indexes.

Before Proceeding: Back up your existing data before upgrading Elasticsearch. If something goes wrong during or after the upgrade, roll back to 2.x using the uncorrupted index snapshots. See here for more information.

Installing Elasticsearch 6.5

  1. Download Elasticsearch 6.5.x and unzip it wherever you please.

  2. Name the cluster by configuring the cluster.name property in elasticsearch.yml:

    cluster.name: LiferayElasticsearchCluster
  3. Install the following required Elasticsearch plugins:

    • analysis-icu
    • analysis-kuromoji
    • analysis-smartcn
    • analysis-stempel
  4. To install these plugins, navigate to Elasticsearch Home and enter

    ./bin/elasticsearch-plugin install [plugin-name]
  5. Replace [plugin-name] with the Elasticsearch plugin’s name.

  6. Once installed, start Elasticsearch 6 by running


    from Elasticsearch Home.

Download the Elasticsearch 6 Adapter

Download the Elasticsearch 6 adapter LPKG from Liferay Marketplace.

Stop the Elasticsearch Adapter and Elasticsearch 2.x

Before installing the Elasticsearch 6 adapter, you must stop the running Elasticsearch adapter that ships with Liferay DXP.

Blacklist the Elasticsearch, Shield, and Marvel plugins. Create a


file with these contents:


Place the file in Liferay Home/osgi/configs.

Alternatively, use the App Manager.

  1. Navigate to Control Panel → Apps → App Manager.

  2. Search for elasticsearch. Find the Liferay Portal Search Elasticsearch module and click the edit ((Edit)) button. Choose the Deactivate option. This leaves the bundle installed, but stops it in the OSGi runtime.

  3. If you’re using the Shield and Marvel integration plugins, make sure you uninstall those, too.

Then stop Elasticsearch 2.x. If you’re wondering whether your log should be complaining vociferously at this point, the answer is a definitive yes. You’ll resolve that in the next step.

Install and Configure the Elasticsearch 6 Adapter

Once the default adapter is stopped, install the Elasticsearch 6 adapter (the LPKG you downloaded) by placing it in your Liferay Home folder’s deploy folder. See here for more information.

Now configure the adapter to find your Elasticsearch cluster by specifying the correct Cluster Name and setting Operation Mode to REMOTE. Make sure the Transport Address matches the one Elasticsearch is using. If testing locally with Elasticsearch’s default settings, the default value in the adapter works fine (localhost:9300).


Once the Elasticsearch adapter is installed and talking to the Elasticsearch cluster, navigate to Control PanelConfigurationServer Administration, and click Execute for the Reindex all search indexes entry.

You must also re-index the spell check indexes.

Reverting to Elasticsearch 2

Stuff happens. If that stuff involves an unrecoverable failure during the upgrade to Elasticsearch 6, roll back to Elasticsearch 2 and regroup.

Since Elasticsearch 2 and Elasticsearch 6 are two separate installations, this procedure is straightforward:

  1. Stop and remove the Elasticsearch 6 adapter.

  2. Reinstall the Elasticsearch 2 adapter.

  3. Make sure that elasticsearch.yml and the Elasticsearch 2 adapter’s configuration are configured to use the same port (9200 by default).

Learn more about configuring Elasticsearch in this article.

« Backing Up ElasticsearchSecuring Elasticsearch 6.5 with X-Pack »
0 人中有 0 人觉得有帮助