Redundant management nodes in MySQL Cluster

本文详细介绍了如何在MySQL集群环境中为管理节点设置冗余,并实现故障转移,确保集群的高可用性和稳定性。通过在配置文件中添加多个管理节点实例,配置管理节点间的连接字符串,以及确保所有管理节点配置一致,可以轻松实现这一目标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下技术应用于最优质的水果的鲜果篮

Every time I teach the MySQL Cluster architecture, someone inevitably asks "Isn't the management node (ndb_mgmd) a single point of failure?" The short answer: no. The management node is not a SPOF because the cluster can continue without it. However, it's inconvenient if your management node is down because the management node does several things such as:
  • Provide status information about the cluster and allow you to use the ndb_mgm for various maintenance tasks like taking a hot backup
  • Own the cluster config file (therefore it must be running to start a node)
  • Arbitration in case of a potential split-brain
  • Logging

So while the management node  can  be down, it is nice to have a redundant one for failover. This is very easy to do:

  1. Add 2 [NDB_MGMD] sections to config.ini:
    [NDB_MGMD]
    #Id is required when defining multiple mgmt nodes
    Id=1
    Hostname=192.168.0.31

    [NDB_MGMD]
    Id=2
    Hostname=192.168.0.32

  2. Change the ndb-connectstring to include both IPs of the management nodes:
    [mysql_cluster]
    ndb-connectstring=192.168.0.31,192.168.0.32

  3. Make sure the config.ini is on both management nodes and that the files are identical. Start both ndb_mgmd nodes.

That's it! The management nodes will act in an active-passive way and failover as necessary. Make sure you do not run any management node on the same physical host as a data node - it will cause a cluster shutdown if they fail simultaneously.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值