posts - 160,  comments - 0,  views - 11万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

1、登录到其中一台Proxmox节点(此处节点为:demo1)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 创建集群
# pvecm create demo-cluster
Corosync Cluster Engine Authentication key generator.
Gathering 2048 bits for key from /dev/urandom.
Writing corosync key to /etc/corosync/authkey.
Writing corosync config to /etc/pve/corosync.conf
Restart corosync and cluster filesystem
 
# 查看集群状态
# pvecm status
Cluster information
-------------------
Name:             demo-cluster
Config Version:   1
Transport:        knet
Secure auth:      on
 
Quorum information
------------------
Date:             Tue Jun 25 14:46:32 2024
Quorum provider:  corosync_votequorum
Nodes:            1
Node ID:          0x00000001
Ring ID:          1.5
Quorate:          Yes
 
Votequorum information
----------------------
Expected votes:   1
Highest expected: 1
Total votes:      1
Quorum:           1 
Flags:            Quorate
 
Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.103.131 (local)

2、节点加入集群

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# 节点加入集群
# pvecm add 192.168.103.131
Please enter superuser (root) password for '192.168.103.131': ********
Establishing API connection with host '192.168.103.131'
The authenticity of host '192.168.103.131' can't be established.
X509 SHA256 key fingerprint is C2:71:D8:BE:5C:DA:0A:96:DD:FA:99:50:66:B7:9B:1E:29:EC:58:C7:2D:76:9F:FD:E6:EA:3E:C4:5D:45:7A:8A.
Are you sure you want to continue connecting (yes/no)? yes
Login succeeded.
check cluster join API version
No cluster network links passed explicitly, fallback to local node IP '192.168.103.132'
Request addition of this node
Join request OK, finishing setup locally
stopping pve-cluster service
backup old database to '/var/lib/pve-cluster/backup/config-1719298190.sql.gz'
waiting for quorum...OK
(re)generate node files
generate new node certificate
merge authorized SSH keys
generated new node certificate, restart pveproxy and pvedaemon services
successfully added node 'demo2' to cluster.
 
# 查看集群
# pvecm status
Cluster information
-------------------
Name:             demo-cluster
Config Version:   3
Transport:        knet
Secure auth:      on
 
Quorum information
------------------
Date:             Tue Jun 25 14:56:14 2024
Quorum provider:  corosync_votequorum
Nodes:            3
Node ID:          0x00000001
Ring ID:          1.d
Quorate:          Yes
 
Votequorum information
----------------------
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2 
Flags:            Quorate
 
Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.103.131 (local)
0x00000002          1 192.168.103.132
 
# 查看集群节点情况
# pvecm nodes
 
Membership information
----------------------
    Nodeid      Votes Name
         1          1 demo1 (local)
         2          1 demo2
 
# 加入第三个节点后集群状态
# pvecm nodes
 
Membership information
----------------------
    Nodeid      Votes Name
         1          1 demo1 (local)
         2          1 demo2
         3          1 demo3
 
# pvecm status
Cluster information
-------------------
Name:             demo-cluster
Config Version:   3
Transport:        knet
Secure auth:      on
 
Quorum information
------------------
Date:             Tue Jun 25 14:55:16 2024
Quorum provider:  corosync_votequorum
Nodes:            3
Node ID:          0x00000001
Ring ID:          1.d
Quorate:          Yes
 
Votequorum information
----------------------
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2 
Flags:            Quorate
 
Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.103.131 (local)
0x00000002          1 192.168.103.132
0x00000003          1 192.168.103.133

3、删除集群节点

1
2
3
4
5
6
7
8
9
# 删除集群节点
pvecm delnode demo3
 
# 查看集群
pvecm status
 
# 删除Web Gui中已删除的节点
cd /etc/pve/nodes/
rm -rf demo3

4、删除机器之间的认证信息

1
2
cd /etc/pve/priv
删除authorized_keys和known_hosts文件中的记录

参考:

1
https://pve.proxmox.com/wiki/Cluster_Manager

  

posted on   a120608yby  阅读(419)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示