This repository was archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Updated best practices and deployment info #5823
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7c37390
Updated best practices and deployment info
meker12 239be0d
Added elasticsearch compatibility check
meker12 6a0c956
Merge branch 'master' into mae-MAGECLOUD-4326-updates
meker12 c99133f
Fixed linting error and minor editorial updates
meker12 175c519
Merge branch 'mae-MAGECLOUD-4326-updates' of github.com:magento/devdo…
meker12 285dfd1
Updated the Additional search configuration section
meker12 1d9c943
Fixed linting errors
meker12 4effbb8
Update guides/v2.2/cloud/project/project-conf-files_services-elastic.md
meker12 0a179f4
Update guides/v2.2/cloud/project/project-conf-files_services-elastic.md
meker12 ea9de59
Removed duplicate information
meker12 a5219f1
Apply suggestions from code review
meker12 ae4fee3
Replaced command for retrieving elasticsearch info
meker12 c6266b1
Removed trailing spaces
meker12 b919da4
Merge branch 'master' into mae-MAGECLOUD-4326-updates
meker12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The following table lists compatible versions of the Elasticsearch software supported by {{ site.data.var.ee }}. | ||
|
||
Elasticsearch service | Elasticsearch composer package | Status | ||
--------- | ------------- | ------------------------- | ||
1.7 – 2.4.x| 2.x.x | deprecated | ||
5.2.x | 5.x.x | default versions for {{ site.data.var.ee }} versions 2.2.x - 2.2.7 and 2.3.0 | ||
6.x | 6.x | recommended, default versions for {{ site.data.var.ee }} versions 2.2.8 and 2.3.1 and later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,8 @@ functional_areas: | |
|
||
{% include cloud/service-config-integration-starter.md %} | ||
|
||
{: .bs-callout-warning} | ||
Staging and Production environments that are in the same cluster share a single Elasticsearch instance, so you must specify a unique Elasticsearch prefix for each of these environments. | ||
{:.bs-callout-tip} | ||
Magento recommends that you always set up Elasticsearch for your {{ site.data.var.ece }} project even if you plan to configure a third-party search tool for your {{ site.data.var.ee }} application. Setting up Elasticsearch provides a fallback option in the event that the third-party search tool fails. | ||
|
||
{:.procedure} | ||
To enable Elasticsearch: | ||
|
@@ -30,6 +30,9 @@ To enable Elasticsearch: | |
disk: 1024 | ||
``` | ||
|
||
{:.bs-callout-info} | ||
For details on determining the correct version to install, see [Elasticsearch software compatibility](#elasticsearch-software-compatibility). | ||
|
||
1. Set the `relationships` property in the `.magento.app.yaml` file. | ||
|
||
```yaml | ||
|
@@ -59,11 +62,120 @@ To enable Elasticsearch: | |
bin/magento cache:clean | ||
``` | ||
|
||
## Elasticsearch software compatibility | ||
|
||
When you install or upgrade your {{ site.data.var.ece }} project, always check for compatibility between the Elasticsearch service version and the [Elasticsearch PHP](https://github.com/elastic/elasticsearch-php) client for {{ site.data.var.ee }}. | ||
|
||
- **First time setup**–Confirm that the Elasticsearch version specified in the `services.yaml` file is compatible with the Elasticsearch PHP client configured for {{ site.data.var.ee }}. | ||
|
||
- **Project upgrade**–Verify that the Elasticsearch PHP client in the new Magento version is compatible with the Elasticsearch service version installed on the Cloud infrastructure. | ||
|
||
{% include cloud/cloud-elasticsearch-client-compatibility.md %} | ||
|
||
{:.procedure} | ||
To check Elasticsearch software compatibility: | ||
|
||
1. Use SSH to log in to the remote environment. | ||
|
||
1. Check the Composer package version for `elasticsearch/elasticsearch`. | ||
|
||
```bash | ||
composer show elasticsearch/elasticsearch | ||
``` | ||
|
||
In the response, check the installed version in the `versions` property. | ||
|
||
```terminal | ||
name : elasticsearch/elasticsearch | ||
descrip. : PHP Client for Elasticsearch | ||
keywords : client, elasticsearch, search | ||
versions : * v6.7.1 | ||
type : library | ||
license : Apache License 2.0 (Apache-2.0) (OSI approved) https://spdx.org licensesApache-2.0.html#licenseText | ||
source : [git] https://github.com/elastic elasticsearch-php.git7be453dd36d1b141b779f2cb956715f8e04ac2f4 | ||
dist : [zip] https://api.github.com/repos/elastic/elasticsearch-php/zipball/ 7be453dd36d1b141b779f2cb956715f8e04ac2f4 7be453dd36d1b141b779f2cb956715f8e04ac2f4 | ||
path : /app/vendor/elasticsearch/elasticsearch | ||
names : elasticsearch/elasticsearch | ||
``` | ||
|
||
Also, you can find the Elasticsearch PHP client version in the `composer.lock` file in the environment root directory. | ||
|
||
1. From the command line, retrieve the Elasticsearch service connection details. | ||
|
||
```bash | ||
vendor/bin/ece-tools env:config:show services | ||
``` | ||
|
||
In the response, find the IP address for the Elasticsearch service endpoint: | ||
|
||
```terminal | ||
| elasticsearch: | | ||
+------------------------------------------+----------------------------------------------------------------------+ | ||
| username | null | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would manually remove some of the white space from the first column. It really takes up a lot of screen space and might be annoying for someone on a mobile device. |
||
| scheme | http | | ||
| service | elasticsearch | | ||
| fragment | null | | ||
| ip | 169.254.220.11 | | ||
| hostname | dzggu33f75wi3sd24lgwtoupxm.elasticsearch.service._.magentosite.cloud | | ||
| public | false | | ||
| cluster | fo3qdoxtla4j4-master-7rqtwti | | ||
| host | elasticsearch.internal | | ||
| rel | elasticsearch | | ||
| query | | | ||
| path | null | | ||
| password | null | | ||
| type | elasticsearch:6.5 | | ||
| port | 9200 | | ||
+------------------------------------------+----------------------------------------------------------------------+ | ||
``` | ||
|
||
1. Retrieve the installed Elasticsearch service `version:number` from the service endpoint. | ||
|
||
```bash | ||
curl -XGET <elasticsearch-service-endopint-ip-address>:9200/ | ||
``` | ||
|
||
```terminal | ||
{ | ||
"name" : "-AqGi9D", | ||
"cluster_name" : "elasticsearch", | ||
"cluster_uuid" : "_yze6-ywSEW1MaAF8ZPWyQ", | ||
"version" : { | ||
"number" : "6.5.4", | ||
"build_flavor" : "default", | ||
"build_type" : "deb", | ||
"build_hash" : "82a8aa7", | ||
"build_date" : "2019-01-23T12:07:18.760675Z", | ||
"build_snapshot" : false, | ||
"lucene_version" : "7.5.0", | ||
"minimum_wire_compatibility_version" : "5.6.0", | ||
"minimum_index_compatibility_version" : "5.0.0" | ||
}, | ||
" tagline" : "You Know, for Search" | ||
} | ||
``` | ||
|
||
1. Check version compatibility between the Elasticsearch service and the PHP client. | ||
|
||
If the versions are incompatible, make one of the following updates to your environment configuration: | ||
|
||
- Change the Elasticsearch service version in the `services.yaml` file to a version that is compatible with the Elasticsearch PHP client. On Pro Staging and Production environments, you must submit a support ticket to change the Elasticsearch service version. | ||
|
||
- [Change the Elasticsearch PHP client]({{ page.baseurl }}/config-guide/elasticsearch/es-downgrade.html) to a version that is compatible with the Elasticsearch service version. | ||
|
||
## Restart the Elasticsearch service | ||
|
||
If you need to restart the [Elasticsearch](https://www.elastic.co) service, you must contact Magento support. | ||
|
||
## Elasticsearch plugins | ||
## Additional search configuration | ||
|
||
- By default, the search configuration for Cloud environments regenerates each time you deploy. You can use the `SEARCH_CONFIGURATION` deploy variable to retain custom search settings between deployments. See [Deploy variables]({{ page.baseurl }}/cloud/env/variables-deploy.html#search_configuration). | ||
|
||
- {{ site.data.var.ece }} projects provisioned with a shared Production and Staging environment use a single Elasticsearch instance, so you must specify a unique _Elasticsearch Index prefix_ for each of these environments. See [Configure Magento to use Elasticsearch]({{ page.baseurl}}/config-guide/elasticsearch/configure-magento.html) in the _Configuration Guide_. | ||
|
||
- After you set up the Elasticsearch service for your project, use the Magento Admin UI to test the Elasticsearch connection and customize Elasticsearch settings for {{ site.data.var.ee }}. | ||
|
||
### Elasticsearch plugins | ||
|
||
Optionally, you can add Elasticsearch plugins by adding the `configuration:plugins` section to the `.magento/services.yaml` file. For example, the following code enables the ICU analysis plugin and Python script support plugins. | ||
|
||
|
@@ -77,4 +189,4 @@ elasticsearch: | |
- lang-python | ||
``` | ||
|
||
If you use the ElasticSuite third-party plugin, you must [update the `{{site.data.var.ct}}` package]({{page.baseurl}}/cloud/project/ece-tools-update.html) to version 2002.0.19 or later. | ||
If you use the ElasticSuite third-party plugin, you must [update the `{{site.data.var.ct}}` package]({{page.baseurl}}/cloud/project/ece-tools-update.html) to version 2002.0.19 or later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAY!