Moving indices to Docker

Hi, I am currently trying to test the overhead a docker container adds to query latency, among other tests requiring a containerized ES. In order to do this I am creating a container and mounting the folder containing the original indices created by a non-dockerized ES instance. The issue I am running into is that ES throws the following error from the docker container.

java.lang.IllegalStateException: failed to obtain node locks, tried [[/usr/share/elasticsearch/data]] with lock id [0]

I am currently using docker compose to start the container with the following file:

version: '2.2'

services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6
    container_name: elasticsearch
    labels:
      - es-env="test-docker"
    healthcheck:
      test: "curl -X GET http://elasticsearch:9200/_cluster/health"
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    volumes
      - es01-data:/usr/share/elasticsearch/data
    networks:
      - es-network    

  kibana:
    image: docker.elastic.co/kibana/kibana:7.17.6
    container_name: kibana
    labels:
      - es-env="test-docker"
    depends_on:
      elasticsearch:
        condition: service_healthy
    environment:
      ELASTICSEARCH_URL: http://elasticsearch:9200
      ELASTICSEARCH_HOSTS: '["http://elasticsearch:9200"]'
    ports:
      - 5601:5601
    networks:
      - es-network

volumes:
  es01-data:
    driver: local
    driver_opts:
      device: /scratch/es_volume
      type: 'none'
      o: 'bind'

networks:
  es-network:
    name: es-net

Am I taking the correct approach by mounting an existing data folder, or is there some clear mistake here? Any suggestions on how to approach this would be welcome, as re-indexing all the data would be prohibitive.
I have already checked whether there is another java instance holding the locks, and this does not seem to be the case.
Would I need to manually set the permissions inside the docker container?
Thanks a lot!

Is the other node outside of docker still running?

No, it is completely shut down.

Is there more to the error message? A stack trace perhaps?

Is there more to the error message? A stack trace perhaps?

My apologies for the time it took to get back to you, in the end, I simply bit the bullet and used elasticdump to move my incides to the docker instance.
I now strongly suspect that the issue I ran into before could have been solved by setting the permissions of the original elasticsearch data folder to 1000:root.

Yes, that's more than likely.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.