Running Elasticsearch locally with multiple nodes
mikko.ropanen
Spryker Solution Partner Posts: 28 ✨ - Novice
Hi, we ran into the "inconsistent scoring" issue
in our production environment. While the fix was pretty simple (change search_type to dfs_query_then_fetch), I currently don't have a way of verifying it since production AWS is the only place that uses more than one ES node.Is there a way to run Elasticsearch locally with more than one node?
Tagged:
0
Best Answer
-
You could try the following approach:
- Stop the project
docker/sdk stop
- Comment out the section in the deploy file
deploy.dev.yml
# search: # engine: elastic # version: '7.10' # endpoints: # localhost:9200: # protocol: tcp
- Add the following environment variables to the section
image: … environment: … SPRYKER_SEARCH_HOST: host.docker.internal SPRYKER_SEARCH_PORT: 9200
host.docker.internal
in the case of using Docker Desktop- [OPTIONAL] The above steps could be performed in the
deploy.local.yml
created based ondeploy.dev.yml
. The former is in.gitignore
- Run the Elastic cluster based on the section
Starting a multi-node cluster with Docker Compose
of the documentation - Boot the project
docker/sdk boot deploy.dev.yml
(ordeploy.local.yml
) - Build and run the project as usually
1 - Stop the project
Answers
-
You could try the following approach:
- Stop the project
docker/sdk stop
- Comment out the section in the deploy file
deploy.dev.yml
# search: # engine: elastic # version: '7.10' # endpoints: # localhost:9200: # protocol: tcp
- Add the following environment variables to the section
image: … environment: … SPRYKER_SEARCH_HOST: host.docker.internal SPRYKER_SEARCH_PORT: 9200
host.docker.internal
in the case of using Docker Desktop- [OPTIONAL] The above steps could be performed in the
deploy.local.yml
created based ondeploy.dev.yml
. The former is in.gitignore
- Run the Elastic cluster based on the section
Starting a multi-node cluster with Docker Compose
of the documentation - Boot the project
docker/sdk boot deploy.dev.yml
(ordeploy.local.yml
) - Build and run the project as usually
1 - Stop the project
-
The above solution works nicely 👍️
If anyone else is not using Docker Desktop and gets fixated on the "host.docker.internal" part like I did:
you can just use "es01" (the name of the first Elasticsearch node)2
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 896 Developer Corner
- 758 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 23 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random