docker max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
时间: 2023-10-29 08:55:52 浏览: 128
elasticsearch启动后自动关闭:max virtual memory areas vm.max_map_count [65530] is too low, increase to at…
To increase the `vm.max_map_count` value specifically for Docker, you can follow these steps:
1. Open a terminal and log in as the root user or use sudo for the following commands.
2. Create or edit the Docker daemon configuration file using a text editor such as vi or nano:
```shell
sudo vi /etc/docker/daemon.json
```
3. Add the following configuration to the file:
```json
{
"default-ulimits": {
"memlock": {
"Name": "memlock",
"Hard": -1,
"Soft": -1
}
}
}
```
This configuration sets the memlock limit to unlimited, which is required to increase `vm.max_map_count` for Docker.
4. Save and exit the file.
5. Restart the Docker daemon to apply the changes:
```shell
sudo systemctl restart docker
```
Once Docker restarts, it should have the increased `vm.max_map_count` value. You can verify this by running:
```shell
docker run --rm busybox sysctl vm.max_map_count
```
It should now show a value of at least `262144`.
阅读全文