warden icon indicating copy to clipboard operation
warden copied to clipboard

OpenSearch support

Open batmike opened this issue 3 years ago • 7 comments

With the upcoming 2.4.4 release of Adobe, OpenSearch will be supported and Cloud installations will require it as well. With that, I'm wondering if it's possible to install OpenSearch into a Warden environment instead of Elasticsearch?

Thanks!

batmike avatar Feb 23 '22 18:02 batmike

Worth mentioning that Elasticsearch 7.16 and 7.17 will be supported by 2.4.4 and 2.4.5 respectively as well per the M2 release notes, so it should work just fine with an official ES image in-use. However, if you do want to use an OpenSearch image that you provide, it should be fairly simple to override the image via .warden/warden-env.yml file. Take a look at https://docs.warden.dev/environments/customizing.html for a few examples of how to use that file, but it can basically be used to change anything you see in the output of warden env config (the fully rendered docker-compose configuration)

davidalger avatar Feb 24 '22 00:02 davidalger

It would still be nice to have core Warden support for OpenSearch when it is also supported by Magento. So my wish would be to keep this open until OpenSearch is supported by Warden natively :)

sprankhub avatar Feb 24 '22 08:02 sprankhub

@davidalger Thanks for the note about Elasticsearch and for our use and development, that will work just fine as we don't have to replicate our Cloud instance exactly - and we use a separate site search service in production as well.

However, I agree with @sprankhub that core support for OpenSearch would be a great added feature at some point :)

batmike avatar Feb 24 '22 19:02 batmike

Added image build for OpenSearch 1.1, 1.2 and 1.3 in b49b75fb7. The plugin installs fail on 1.0, hence the omission.

https://hub.docker.com/r/wardenenv/opensearch/tags

At the moment, they can only be used by overriding the image via config in the project's .warden/warden-env.yml file.

davidalger avatar Apr 04 '22 04:04 davidalger

Managed to replace elastic with opensearch with following .warden/warden-env.yml:

version: "3.5"
services:
  elasticsearch:
    environment:
      - DISABLE_SECURITY_PLUGIN=true
    image: ${WARDEN_IMAGE_REPOSITORY}/opensearch:1.3
  elasticsearch-hq:
    profiles:
      - donotstart

Unfortunately opensearch doesn't start with xpack.security.enabled: "false" variable which is coming from elasticsearch.base.yml and I didn't find a way to replace it with warden-env.yml since options are simply merged, had to temporary remove it directly in that file. Hope this will be useful for someone

Zifius avatar May 11 '22 11:05 Zifius

@Zifius - This works great! Thanks for the work on getting this to function. That note about editing the elasticsearch.base.yml is especially helpful (and easy to forget!).

batmike avatar May 11 '22 17:05 batmike

I added - xpack.security.enabled= to @Zifius warden-env.yml so I didn't have to edit the elasticsearch.base.yml. I have been able to bring up ES or OS.

version: "3.5"
services:
  elasticsearch:
    environment:
      - DISABLE_SECURITY_PLUGIN=true
      - xpack.security.enabled=
    image: ${WARDEN_IMAGE_REPOSITORY}/opensearch:1.3
  elasticsearch-hq:
    profiles:
      - donotstart

ptrollins avatar Jul 01 '22 19:07 ptrollins

@ptrollins , when I use your config file, I get the following error message: Unsupported config option for services.elasticsearch-hq: 'profiles'. Do you have any idea, what I'm doing wrong?

norgeindian avatar Nov 03 '22 13:11 norgeindian

@norgeindian did you set "ELASTICSEARCH_VERSION"=7.16 in .env? I realized that's probably not the issue. Check docker-compose ---version and make sure it is 1.28 or greater. It looks like "Docker Compose 1.28.0 introduced support for a profiles key."

ptrollins avatar Nov 04 '22 00:11 ptrollins

Hello everyone regarding the usage of opensearch over elasticsearch in Magento 2 environment, has anyone else encountered the issue of losing indexed data on every down / up combo? I've been having issues with categories requiring reindexing to show products after every start. This was not the case when using elasticsearch

tommi-martin avatar Nov 17 '22 06:11 tommi-martin

@ptrollins , thanks for the hint. Will check.

norgeindian avatar Nov 17 '22 07:11 norgeindian

Added in 2bd95457748c1d639dc6109018d963ff624137ac. Will be present in next release.

navarr avatar Jan 17 '23 04:01 navarr