Unable to lock JVM Memory: error=12, reason=Cannot allocate memory

Unable to lock JVM Memory: error=12, reason=Cannot allocate memory

Yes, I'm back to Linux and this is the first issue I faced installing my all development environment, basically, the issue was happening because my elasticsearch image complaining about memory.

Luckily, the issue was solved by modifying the docker-compose.yml file, adding unlimited memory as follows:

version: '3'

services:
   elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.6.1
        container_name: elasticsearch
        volumes:
            ...
        ports:
           ...
        environment:
            ...
        ulimits:
            memlock:
                soft: -1
                hard: -1

Also, for some reason was failing with the older version of this image, so I updated from 6.2.2 to 7.6.1


Photo by photo hoteam on Unsplash

Jack Fiallos

Jack Fiallos

Te gustó este artículo?