阿里云安装rek2无法访问

主机操作系统:
阿里云ECS Anolis OS 8.8 ANCK 64位

问题描述:

执行

curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | sh -

报错信息如下:

[INFO]  finding release for channel stable
[INFO]  using 1.28 series from channel stable
Rancher RKE2 Common (stable)                                                                                                                                                                                                                0.0  B/s |   0  B     02:00    
Errors during downloading metadata for repository 'rancher-rke2-common-stable':
  - Curl error (28): Timeout was reached for https://rpm.rancher.io/rke2/stable/common/centos/8/noarch/repodata/repomd.xml [Connection timed out after 30000 milliseconds]
Error: Failed to download metadata for repo 'rancher-rke2-common-stable': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

ping rpm.rancher.io 也不通。

补充说明:不仅阿里云的网络环境,在本地电脑也无法访问
https://rpm.rancher.io/rke2/stable/common/centos/8/noarch/repodata/repomd.xml

有什么好办法解决网络不通的问题吗?

预期结果:
能够正常执行安装脚本。

1 个赞

安装时增加环境变量 INSTALL_RKE2_METHOD=tar

curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | INSTALL_RKE2_METHOD=tar sh -

1 个赞

非常感谢!亲测可用!秒安装完成。
完整命令为:

curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | INSTALL_RKE2_MIRROR=cn INSTALL_RKE2_METHOD=tar sh -