找回密码
 注册
查看: 7|回复: 0

pcs 集群操作命令合集pcs status 等命令使用 pcs cluster start --all

[复制链接]

0

主题

0

回帖

9

积分

管理员

积分
9
QQ
发表于 2024-4-18 21:54:51 | 显示全部楼层 |阅读模式
群集操作命令1 v1 g. p2 {# z# T/ I. f# y
, K/ l0 L( ^# h7 G4 |; p) S
1、验证群集安装+ Y+ L& b4 d6 y+ o

) |2 L+ Q0 v9 I6 t[shell]# pacemakerd -F                    ## 查看pacemaker组件,ps axf | grep pacemaker  i, Z7 `5 t7 O: S. Y$ W6 O. m, v/ y
8 Q1 a) L& z3 d  ~
[shell]# corosync-cfgtool -s                  ## 查看corosync序号
, d6 `" M. W9 C4 l5 z3 x' v9 ^% m6 _( W9 _5 L
[shell]# corosync-cmapctl | grep members          ## corosync 2.3.x
( E% ?  u9 B) ~' n4 J0 E1 \3 E; X& ?7 l
[shell]# corosync-objctl | grep members          ## corosync 1.4.x
* T5 C! ]0 v% H6 ^( Q7 Z1 J8 S2 N7 _4 N$ ?' c
2、查看群集资源2 I7 Y* W1 k0 b, T

8 p1 ]2 u$ R) D& e2 t0 }: ?" O[shell]# pcs resource standards              ## 查看支持资源类型! r1 r7 w6 g8 k0 M: [+ {" L* g* z

# d2 g  V7 N  {, K/ a! w" _[shell]# pcs resource providers              ## 查看资源提供商6 f/ R; |0 h2 }5 F

) S3 e* E- F" u" \[shell]# pcs resource agents                ## 查看所有资源代理1 ~- l8 T6 y: A3 I$ Y7 c

2 M3 x( o; i3 ^" A0 {0 k[shell]# pcs resource list                 ## 查看支持资源列表
; w8 j  k9 {8 m( U: i
8 R: @5 w% k+ x! b0 z7 C% c' F, g[shell]# pcs stonith list                ## 查看支持Fence列表
7 e8 @0 r: W& Y6 J8 L. L2 N
7 W& u; \- ?: P0 J" q% q1 V9 O[shell]# pcs property list --all            ## 显示群集默认变量参数
! e+ N& C+ F5 _+ g' q# L9 E, e3 I1 N
[shell]# crm_simulate -sL                    ## 检验资源 score 值6 t4 G' o. o( j: k# I

# H. K3 J$ r5 }' ~1 |% u9 b  C3、使用群集脚本& Q' N* j9 p3 O- b6 \
: C( C1 J+ }; p: C/ i
[shell]# pcs cluster cib ra_cfg                ## 将群集资源配置信息保存在指定文件5 J; G! @& ~) w

" x' ?8 L. A- F0 j[shell]# pcs -f ra_cfg resource create            ## 创建群集资源并保存在指定文件中(而非保存在运行配置)+ Q: O; C/ m+ [) G! v/ R3 F% d7 n

, ?0 i8 j+ r1 \0 o* O[shell]# pcs -f ra_cfg resource show              ## 显示指定文件的配置信息,检查无误后* X' [" F1 |/ j/ r
2 _/ H6 o3 H5 i8 Z$ H
[shell]# pcs cluster cib-push ra_cfg              ## 将指定配置文件加载到运行配置中" z. c7 @3 ~+ q. D, g/ @

. d# n8 q- r+ K9 l6 o1 P4、STONITH 设备操作/ {; w- a: I+ c) o

2 g5 w# J! Y3 L( h[shell]# stonith_admin -I                    ## 查询fence设备
! E& W; A$ v- N' q8 Q; ?! R1 O# ^3 i2 V/ s2 h2 i( d
[shell]# stonith_admin -M -a agent_name           ## 查询fence设备的元数据,stonith_admin -M -a fence_vmware_soap
/ u# }; ?) j* B. Y# f9 u: b- ~. @! S7 R. ?) k6 U( j
[shell]# stonith_admin --reboot nodename            ## 测试 STONITH 设备
0 }) t% m) ?. t: {2 t8 v6 F$ Z/ x& S5 Z
5、查看群集配置6 a$ O" x5 w2 \! d5 M
' d8 m4 L* ~/ S4 J
[shell]# crm_verify -L -V                    ## 检查配置有无错误
% e( \+ l' L1 Q2 p; o/ H0 I& O' @
[shell]# pcs property                    ## 查看群集属性
8 z+ ]1 N. |' y3 [2 l, T6 `# y+ k) m) g# p7 U% |
[shell]# pcs stonith                    ## 查看stonith, K& L! X# d( Z! `
7 h0 v' S" n0 M- n9 q# k; U% z5 K& r
[shell]# pcs constraint                    ## 查看资源约束: G4 R0 \2 B  l# `9 R
! U* t. a$ L  P  Q
[shell]# pcs config                    ## 查看群集资源配置- U7 K+ M0 Y$ b8 p9 Z2 ]
6 a* q( A- Y! y3 z) @: y
[shell]# pcs cluster cib                    ## 以XML格式显示群集配置
0 d/ r7 Y+ [* u/ n+ n$ R( W! W
5 ]; V8 i8 Q# _2 ?6、管理群集, _6 Z( n5 c2 t% I6 _& d2 m

) w# u% h0 \& A" Q( ~1 \[shell]# pcs status                      ## 查看群集状态& T. T7 U) a/ e$ C  S
4 A" Z7 A- ~* c5 R, T
[shell]# pcs status cluster: F/ U) _# A: {# c

; o& x0 K: [7 I( I7 `' j[shell]# pcs status corosync
( J+ S- `' w" G. }1 \9 p: f
, u1 r7 K% w; r3 [3 f, J' m[shell]# pcs cluster stop [node11]              ## 停止群集# n2 F. p  }& Y" }. m9 [) n9 Y

! Q! k1 n- q: u( o[shell]# pcs cluster start --all                ## 启动群集
. g( E0 w$ B( {/ [
, r, F" z" P9 A5 }" I[shell]# pcs cluster standby node11              ## 将节点置为后备standby状态,pcs cluster unstandby node11
8 ~' u4 U! K# a6 ]
9 p( i6 V0 |' a; g) i! Y[shell]# pcs cluster destroy [--all]              ## 删除群集,[--all]同时恢复corosync.conf文件2 N) X0 I4 Y7 s5 J  F" ?2 o

; O& G# r( W( |) q8 ~/ c[shell]# pcs resource cleanup ClusterIP        ## 清除指定资源的状态与错误计数
) P8 {- w8 O4 s3 S' W  z4 Q
8 j# A3 Y/ x1 J& \, j[shell]# pcs stonith cleanup vmware-fencing        ## 清除Fence资源的状态与错误计数7 K7 ^- k) g  Z: F, y) O$ X8 T% V
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-11 22:57 , Processed in 0.015759 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表