欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ubuntu下Mysql的HA(corosync+pacemaker+drbd)

程序员文章站 2022-05-05 17:31:43
...

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 验证crm status Master/Slave Set: ms_mysqldrbd [mysqldrbd] Masters: [ ha1 ] Slaves: [ ha2 ] mystore (ocf::heartbeat:Filesystem):Started ha1 mysql (lsb:mysql):Started ha1 vip (ocf::heartb

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  验证crm status

  Master/Slave Set: ms_mysqldrbd [mysqldrbd]

  Masters: [ ha1 ]

  Slaves: [ ha2 ]

  mystore (ocf::heartbeat:Filesystem):Started ha1

  mysql (lsb:mysql):Started ha1

  vip (ocf::heartbeat:IPaddr):Started ha1

  四、验证:

  1、客户端mysql验证:

  mysql -uroot -p -h 192.168.153.200

  mysql> show databases;

  +--------------------+

  | Database |

  +--------------------+

  | information_schema |

  | mysql |

  | performance_schema |

  | test |

  | test1 |

  +--------------------+

  2、模拟故障:

  root@ha1:~# crm

  crm(live)# node

  crm(live)node# standby

  crm(live)node# show

  ha1: normal

  standby: on

  ha2: normal

  crm(live)node# exit

  bye

  此时看一下状态:

  root@ha1:~# crm status

  Node ha1: standby

  Online: [ ha2 ]

  Master/Slave Set: ms_mysqldrbd [mysqldrbd]

  Masters: [ ha2 ]

  Stopped: [ mysqldrbd:0 ]

  mystore (ocf::heartbeat:Filesystem):Started ha2

  mysql (lsb:mysql):Started ha2

  vip (ocf::heartbeat:IPaddr):Started ha2

  此时,mysql已经运行于ha2上了。

[1] [2] [3]

ubuntu下Mysql的HA(corosync+pacemaker+drbd)