Data loss when restarting containers

Hey all I’m new to graylog and docker.

I am running ba few tests and when I rebooted docker with docker-comopose down/up command all my log data and users were removed. I also had a new node for logging.

How can I prevent this in the future?

Thank you

Hi there. By nature, Docker images and data are ephemeral. That said, have you looked at Docker persistent storage as a solution to your problem? You’ll want to mount a local directory to /var/lib/elasticsearch\ inside of the container. An example would be something like:


    ...
    
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.10
        environment:
          - http.host=0.0.0.0
          - transport.host=localhost
          - network.host=0.0.0.0
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ulimits:
          memlock:
            soft: -1
            hard: -1
        deploy:
          resources:
            limits:
              memory: 1g
        networks:
          - graylog
        volumes:
        - "elasticsearch-docker-data:/var/lib/elasticsearch"

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