|
|
楼主 |
发表于 2017-12-29 12:47:05
|
显示全部楼层
# pcs resource create httpd_fs Filesystem device="/dev/mapper/vg_apache-lv_apache" directory="/var/www" fstype="ext4" --group apache2 H- U: u) ]& d0 w
Create an IP address resource, this will act a virtual IP for the Apache. Clients will use this ip for accessing the web content instead of individual nodes ip.+ d% M- i: d. F0 s
# L7 Y, ~8 Y9 }( n: T& X& U# pcs resource create httpd_vip IPaddr2 ip=192.168.12.100 cidr_netmask=24 --group apache
% o! `1 v$ M% ]' xCreate an Apache resource which will monitor the status of Apache server and move the resource to another node in case of any failure.) T5 Y2 Y9 j0 m
& V% T4 Y& K9 a# B% u! @2 O# pcs resource create httpd_ser apache configfile="/etc/httpd/conf/httpd.conf" statusurl="http://127.0.0.1/server-status" --group apache
5 U! @- s, [" Q+ n" L& KSince we are not using fencing, disable it (STONITH). You must disable to start the cluster resources, but disabling STONITH in the production environment is not recommended.8 y' E9 I! T6 j- R0 p
9 D7 t# U- `3 @3 ^. ^6 W* c# pcs property set stonith-enabled=false
]& ^5 B: M; s. S% lCheck the status of the cluster.
4 b, B" @5 q3 C' e4 Q% }+ M3 ]$ {! s$ K: S7 ?1 o$ I
[root@node1 ~]# pcs status& L/ T8 [, F- J7 f' g. a* d
Cluster name: itzgeek_cluster8 Z1 n# b2 F$ ^4 O
Last updated: Fri Mar 25 13:47:55 2016 Last change: Fri Mar 25 13:31:58 2016 by root via cibadmin on node1.itzgeek.local7 y7 t- _4 y% i/ H! h1 n/ i
Stack: corosync, W' e4 E4 w' f' ^0 w
Current DC: node2.itzgeek.local (version 1.1.13-10.el7_2.2-44eb2dd) - partition with quorum% m* @+ _7 s% t2 b j Y
2 nodes and 3 resources configured
( J3 n$ I. [) n T* Y
. Y" h9 T( m( [5 {Online: [ node1.itzgeek.local node2.itzgeek.local ]5 F5 d- e, Y9 O- ^9 s6 m
3 A( A& b/ w5 |# W3 g5 X0 T1 j; jFull list of resources:$ n4 a8 {: W5 K4 N7 G8 I! u
3 F8 V5 _( }! M) ?" Q6 }' ~ Resource Group: apache
0 y& Z0 a/ a- g, v4 _2 j httpd_vip (ocf::heartbeat:IPaddr2): Started node1.itzgeek.local
4 W+ v5 p) L# a# t0 ?* q; v httpd_ser (ocf::heartbeat:apache): Started node1.itzgeek.local
2 t$ S3 m% T" W httpd_fs (ocf::heartbeat:Filesystem): Started node1.itzgeek.local
9 Y, @5 }( { P8 a5 P. e; \
4 @* d: J8 `: R/ ? Q+ BPCSD Status:( D8 x% ~% [# W5 e* i/ q
node1.itzgeek.local: Online& R( ~; t' D i
node2.itzgeek.local: Online
8 l; n( w' [/ o; O3 e/ \! O3 g4 A0 t4 t" `5 H+ ?& E
Daemon Status:
a3 d8 Q4 n; O$ ]5 i& L$ T7 z& ` corosync: active/enabled
, I. f2 W5 Z5 P+ i8 o; ~ pacemaker: active/enabled
! A7 ?( D Y) k/ E; W8 A2 c pcsd: active/enabled |
|