Parameters for Environment Detection
Take a CentOS 7.9 server as an example
User
Description: The user when running the script
Requirement: To root a user or a user with root permissions is required because docker is in use.
Selinux
Description: The security system of Linux
Requirement: Selinux should be disabled because docker is in use.
Temporarily disabled: `setenforce 0
Permanently disabled: modify SELINUX=enforcing or SELINUX=permissive to SELINUX=disabled in /etc/selinux/config
Firewalld
Note: It is a self-contained firewall tool. It is recommended to disable the firewall as it tends to conflict with iptables rules. Cloud servers can rely on security group rules for network control.
Temporarily disabled: systemctl stop firewalld (you need to restart the docker service after shutting down the firewall, otherwise the rules may be lost and lead to network anomalies)
Permanently disabled: systemctl disable firewalld
CPU
Description: Processor
Requirements: Minimum 4 cores
Memory
Description: Memory
Requirement: Minimum 32G memory capacity
docker
Description: The docker command must be available in the environment variable and can be executed successfully.
Requirement: It will be added to the PATH environment variable automatically after installation via RPM. If it is a binary installation, you need to add it to the environment variable manually.
dockerd
Note: The dockerd command must be available in the environment variable and can be executed successfully.
Requirement: It will be added to the PATH environment variable automatically after installation via RPM. If it is a binary installation, you need to add it to the environment variable manually.
container
Description: The file descriptor limit actually available to processes inside containers. After Docker v29 updates containerd to v2.1.5, containers use systemd's default LimitNOFILE, and ulimit -n may drop to 1024. This change affects all containers and may cause databases, middleware, and other services to fail to start or run abnormally due to insufficient file handles.
Adjustment: modify or create /etc/docker/daemon.json, add the default-ulimits configuration, and set nofile to 102400:
{
"default-ulimits": {
"nofile": {
"Name": "nofile",
"Soft": 102400,
"Hard": 102400
}
}
}
Restart the docker service for the change to take effect.
MaxMapCount
Description: It limits the number of VMAs (Virtual Memory Areas) that a process can have, and the built-in Elasticsearch needs to be adjusted to start successfully.
Temporary adjustment: sysctl -w vm.max_map_count=262144
Permanent adjustment: add the file vm.max_map_count=262144 to /etc/sysctl.conf
SysFileNr
Description: OS-level file descriptor limit
Temporary adjustment: sysctl -w fs.file-max=2048000
Permanent adjustment: add the file fs.file-max=2048000 to /etc/sysctl.conf
IPv4Forward
Note: It needs to be enabled for docker to provide external services.
Temporary adjustment: sysctl -w net.ipv4.ip_forward=1
Permanent adjustment: add the file net.ipv4.ip_forward=1 to /etc/sysctl.conf
DockerCgroupDrive
Description: The Cgroup driver used by docker containers. If the check result is systemd, containers may have insufficient file descriptors. If the check result is dockerd is not running, start the docker service first: systemctl start docker
Adjustment: modify or create /etc/docker/daemon.json, add the exec-opts configuration, and set the Cgroup driver to cgroupfs:
{
"exec-opts": ["native.cgroupdriver=cgroupfs"]
}
Restart the docker service for the change to take effect.
DockerdFileNr
Description: The number of file descriptors in docker. If dockerd is not running, you need to start dockerd (systemctl start docker).
Permanent adjustment: For example, if you start the docker service via systemd, set LimitNOFILE=102400 in the file docker.service.