for an swarm with elasticsearch, I need to disable swapping in the docker container.
When I read this Documentation, I need to configure the
memswap_limit with the same number as the
But this did not work in a compose file, which is used for a swarm.
version: "3.8" services: elasticsearch: memswap_limit: 2G image: docker.elastic.co/elasticsearch/elasticsearch:8.11.1-amd64 logging: driver: json-file options: max-file: '10' max-size: 20m environment: - "ES_JAVA_OPTS=-Xms1g -Xmx1g" volumes: - /path/to/folder:/path/to/folder ports: - 9200:9200 - 9300:9300 deploy: mode: global resources: limits: memory: 2G networks: - net
When I issue the command
docker stack deploy -f docker-compose.yml stackname I get an error, that the
memswap_limit is not supported.
How would I now disable swapping in a swarm container configuration?