Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] DEV docker compose file is not running correctly #464

Closed
peterzhuamazon opened this issue Mar 18, 2022 · 6 comments
Closed

[BUG] DEV docker compose file is not running correctly #464

peterzhuamazon opened this issue Mar 18, 2022 · 6 comments
Assignees
Labels
Closed - Duplicate or Cancelled Issue: Nothing to be done

Comments

@peterzhuamazon
Copy link
Member

Coming from here:
https://opensearch.org/docs/latest/opensearch/install/docker/#sample-docker-compose-file-for-development

This docker file trying to do single node deployment of OS and OSD but have errors after startup:

opensearch-node1         | org.opensearch.bootstrap.StartupException: java.lang.IllegalStateException: cannot start with [discovery.type] set to [single-node] when local node {opensearch-node1}{7Hv-pQgvTJe2mdoCpioU_g}{DM070OgbQUCn4x7F19VM-A}{172.18.0.2}{172.18.0.2:9300}{dimr}{shard_indexing_pressure_enabled=true} does not have quorum in voting configuration VotingConfiguration{IN9L2HDTRHGpIBU84xckEA}
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:182) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:169) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:100) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138) ~[opensearch-cli-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.cli.Command.main(Command.java:101) ~[opensearch-cli-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:135) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:101) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | Caused by: java.lang.IllegalStateException: cannot start with [discovery.type] set to [single-node] when local node {opensearch-node1}{7Hv-pQgvTJe2mdoCpioU_g}{DM070OgbQUCn4x7F19VM-A}{172.18.0.2}{172.18.0.2:9300}{dimr}{shard_indexing_pressure_enabled=true} does not have quorum in voting configuration VotingConfiguration{IN9L2HDTRHGpIBU84xckEA}
opensearch-node1         | 	at org.opensearch.cluster.coordination.Coordinator.doStart(Coordinator.java:843) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:72) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.node.Node.start(Node.java:1099) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.bootstrap.Bootstrap.start(Bootstrap.java:339) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:421) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:178) ~[opensearch-1.3.0.jar:1.3.0]
opensearch-node1         | 	... 6 more
opensearch-node1         | uncaught exception in thread [main]
opensearch-node1         | java.lang.IllegalStateException: cannot start with [discovery.type] set to [single-node] when local node {opensearch-node1}{7Hv-pQgvTJe2mdoCpioU_g}{DM070OgbQUCn4x7F19VM-A}{172.18.0.2}{172.18.0.2:9300}{dimr}{shard_indexing_pressure_enabled=true} does not have quorum in voting configuration VotingConfiguration{IN9L2HDTRHGpIBU84xckEA}
opensearch-node1         | 	at org.opensearch.cluster.coordination.Coordinator.doStart(Coordinator.java:843)
opensearch-node1         | 	at org.opensearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:72)
opensearch-node1         | 	at org.opensearch.node.Node.start(Node.java:1099)
opensearch-node1         | 	at org.opensearch.bootstrap.Bootstrap.start(Bootstrap.java:339)
opensearch-node1         | 	at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:421)
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:178)
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:169)
opensearch-node1         | 	at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:100)
opensearch-node1         | 	at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
opensearch-node1         | 	at org.opensearch.cli.Command.main(Command.java:101)
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:135)
opensearch-node1         | 	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:101)
opensearch-node1         | For complete error details, refer to the log at /usr/share/opensearch/logs/opensearch-cluster.log

Not completely the same error but seems like it hasnt run for a while:
opensearch-project/opensearch-build#1775 (comment)

@Naarcha-AWS if you can take a look would be great.

Thanks.

@evs-xsarus
Copy link

Below can be ignored, turns out the docker fails when setting the working_dir. After removing it from my yaml, the docker did start.

Might be something to look into .


I've tried both YML's without success, they keep giving:

ERROR: for opensearch13  Cannot start service opensearch13: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./opensearch-docker-entrypoint.sh": stat ./opensearch-docker-entrypoint.sh: no such file or directory: unknown

ERROR: for opensearch12  Cannot start service opensearch12: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./opensearch-docker-entrypoint.sh": stat ./opensearch-docker-entrypoint.sh: no such file or directory: unknown

ERROR: for opensearch13  Cannot start service opensearch13: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./opensearch-docker-entrypoint.sh": stat ./opensearch-docker-entrypoint.sh: no such file or directory: unknown

I use this YAML:

version: "3.7"
services:
  opensearch12:
    container_name: opensearch12
    image: opensearchproject/opensearch:1.2.4
    restart: always
    networks:
      - xsa_backend
    ports:
      - "9312:9200" # 93xx used to avoid conflicts with Elastic Search
      - "9612:9600" # required for Performance Analyzer
    working_dir: /sites
    environment:
      - cluster.name=opensearch12-cluster
      - node.name=opensearch12
      - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
      - "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
      - "DISABLE_INSTALL_DEMO_CONFIG=true" # disables execution of install_demo_configuration.sh bundled with security plugin, which installs demo certificates and security configurations to OpenSearch
      - "DISABLE_SECURITY_PLUGIN=true" # disables security plugin entirely in OpenSearch by setting plugins.security.disabled: true in opensearch.yml
      - "discovery.type=single-node" # disables bootstrap checks that are enabled when network.host is set to a non-loopback address
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
        hard: 65536

  opensearch12-dashboards:
    container_name: opensearch12-dashboards
    image: opensearchproject/opensearch-dashboards:1.2.0
    restart: always
    networks:
      - xsa_backend
    ports:
      - 5612:5601
    expose:
      - "5601"
    environment:
      - 'OPENSEARCH_HOSTS=["http://opensearch12:9200"]'
      - "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" # disables security dashboards plugin in OpenSearch Dashboards
version: "3.7"
services:
  opensearch13:
    container_name: opensearch13
    image: opensearchproject/opensearch:1.3.0
    restart: always
    networks:
      - xsa_backend
    ports:
      - "9313:9200" # 93xx used to avoid conflicts with Elastic Search
      - "9613:9600" # required for Performance Analyzer
    working_dir: /sites
    environment:
      - cluster.name=opensearch13-cluster
      - node.name=opensearch13
      - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
      - "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
      - "DISABLE_INSTALL_DEMO_CONFIG=true" # disables execution of install_demo_configuration.sh bundled with security plugin, which installs demo certificates and security configurations to OpenSearch
      - "DISABLE_SECURITY_PLUGIN=true" # disables security plugin entirely in OpenSearch by setting plugins.security.disabled: true in opensearch.yml
      - "discovery.type=single-node" # disables bootstrap checks that are enabled when network.host is set to a non-loopback address
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
        hard: 65536

  opensearch13-dashboards:
    container_name: opensearch13-dashboards
    image: opensearchproject/opensearch-dashboards:1.3.0
    restart: always
    networks:
      - xsa_backend
    ports:
      - 5613:5601
    expose:
      - "5613"
    environment:
      - 'OPENSEARCH_HOSTS=["http://opensearch13:9200"]'
      - "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" # disables security dashboards plugin in OpenSearch Dashboards

I'v tried it too while

  • removing the 'DISABLE_SECURITY...' parts
  • adding volume mounts

@Naarcha-AWS Naarcha-AWS added the bug Technical problem with the doc site or broken link label Mar 28, 2022
@johns1342
Copy link

@peterzhuamazon i get the same error when trying a simple copy/paste/compose of the dev example. i was able to get the dev example running by rolling the container tags back to 1 and removing the volume. makes sense since the file is unchanged from v1 besides the version tags.

this adds a lot of friction for anyone wanting to try out opensearch, especially since that example is where i landed from searching. it wasn't clear to me how to fix this error from the docs, since searching quorum in the docs only gave 2 hits with no clear indication of how to resolve it, but i did try modifying the roles and turning off shard pressure in case that was related somehow.

the cluster formation doc page indicates:

... but with only a few minor adjustments, you can follow the same steps to create a single-node cluster.

a link to the minor, but clearly important, adjustments would be helpful there.

@evs-xsarus
Copy link

@johns1342 the yaml's from my previous comment work when you remove 'working_dir'.

@johns1342
Copy link

hi @evs-xsarus, i don't see a working_dir in the v2 docker compose example @peterzhuamazon linked to. fwiw your example config is using v1 images as well, which does work for me with the example config.

it appears 2.0.1 fixed this issue for me. the only difference in the example is it's pulling 2.0.1 image instead of 2.0.0 image.

@JeffHuss JeffHuss self-assigned this Aug 16, 2022
@JeffHuss JeffHuss added 1 - Backlog Issue: The issue is unassigned or assigned but not started and removed good first issue Good for newcomers untriaged labels Aug 16, 2022
@JeffHuss
Copy link

JeffHuss commented Aug 16, 2022

I'm taking a look at this. Starting with testing versions from Sample Docker Compose file for development

OpenSearchVersion Successful (Yes/No)
2.2.0 Yes
2.1.0 Yes
2.0.1 Yes
2.0.0 (manually entered) Yes
1.3.4 Yes
1.2.4 Yes
1.1.0 Yes*
1.0.1 Yes*

*Sample file for developers was not present so I only tested with the sample docker-compose.yml

@JeffHuss
Copy link

Based on my findings, this was already fixed. I specifically tested against versions 2.0.1 and 2.0.0 since I saw John called that out, but they both downloaded and launched without issue. I was able to open a terminal session with each version.

Closing this issue out. If you feel I've overlooked something please let me know.

@JeffHuss JeffHuss closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2022
@JeffHuss JeffHuss added Closed - Won't fix and removed bug Technical problem with the doc site or broken link 1 - Backlog Issue: The issue is unassigned or assigned but not started labels Aug 16, 2022
@JeffHuss JeffHuss added the Closed - Duplicate or Cancelled Issue: Nothing to be done label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed - Duplicate or Cancelled Issue: Nothing to be done
Projects
None yet
Development

No branches or pull requests

5 participants