开启swap
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon s # 查看是否有swap
echo "/swapfile none swap sw 0 0" >> /etc/fstab
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon s # 查看是否有swap
echo "/swapfile none swap sw 0 0" >> /etc/fstab