Skip to content

Commit

Permalink
terraform: fix docker ulimit configuring for latest EKS AMI (#1349)
Browse files Browse the repository at this point in the history
* fix docker ulimit configuring for latest EKS AMI

Signed-off-by: Aylei <rayingecho@gmail.com>

* tfix docker ulimit configuring for latest EKS AMI

Signed-off-by: Aylei <rayingecho@gmail.com>
  • Loading branch information
aylei authored Dec 19, 2019
1 parent 2996b69 commit df1755e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deploy/modules/aws/tidb-cluster/templates/userdata.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ root soft core unlimited
root soft stack 10240
EOF

# config docker ulimit
# configure ulimit of docker daemon, it is also the max value of ulimit the containers could be set
# change 'infinity' to '1048576' explicitly to workaround https://github.com/systemd/systemd/issues/6559
cp /usr/lib/systemd/system/docker.service /etc/systemd/system/docker.service
sed -i 's/LimitNOFILE=infinity/LimitNOFILE=1048576/' /etc/systemd/system/docker.service
sed -i 's/LimitNPROC=infinity/LimitNPROC=1048576/' /etc/systemd/system/docker.service

# configure ulimit of containers, the ulimit requirement(82920) of tikv is greater than the default(65536).
if ! grep -qF "OPTIONS" /etc/sysconfig/docker; then
echo 'OPTIONS="--default-ulimit nofile=1024000:1024000"' >> /etc/sysconfig/docker
fi

systemctl daemon-reload
systemctl restart docker

Expand Down

0 comments on commit df1755e

Please sign in to comment.