初始化设置

#设置主机名
hostnamectl set-hostname nodexxx
#关闭防火墙
systemctl status firewalld

#设置时区
timedatectl set-timezone Asia/Shanghai 
#使用阿里云同步时间
ntpdate ntp1.aliyun.com 


关闭 swap
swapoff -a && sudo sed -i 's/^.*swap/#&/g' /etc/fstab
或者 vi /etc/fstab,注释掉下面一行
/dev/mapper/xxxx swap ...
free -m #查看

关闭 selinux
getenforce #查看
#临时关闭
setenforce 0 
#永久关闭
sed -i 's/enforcing/disabled/' /etc/selinux/config
或者
vi /etc/sysconfig/selinux
SELINUX=disabled  # 修改以下参数,设置为disable

ubuntu安装docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

curl -sSL https://get.daocloud.io/docker | sh

或者:
apt-get install docker-ce docker-ce-cli containerd.io

#安装命令如下
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
国内 daocloud 一键安装命令:
curl -sSL https://get.daocloud.io/docker | sh

#清华源
https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/
export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"
# 如您使用 curl
curl -fsSL https://get.docker.com/ | sudo -E sh

docker-compose

#安装docker-compose 
sudo curl -L "https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#国内加速
sudo curl -L "https://get.daocloud.io/docker/compose/releases/download/v2.17.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo curl -L "https://get.daocloud.io/docker/compose/releases/download/v2.14.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

#设置权限
sudo chmod +x /usr/local/bin/docker-compose


下载太慢直接下载文件
sudo mv docker-compose-linux-x86_64_v2.3.4 /usr/local/bin/docker-compose
mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
改名为 /usr/local/bin/docker-compose (注docker-compose是文件名)