# 下载所有离线文件

wget https://oss.demo.uavcmlc.com:18000/cmlc-installation/kebite-4.1.6.tar.gz

wget https://oss.demo.uavcmlc.com:18000/cmlc-installation/v4.1.6/middleware-images.tar.gz
wget https://oss.demo.uavcmlc.com:18000/cmlc-installation/v4.1.6/rancher-1.20.4-image.tar.gz


wget https://oss.demo.uavcmlc.com:18000/cmlc-installation/v4.1.6/rke


# 批量复制文件
ip_list=(10.20.1.133 10.20.1.134 10.20.1.132)
for ip in "${ip_list[@]}"; do

    echo "yes
    yes
    " | scp /etc/docker/daemon.json root@${ip}:/etc/docker/daemon.json

    ssh root@${ip} "systemctl restart docker"
done

ip_list=(10.20.1.133 10.20.1.134 10.20.1.132)
for ip in "${ip_list[@]}"; do
    scp /etc/docker/daemon.json root@${ip}:/etc/docker/daemon.json
#    scp /etc/ssh/sshd_config root@${ip}:/etc/ssh/sshd_config

    ssh root@${ip} "systemctl restart docker"
#    ssh root@${ip} "systemctl restart sshd"
done


vim /etc/docker/daemon.json
{
  "insecure-registries" : ["20.47.129.116:8033"]
}

systemctl restart docker


list=(iptables)

for Packages in "${list[@]}"
do
    apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances ${Packages} | grep "^\w" | sort -u)
done


sudo dpkg -i ./containerd.io_1.6.15-1_amd64.deb \
  ./docker-ce-cli_20.10.10~3-0~ubuntu-focal_amd64.deb \
  ./docker-ce_20.10.10~3-0~ubuntu-focal_amd64.deb \
  ./docker-ce-rootless-extras_20.10.10~3-0~ubuntu-focal_amd64.deb \
  ./docker-buildx-plugin_0.11.1-1~ubuntu.20.04~focal_amd64.deb \
  ./docker-compose-plugin_2.19.1-1~ubuntu.20.04~focal_amd64.deb

rpcinfo -p localhost

# 生成ed25519 版本的ssh key
ssh-keygen -t ed25519 -f .ssh/id_ed25519  -C "m@github"

echo $(cat .ssh/id_ed25519.pub)

echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHXDzet+Z2/AmrzIZpPviz7Z9AMxLWiJUOwtj/3NPauk m@github" >>.ssh/authorized_keys

# 修改calico-node检测的IP
kubectl -n kube-system edit daemonset calico-node
env:
- name: FELIX_INTERFACEPREFIX
  value: "eth0"

# 更加保险
kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=skip-interface=eth.*


./mysql -uroot -pQzfXQhd3bQ -h127.0.0.1 -P33306


redis-cli -h 127.0.0.1 -a Mcache@4522

./mysql -uboge -pboge8tingH -h127.0.0.1 -P21306