Skip to content

Instantly share code, notes, and snippets.

@mdsohelmia
Created October 13, 2023 19:53
Show Gist options
  • Save mdsohelmia/475f77e6c62a9877cce2fae679e1bf82 to your computer and use it in GitHub Desktop.
Save mdsohelmia/475f77e6c62a9877cce2fae679e1bf82 to your computer and use it in GitHub Desktop.
tidb-env-setup.sh
#!/bin/sh
# View the data disk.
fdisk -l
# View the partition UUID of the data disk.
lsblk -f
# NTP service synchronizes with the NTP server.
sudo apt-get install ntp
apt install ntpstat
apt install numactl
# Check and disable system swap
echo "vm.swappiness = 0" >>/etc/sysctl.conf
swapoff -a && swapon -a
sysctl -p
#Execute the following commands to modify the sysctl parameters
echo "fs.file-max = 1000000" >>/etc/sysctl.conf
echo "net.core.somaxconn = 32768" >>/etc/sysctl.conf
echo "net.ipv4.tcp_syncookies = 0" >>/etc/sysctl.conf
echo "vm.overcommit_memory = 1" >>/etc/sysctl.conf
sysctl -p
# Execute the following command to configure the user's limits.conf file:
cat <<EOF >>/etc/security/limits.conf
tidb soft nofile 1000000
tidb hard nofile 1000000
tidb soft stack 32768
tidb hard stack 32768
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment