Work1节点系统崩溃了重做系统如何配置重新加入节点?

环境信息:
RKE2 版本:

[root@work2 ~]# rke2 -v
rke2 version v1.30.6+rke2r1 (2959cd2193af9ed18d0fc2912fc5c11d6462103d)
go version go1.22.8 X:boringcrypto
节点 CPU 架构,操作系统和版本:

[root@localhost ~]# uname -a
Linux work1 5.14.0-427.13.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 1 19:11:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#
集群配置:

问题描述:

work2系统崩溃了重新安装系统后如何回复集群?
重现步骤:

  • 安装 RKE2 的命令:

预期结果:
重新安装系统后正常恢复集群使用

实际结果:
集群无法恢复

日志

可以从 rancher ui 移除掉这个worker 节点,然后这个主机作为新节点重新添加到集群即可

没找到添加节点的位置呢!

没找到如何添加集群节点的按钮

那你得弄明白这个集群是导入到 rancher 中管理的,还是有 rancher 自定义创建的集群,如果导入到 rancher 的集群,得从 rke2 那删除和加集群。

在 这可以看:

我现在已经删除了节点系统重新安装了。现在如何添加节点到集群中?

如何添加节点?

Error custom-a880d17eccb3 - / - Linux 全部 2.7 分钟
Error applying plan – check rancher-system-agent.service logs on node for more information
执行指令后失败了

error applying plan – check rancher-system-agent.service logs on node for more information

[root@work1 ~]# curl --insecure -fL https://10.0.0.220/system-agent-install.sh | sudo sh -s - --server https://10.0.0.220 --label ‘cattle.io/os=linux’ --token 6xlkqtgkxzs54gd98ndc7ldlk466frzvbcshjgv878pwlhb6sj5j6q --ca-checksum f7132402f21460d35f2329ac5d3a401cf8e79fcfd449fdb5e88dd3cd7fb8a3fa --etcd --controlplane --worker
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 33050 0 33050 0 0 949k 0 --:–:-- --:–:-- --:–:-- 949k
[INFO] Label: cattle.io/os=linux
[INFO] Role requested: etcd
[INFO] Role requested: controlplane
[INFO] Role requested: worker
[INFO] CA strict verification is set to true
[INFO] Using default agent configuration directory /etc/rancher/agent
[INFO] Using default agent var directory /var/lib/rancher/agent
main: line 898: [: missing `]’
[INFO] Successfully downloaded CA certificate
[INFO] Value from https://10.0.0.220/cacerts is an x509 certificate
[INFO] Successfully tested Rancher connection
[INFO] Rancher System Agent was detected on this host. Ensuring the rancher-system-agent is stopped.
[INFO] Downloading rancher-system-agent binary from https://10.0.0.220/assets/rancher-system-agent-amd64
[INFO] Successfully downloaded the rancher-system-agent binary.
[INFO] Downloading rancher-system-agent-uninstall.sh script from https://10.0.0.220/assets/system-agent-uninstall.sh
[INFO] Successfully downloaded the rancher-system-agent-uninstall.sh script.
[INFO] Generating Cattle ID
[INFO] Cattle ID was already detected as 3d179a3be429dffcc71be3e0262235e57e5fc7719663e8f237f6b87dbff1d14. Not generating a new one.
[INFO] Successfully downloaded Rancher connection information
[INFO] systemd: Creating service file
[INFO] Creating environment file /etc/systemd/system/rancher-system-agent.env
[INFO] Enabling rancher-system-agent.service
[INFO] Starting/restarting rancher-system-agent.service