Below examples show how could one mange the HA resources in between the nodes.
- Check Cluster status
[root@dbmaster-01
~]# crm_mon -1
============
Last updated: Fri
Dec 30 00:43:51 2011
Last change: Fri Dec
30 00:20:38 2011 via crm_attribute on dbmaster-01.localdomain
Stack: openais
Current DC:
dbmaster-01.localdomain - partition with quorum
Version:
1.1.6-3.el6-a02c0f19a00c1eb2527ad38f146ebc0834814558
2 Nodes configured,
2 expected votes
5 Resources
configured.
============
Online: [
dbmaster-01.localdomain dbmaster-02.localdomain ]
Resource Group:
dbGroup
ClusterIP
(ocf::heartbeat:IPaddr2): Started dbmaster-01.localdomain
DBstore
(ocf::heartbeat:Filesystem): Started dbmaster-01.localdomain
MySQL
(ocf::heartbeat:mysql): Started dbmaster-01.localdomain
Clone Set:
pingclone [check-ext-conn]
Started: [
dbmaster-01.localdomain dbmaster-02.localdomain ]
- Put node to offline mode
[root@dbmaster-01
~]# crm node standby
[root@dbmaster-01
~]# crm_mon -1
============
Last updated: Fri
Dec 30 00:44:45 2011
Last change: Fri Dec
30 00:44:39 2011 via crm_attribute on dbmaster-01.localdomain
Stack: openais
Current DC:
dbmaster-01.localdomain - partition with quorum
Version:
1.1.6-3.el6-a02c0f19a00c1eb2527ad38f146ebc0834814558
2 Nodes configured,
2 expected votes
5 Resources
configured.
============
Node
dbmaster-01.localdomain: standby
Online: [
dbmaster-02.localdomain ]
Resource Group:
dbGroup
ClusterIP
(ocf::heartbeat:IPaddr2): Started dbmaster-02.localdomain
DBstore
(ocf::heartbeat:Filesystem): Started dbmaster-02.localdomain
MySQL
(ocf::heartbeat:mysql): Started dbmaster-02.localdomain
Clone Set:
pingclone [check-ext-conn]
Started: [
dbmaster-02.localdomain ]
Stopped: [
check-ext-conn:0 ]
- Put node to online mode
[root@dbmaster-01
~]# crm node online
[root@dbmaster-01
~]# crm_mon -1
============
Last updated: Fri
Dec 30 00:45:12 2011
Last change: Fri Dec
30 00:45:10 2011 via crm_attribute on dbmaster-01.localdomain
Stack: openais
Current DC:
dbmaster-01.localdomain - partition with quorum
Version:
1.1.6-3.el6-a02c0f19a00c1eb2527ad38f146ebc0834814558
2 Nodes configured,
2 expected votes
5 Resources
configured.
============
Online: [
dbmaster-01.localdomain dbmaster-02.localdomain ]
Resource Group:
dbGroup
ClusterIP
(ocf::heartbeat:IPaddr2): Started dbmaster-02.localdomain
DBstore
(ocf::heartbeat:Filesystem): Started dbmaster-02.localdomain
MySQL
(ocf::heartbeat:mysql): Started dbmaster-02.localdomain
Clone Set:
pingclone [check-ext-conn]
Started: [
dbmaster-01.localdomain dbmaster-02.localdomain ]
- Migrate resources to neighbor node
[root@dbmaster-01
~]# crm resource migrate dbGroup dbmaster-02.localdomain
[root@dbmaster-01
~]# crm_mon -1
============
Last updated: Fri
Dec 30 00:47:50 2011
Last change: Fri Dec
30 00:47:35 2011 via crm_resource on dbmaster-01.localdomain
Stack: openais
Current DC:
dbmaster-01.localdomain - partition with quorum
Version:
1.1.6-3.el6-a02c0f19a00c1eb2527ad38f146ebc0834814558
2 Nodes configured,
2 expected votes
5 Resources
configured.
============
Online: [
dbmaster-01.localdomain dbmaster-02.localdomain ]
Resource Group:
dbGroup
ClusterIP
(ocf::heartbeat:IPaddr2): Started dbmaster-01.localdomain
DBstore
(ocf::heartbeat:Filesystem): Started dbmaster-01.localdomain
MySQL
(ocf::heartbeat:mysql): Started dbmaster-01.localdomain
Clone Set:
pingclone [check-ext-conn]
Started: [
dbmaster-01.localdomain dbmaster-02.localdomain ]
- Start / Stop / Restart specific resouce on node
[root@dbmaster-01
~]# crm resource status MySQL
resource MySQL is
running on: dbmaster-01.localdomain
...
[root@dbmaster-01
~]# crm resource stop MySQL
....
[root@dbmaster-01
~]# crm resource start MySQL
沒有留言:
張貼留言