# Elastic search in docker

**URL:** <https://forum.litium.com/t/elastic-search-in-docker/1316>\
**Category:** Questions\
**Tags:** litium-7\
**Created:** [February 6, 2020, 3:01pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316 "2020-02-06T15:01:00Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 6, 2020, 3:01pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/1 "2020-02-06T15:01:00Z")

</div>

I just upgraded a solution from 7.3 to 7.4. Now I am tying to setup Elastic search using docker but when I run docker-compose up it successfuly starts all containers (redis, kibana) but when it comes to elastic search I get this exception:

```auto
elasticsearch | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
elasticsearch | @ WARNING: plugin requires additional permissions @
elasticsearch | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
elasticsearch | * java.net.SocketPermission * connect,resolve
elasticsearch | See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
elasticsearch | for descriptions of what these permissions allow and the associated risks.
elasticsearch | -> Installed analysis-dynamic-synonym
elasticsearch | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
elasticsearch | {"type": "server", "timestamp": "2020-02-06T14:29:30,049Z", "level": "WARN", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "docker-cluster", "node.name": "71971bf1dea4", "message": "uncaught exception in thread [main]",
elasticsearch | "stacktrace": ["org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: cannot downgrade a node from version [7.5.2] to version [7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "Caused by: java.lang.IllegalStateException: cannot downgrade a node from version [7.5.2] to version [7.5.1]",
elasticsearch | "at org.elasticsearch.env.NodeMetaData.upgradeToCurrentVersion(NodeMetaData.java:94) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.env.NodeEnvironment.loadOrCreateNodeMetaData(NodeEnvironment.java:426) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:304) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.node.Node.<init>(Node.java:273) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.node.Node.<init>(Node.java:253) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.5.1.jar:7.5.1]",
elasticsearch | "... 6 more"] }
elasticsearch exited with code 1

```

I don’t understand why it is trying to downgrade the elasticeSearch node:  
`java.lang.IllegalStateException: cannot downgrade a node from version [7.5.2] to version [7.5.1]"`

I have tried to follow each step in: [Error configuring elasticsearch Litium 7.4.0](https://forum.litium.com/t/error-configuring-elasticsearch-litium-7-4-0/1309/4) but I still can’t figure it out.

EDIT:

I am using this _docker-compose.yaml_ file: [https://github.com/LitiumAB/Education/blob/master/Developer%20Education/Tasks/Docker/Resources/docker-compose.yaml](https://github.com/LitiumAB/Education/blob/master/Developer%20Education/Tasks/Docker/Resources/docker-compose.yaml). and according to it docker should fetch elasticsearch:7.5.1.

Thanks in advance!

Litium version: 7.4

---

<div class="post-metadata">

**Author:** ![marten](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/marten/32/11_2.png) [@marten](https://forum.litium.com/u/marten)\
**Post date:** [February 6, 2020, 3:14pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/2 "2020-02-06T15:14:11Z")

</div>

There is no version dependency on 7.5.1 (it is there since it was the latest version at the time of writing that lab), does it work if you just adjust the yaml-file to 7.5.2?

---

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 6, 2020, 3:23pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/3 "2020-02-06T15:23:12Z")

</div>

Get:

```auto
elasticsearch | -> Downloading https://github.com/Tasteful/elasticsearch-analysis-dynamic-synonym/releases/download/v7.5.1/elasticsearch-analysis-dynamic-synonym.zip
elasticsearch | Exception in thread "main" java.lang.IllegalArgumentException: Plugin [analysis-dynamic-synonym] was built for Elasticsearch version 7.5.1 but version 7.5.2 is running
elasticsearch | at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:346)
elasticsearch | at org.elasticsearch.plugins.InstallPluginCommand.loadPluginInfo(InstallPluginCommand.java:728)
elasticsearch | at org.elasticsearch.plugins.InstallPluginCommand.installPlugin(InstallPluginCommand.java:803)
elasticsearch | at org.elasticsearch.plugins.InstallPluginCommand.install(InstallPluginCommand.java:786)
elasticsearch | at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:232)
elasticsearch | at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:217)
elasticsearch | at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
elasticsearch | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)
elasticsearch | at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:77)
elasticsearch | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)
elasticsearch | at org.elasticsearch.cli.Command.main(Command.java:90)
elasticsearch | at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:47)

```

and 7.5.1 seems to be that latest version of **[elasticsearch-analysis-dynamic-synonym](https://github.com/Tasteful/elasticsearch-analysis-dynamic-synonym)** plugin. Is it possible to skip the plugin for now or is it a requierment for elastic search to work?

---

<div class="post-metadata">

**Author:** ![marten](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/marten/32/11_2.png) [@marten](https://forum.litium.com/u/marten)\
**Post date:** [February 6, 2020, 3:44pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/4 "2020-02-06T15:44:57Z")

</div>

The plugin is a requirement so it seems you need to remove elastic 7.5.2 and install 7.5.1,

I haven’t tried this myself yet but I will test and update the task documentation when i can.

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [February 6, 2020, 6:17pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/5 "2020-02-06T18:17:05Z")

</div>

If you skip that plugin, you will lose the synonyms feature.

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 6, 2020, 8:01pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/6 "2020-02-06T20:01:04Z")

</div>

Elasticsearch plugin is version dependent so you need to have the plugin for the version of elasticsearch that you are running. If you run 7.5.1 or 7.5.2 or elasticsearch, you also need to have the plugin for the same version.

In the docker-compose file you have version number for both elasticsearch and in the url for the plugin, they need to match. If the elasticsearch version is 7.5.2 and the plugin is 7.5.1 the plugin probably trying to use the 7.5.1 version of the elasticsearch libraries that not are available and throw this exception.

The plugin you refer in my fork on github is now also exists in 7.5.2 version, if you want that in another version, I accept pull requests.

---

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 7, 2020, 8:20am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/7 "2020-02-07T08:20:02Z")

</div>

It is totaly unclear where 7.5.2 comming from since the version of Kibana, Redis, ES and the plugin was 7.5.1 in the .yaml file. It is now solved by changing all the versions to 7.5.2 and all of them are up and running.

BUT the ES-node still does not appear in the settings in BO? 😕 what should I check?

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [February 7, 2020, 8:33am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/8 "2020-02-07T08:33:36Z")

</div>

Did you add all the settings from this task as well?

> **[LitiumAB/Education](https://github.com/LitiumAB/Education/tree/master/Developer%20Education/Tasks/Enable%20Elasticsearch)**
>
> Litium education material. Contribute to LitiumAB/Education development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 7, 2020, 8:49am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/9 "2020-02-07T08:49:33Z")

</div>

1- docker and all nodes are up and running  
2- This connectionString is added: `<add name="ElasticsearchConnectionString" connectionString="http://localhost:9200" />`  
3- Lucene indexing disabled for website and PIM  
5- prefix added  
6- `<add key="Litium:Elasticsearch:Synonym:Host" value="http://host.docker.internal:8050" />` is added  
7- Binding for port 8050 is added (without hostname, correct?)

Did I miss something?

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [February 7, 2020, 9:55am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/10 "2020-02-07T09:55:28Z")

</div>

Can you double check if the connection name is in correct case: `ElasticSearchConnectionString`

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [February 7, 2020, 10:00am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/11 "2020-02-07T10:00:03Z")

</div>

Since you upgraded, does your Litium.Accelerator.Mvc project have the package Litium.Web.Setup.ElasticSearch installed?

---

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 7, 2020, 10:55am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/12 "2020-02-07T10:55:15Z")

</div>

Thank you @NilsN! that seems to be the problem.

Now the ES node appeard in BO but no indices are showing!

 ![bild](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/26db62e2d8fca4354442bf9cefde7ec42e16a393.png)

The [Elasticsearch.Net](http://Elasticsearch.Net) package in the MVC project is 7.5.1 and that seems to be the latest version they have there. and the docker is running ES 7.5.2. Could that be the reason?

EDIT:

Nothing in the eventlog and in the ES log repeating:

```auto
2020-02-07 11:58:31.1985 [App:02] [afbc4b01-e44b-4963-bfbe-64eb00912ecd] [TRACE] [] Nest.IElasticClient - GET http://localhost:9200/ragnarsystem-index-queue/_count 
2020-02-07 11:58:31.1985 [App:02] [afbc4b01-e44b-4963-bfbe-64eb00912ecd] [TRACE] [] Nest.IElasticClient - Status: 

```

EDIT 2:  
I got it work with ES 7.5.1 in the docker now, I needed to clear the docker volume.  
So the versions are now same everywhere, 7.5.1. But still no indices are showing

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 7, 2020, 12:18pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/13 "2020-02-07T12:18:41Z")

</div>

If you are upgrading an older version of Litium Accelerator you don’t have the new project `Litium.Accelerator.Elasticsearch` (exists in the latest accelerator package) that contains the index definitions, without this or other index definitions you will not get any index in the admin view.

The `Litium.Accelerator.Elasticsearch` using decorators to replace the searches and for products, categories and pages and if the service they should override have been changed (or not exists) you also need to update that code from the latest accelerator package.

---

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 7, 2020, 1:33pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/14 "2020-02-07T13:33:06Z")

</div>

The `Litium.Accelerator.Elasticsearch` is already at place.

Ok, I guess that is a huge work to identify the changes and update all those files, or do you have a efficient way to do that? Or maybe a list over those files that are needed for getting ES to work? Since the accelerator is far away from the clean one from Litium.

I appreciate ur answers guys!

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 7, 2020, 2:56pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/16 "2020-02-07T14:56:08Z")

</div>

Is the `Litium.Accelerator.Elasticsearch` project referenced by the Mvc-project? Is everything compiling it should be compatible directly, otherwise it’s the files that are decorated in the `Searching` folder that has the files that are changed/updated to work with ES.

If you put a break-point in `ProductSearchServiceDecorator.Search` will that be hit during debugging?

---

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 10, 2020, 3:23pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/17 "2020-02-10T15:23:57Z")

</div>

That was the issue, the `Litium.Accelerator.Elasticsearch` project was not referenced by the Mvc-project.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [February 10, 2020, 4:05pm UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/18 "2020-02-10T16:05:11Z")

</div>

Did you add all new files under Site folder in MVC project also?

---

<div class="post-metadata">

**Author:** ![aram](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/aram/32/19_2.png) [@aram](https://forum.litium.com/u/aram)\
**Post date:** [February 11, 2020, 8:16am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/19 "2020-02-11T08:16:47Z")

</div>

No, should I do that?

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [February 11, 2020, 8:33am UTC](https://forum.litium.com/t/elastic-search-in-docker/1316/20 "2020-02-11T08:33:09Z")

</div>

Yes if you would like to administrate the Search in BO.
