Comments on How To Set Up A Load-Balanced MySQL Cluster
How To Set Up A Load-Balanced MySQL Cluster This tutorial shows how to configure a MySQL 5 cluster with three nodes: two storage nodes and one management node. This cluster is load-balanced by a high-availability load balancer that in fact has two nodes that use the Ultra Monkey package which provides heartbeat (for checking if the other node is still alive) and ldirectord (to split up the requests to the nodes of the MySQL cluster).
21 Comment(s)
Comments
This is rather unfortunate, but without foreign keys support and memory-only storage MySQL cluster is not a really viable solution for most RDBMS users.
The InnoDB engine supports foriegn keys and works with the MySQL cluster so your comment is incorrect sir.
Actually you are wrong mate. While InnoDB in MySQL supports foriegn keys, you can not use InnoDB while setting up the MySQL Cluster support described in this article. You can only use the NDB backend which is a simplified version of MyISAM. It also has the limitation of being completely memory resident.
NDB Cluster has *nothing* to do with MyISAM. NDB has a long history outside of MySQL, and it has no relationship whatsoever to MyISAM.
We had MySQL Cluster running as the backend for a cluster of webapps and it had numerous problems. Many of them just from lack of needed features. I opened a lot of enhancement requests to MySQL about these. Some like all 'mysql' tables are not centrolized but separate would nearly drive you insane. We had to try synchronizing the user tables between all the client nodes. Another issue is that when a user installs a webapp, if one of the client nodes happened to be down for maintenance at the time, that node would never learn of the new database the user just setup so if the load balancer directed him to that client node later on everything would error. There are just many architectural issues with MySQL Cluster that were never very well thought through. It has a long way to go to being enterprise ready. And performance was abysmal to boot.
Memory only storage is a significant limitation. I hope this is fixed in a future version.
Well, not anymore:
In MySQL 5.1, the memory-only requirement of MySQL Cluster is removed and operational data may now be accessed both on disk and memory. A DBA can specify that table data can reside on disk, in memory, or a combination of main memory and disk (although a single table can only be assigned to either disk or main memory). Disk-based support includes new storage structures - tablespaces – that are used to logically house table data on disk. In addition, new memory caches are in place to manage the transfer of data stored in tablespaces to memory for fast access to repeatedly referenced information.
"Memory only storage is a significant limitation. I hope this is fixed in a future version." This isn't a limitation to be fixed, but the fundamental tradeoff in MySQL Cluster Server's design: by accepting the limitation of being memory-based instead of disk based, it can be several orders of magnitude faster. If your data can't fit in RAM, and you don't need the performance, you should use one of the disk-based table types.
The cluster management software seems to be a single point of failure; that is, if the load balancer running this software goes down, doesn't the cluster either go down or end up with inconsistent data ("split brain", as referenced in the article)?
I'm very new to clustering, so I'd be happy to learn why I'm wrong!
The storage and MySQL Server nodes are not dependent on the management server for their execution. Its purpose is only to manage the cluster. It may fail and be restarted any number of times without affecting the running MySQL Cluster.
You use Debian and install package from source. Don't store files in /usr/bin. Use /usr/local or /opt.
Custom packages installed in /usr can be broken by Debian packaging system.
Actually, if you use chkinstall instead of 'make instal', it'll add the package to your apt setup so the files won't be overwritten
You can make each balancer a management server and eliminate a single point of failure.
Install manager on both lb and add both to config.ini
# Managment Server 1
[NDB_MGMD]
HostName=192.168.0.8 # the IP of the First Management Server
ID=1
Datadir=/var/lib/mysql-cluster
# Managment Server 2
[NDB_MGMD]
HostName=192.168.0.9 # the IP of the Second Management Server
ID=2
Datadir=/var/lib/mysql-cluster
then on each data node modify my.cnf
[mysqld]
ndbcluster
ndb-connectstring = "host=192.168.0.8,host=192.168.0.9"
[ndb_mgm]
connect-string = "host=192.168.0.8,host=192.168.0.9"
[ndbd]
connect-string = "host=192.168.0.8,host=192.168.0.9"
make sure to run ndbd --initial
I wanted to know whether or not there will be significant changes in performance if we run apache with load balancing enabled with mysql cluster.
Has anyone tried it before ?
Anjin
Thanks a lot! This document helped a lot in configuring MYSQL cluster. I have a query. I am going to configure web server on the nodes using Tomcat, Is it possible to use the mysql virtual ip for tomcat configurtion...
http://www.dancryer.com/2010/01/mysql-circular-replication
This is part 1 of a three posts series:
- MySQL Load-Balanced Cluster Guide – Part 1 - setting up the servers themselves and configuring MySQL replication.
- MySQL Load-Balanced Cluster Guide – Part 2 - set up a script to monitor the status of your MySQL cluster nodes, which we’ll use in the next guide to set up our proxy.
- MySQL Load-Balanced Cluster Guide – Part 3 - setting up the load balancer with HAProxy, using the monitoring scripts
Very elaborative tutorial I must say. A noob coming here can do a lot after reading the tutorial !!
How to add additional data node?
This is a very old tutorial, and needs to be updated
Question Regarding MySQL Cluster Ports Hello, I am on Linux platform with MySQL NDB 5.7. I am trying to monitor all traffic related to MySQL clustering - between data nodes, management node and sql nodes. To that end, I used netstat to list all open ports listening on my machine before starting MySQL cluster. Then, I started MySQL cluster and ran netstat again. I assumed that the ports that were listening the second time around, but not the first time, were related to MySQL clustering. But there are two problems with this. First, there could be ports opened by other processes between the two netstat runs. Second, MySQL might open other ports after I ran the netstat command the second time.
What is the best way to go about finding all ports being used by MySQL for clustering purposes?
I believe ephemeral ports are picked dynamically, so perhaps if I knew all the MySQL clustering related processes that would be running, I can figure out every port that they are using. Pointers will be very welcome.where are sql nodes?
why should we bother about load balancing? I though mysql cluster do it automatically.