2
votes

Setting up a docker instance of Elasticsearch Cluster. In the instructions it says
Make sure Docker Engine is allotted at least 4GiB of memory

I am ssh'ing to the host, not using docker desktop. How can I see the resource allotments from the command line?

reference URL https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html

2
I would need more details to answer this question better, but assuming it's a generic non-desktopy Linux, I'm still going to attempt an answerConnor Verlekar
You can use docker system info or docker info to see the resources allotment for CPU, Memory etc.Saurabh
docker system info gave the 'info' I was looking for Operating System: Oracle Linux Server 7.7 OSType: linux Architecture: x86_64 CPUs: 8 Total Memory: 15.49GiB RayJ_inSJ

2 Answers

1
votes

I had same problem, with Docker Desktop on Windows 10 while running Linux containers on WSL2.

I found this issue: https://github.com/elastic/elasticsearch-docker/issues/92 and tried to apply similar logic to the solution of there.

I entered the WSL instance's terminal by wsl -d docker-desktop command. Later I run sysctl -w vm.max_map_count=262144 command to set 'allotted memory'.

After these steps I could run elasticsearch's docker compose example.

-1
votes

I'd like to go about it by just using one command.

 docker stats -all

This will give a output such as following

$ docker stats -all

CONTAINER ID        NAME           CPU%  MEM USAGE/LIMIT   MEM%   NET I/O BLOCK I/O PIDS
5f8a1e2c08ac my-compose_my-nginx_1 0.00% 2.25MiB/1.934GiB 0.11% 1.65kB/0B 7.35MB/0B  2

To modify the limits : when you're making your docker-compose.yml include the following at the end of your file. (if you'd like to set up a 4 GiB limit)

resources:
limits:
memory: 4048m
reservations:
memory: 4048m