设置主机名
hostnamectl set-hostname k8s-master
echo "192.168.119.151 k8s-master" >> /etc/hosts #master
#生成公钥
ssh-keygen
ssh-copy-id -i .ssh/id_rsa.pub root@ip
hostnamectl set-hostname k8s-master
echo "192.168.119.151 k8s-master" >> /etc/hosts #master
#生成公钥
ssh-keygen
ssh-copy-id -i .ssh/id_rsa.pub root@ip
查指定容器IP
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
命令使用说明
unpause 恢复处于暂停状态中的服务
设置主机时区:
timedatectl set-timezone Asia/Shanghai
安装docker-compose
#https://github.com/docker/compose/releases
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.12.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# 添加可执行权限
sudo chmod +x /usr/local/bin/docker-compose
# 查看docker-compose版本
docker-compose -v