"discovery.type=single-node" not working as expected

I am trying to view a small demo of Siren on my Windows desktop with WSL. Running Elasticsearch on WSL does not usually work out of the box because the vm.max_map_count value is too low (65530, ES needs at least 262144) – vm.max_map_count in docker-desktop distro for WSL2 · Issue #5202 · docker/for-win · GitHub

The recommended workaround for development is to set discovery.type=single-node.

When I try that with both vanilla elasticsearch and siren-platform-demo-data, it works in ES but not Siren. If I do not include the discovery.type environment variable in the ES container, then I see the same vm.max_map_count bootstrap error for Siren and vanilla ES.

Is there an environment setting or config I can set to turn off that bootstrap check in Siren?

Another suggested workaround is to update WSL wsl -d docker-desktop sysctl -w vm.max_map_count=262144, which does work. Unfortunately that has to be done after every restart, and can’t be included as part of the docker-compose.yaml or anything.

# docker-compose.yaml
version: "3.8"

services:
  siren:
    image: sirensolutions/siren-platform-demo-data
    ports:
      - 5606:5606
      - 9220:9220
    environment:
      - "DISCOVERY_TYPE=single-node"
      - "discovery.type=single-node"

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.13.3
    ports:
      - 9200:9200
      - 9300:9300
    environment:
      - "discovery.type=single-node"
# /opt/platform/elasticsearch/logs/siren-distribution.log inside the siren container
...
[2021-07-09T18:19:06,979][INFO ][o.q.c.QuartzScheduler    ] [siren-node] JobFactory set to: io.siren.federate.connector.k.a@51d6c42d
[2021-07-09T18:19:06,980][INFO ][o.q.c.QuartzScheduler    ] [siren-node] Scheduler FederateScheduler_siren-node_$_FederateScheduler_siren-node started.
[2021-07-09T18:19:07,129][INFO ][o.e.t.TransportService   ] [siren-node] publish_address {192.168.32.3:9330}, bound_addresses {0.0.0.0:9330}
[2021-07-09T18:19:08,845][INFO ][o.e.b.BootstrapChecks    ] [siren-node] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2021-07-09T18:19:08,849][ERROR][o.e.b.Bootstrap          ] [siren-node] node validation exception
[1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2021-07-09T18:19:08,854][INFO ][c.f.s.a.s.SinkProvider   ] [siren-node] Closing DebugSink
[2021-07-09T18:19:08,852][INFO ][o.e.n.Node               ] [siren-node] stopping ...
[2021-07-09T18:19:08,879][INFO ][i.s.f.c.p.j              ] [siren-node] Planner service stopped
[2021-07-09T18:19:08,879][INFO ][i.s.f.c.i.w              ] [siren-node] Stopping connector query service
[2021-07-09T18:19:08,883][INFO ][i.s.f.c.h.f              ] [siren-node] Stopping connector jobs service
[2021-07-09T18:19:08,885][INFO ][i.s.f.c.g.i              ] [siren-node] Stopping virtual index service
[2021-07-09T18:19:08,885][INFO ][i.s.f.c.k.c              ] [siren-node] Stopping scheduler service FederateScheduler_siren-node.
...

Hi Matt,

You can use this docker-compose file which will use the Siren Investigate and Elasticsearch image.

# docker-compose.yaml
version: "3.8"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
    container_name: elasticsearch
    ports:
      - 9200:9200
    environment:
      - ES_JAVA_OPTS=-Xms512m -Xmx512m
      - discovery.type=single-node
    command: ["sh", "-c", 
              "elasticsearch-plugin install --batch https://download.support.siren.io/federate/7.10.2-22.1.zip 
              && /usr/local/bin/docker-entrypoint.sh"]
  siren:
    image: sirensolutions/siren-investigate
    container_name: siren
    ports:
      - 5606:5606
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200
      - NODE_OPTIONS=--max-old-space-size=4096

Use this command to run the image -

docker-compose up --force-recreate

Note:- If you use the Siren demo data image which has the elasticsearch image in it then you have to run this command wsl -d docker-desktop sysctl -w vm.max_map_count=262144 , every time after the docker restart. We will fix this issue soon so that user don’t need to update vm.max_map_count every time after docker restart.

Regards
Manu

Thanks @Manu_Agarwal , appreciate the response.

1 Like