23

Setting Up A MySQL Cluster


Posted by Artem Russakovskii on March 26th, 2008 in Databases, Linux, Programming, Technology
Share

Updated: January 4th, 2009

23 Responses to “Setting Up A MySQL Cluster”

    21 Comments:
  1. Thaya says:

    Great guide. I'm sure I will use this in the future. Thanks!

  2. Timbo says:

    Best explanation I have been able to find in regards to MySQL Clusters.

    Thanks

  3. Harrison Fisk says:

    Thanks for the positive comments regarding my book, I'm glad it helped!

  4. Harrison, you're welcome. It's a great book indeed! Honored to have you post here.

  5. Martin Grasso says:

    Thanks for the article, is excelent!
    Is possible to have a high available Management node?

    thanks in advance

  6. MBahrami says:

    Good summary; If you're considering NDB, consider how schema changes will be implemented (still need to take cluster to single-user mode?); consider DataMemory size limitations and how use of UTF-8 affects (converting a db with long rows caused us problems); test response time for multi-table joins.

  7. Martin, thank you. It's possible and, in fact, recommended by MySQL. From: http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-basics.html, "The use of multiple management nodes is also highly recommended."

    You can find out how in Chapter 2 of http://www.amazon.com/dp/0672328550/?tag=beepla-20:
    "To use multiple management nodes, first of all, you need to create a config.ini file, which must be the same (completely identical) for all management nodes (there is no checking done on this, but if the files are not identical, you will get a giant mess and a cluster crash). When using multiple management nodes, you have to assign all the IDs for the nodes manually in the configuration file. You cannot rely on auto-assignment due to the fact that you can have multiple management nodes assigning the IDs.

    You then need to decide which of your management nodes is going to be primary."
    The book offers details and sample configurations, so I highly suggest buying it.

  8. John says:

    I have questions about your cluster:
    1) Is "mysql-server" programe no need to install in SQL nodes or NDB nodes or just install "mysql-cluster" programe?
    2) I have downloaded "mysql-cluster-gpl-6.2.15-linux-i686-glibc23.tar.gz", I want to know that the file is same as "mysql-5.1.22-rc-linux-i686-icc-glibc23.tar.gz" you mentioned?

  9. John, you bring up an excellent point. Apparently since the release of 5.1.25, cluster is packaged separately. I need to do some reading and research first and then update the tutorial with the latest info.

    Here are some quick links for now: http://blogs.mysql.com/kaj/2008/05/23/mysql-clusters-improved-release-model/, http://johanandersson.blogspot.com/2008/05/mysql-cluster-62-officially-released.html, http://blogs.sun.com/theaquarium/entry/improved_release_model_for_mysql.

  10. Scott says:

    For us noobs, make sure you remove any spaces in the config.ini, my data nodes would not connect until I removed them..

    The next article I want to see is how to connect to the mysql nodes using mysql-proxy =)…

    Thanks for the great post and time you put into this!!

  11. Phil says:

    This is a great article on MySQL Cluster – much more informative than many other similar articles I've read on other sites.

    I am curious however why you would setup (from your screenshot) 4 nodes that are running both ndbd and mysqld.

    In tests I've found that performance is much better running mysqld on separate machines from ndbd. It's also recommended that you do not run mysqld on the same servers as ndbd in production environments. It is evident from testing with a 2 x 2 setup that mysqld puts more load on the servers than ndbd does. Did you try running 2 mysqld and 2 ndbd servers before deciding to run 4 combined servers instead?

  12. Phil, thank you.

    As far as the setup, by all means, in production one should split data and sql nodes. When doing my setup, I only had 4 machines available, so I decided to double load them. I guess I should have made that more obvious in the article.

  13. geetha says:

    Hi all,

    I want to set it up on 2 nodes only..

    I want the management stuff,the db engine and the storage engine on one node and the db engine and the storage engine on the second node.

    Is it possible? Please help

    Thanks
    Geetha

  14. geetha says:

    great article… I followed up this one.. working successfully…

    thanks Artem Russakovskii

    regards
    sg..

  15. Amit Verma says:

    If you want to LEARN more, please visit URL -

    http://www.howtoforge.com/loadbalanced_mysql_cluster_debian

  16. William Gardner says:

    Awesome post – really useful thanks – bookmarked,

  17. srivastava sk says:

    We have a sample NDB Cluster setup having all the nodes running on one machine ndbmgm=1,mysqld=1 ,data node=2
    group=1,replication=2).Total sample data size is around 4 GB. NDBD configuration parameters – DataMemory=15GB & IndexMemory =5GB
    (H/W T2000 Solaris server 32 CPU Strands (8 cores)32 GB RAM.Now the issue is even in case of idle system with clean shutdown of a node it takes around 70 minutes for startup in both ways ( ./bin/ndbd or ./bin/ndbd –initial).Please comment on this. Even query performnce is also very low in comparission to innodb.

  18. @srivastava
    I think you should post your question at a MySQL Cluster forum. I think experts there would be able to provide more help than me, as I haven't played around with the cluster for a while.

  19. Retif says:

    What is the maximum number of nodes that be run on one machine?

  20. Avijit says:

    Management Server IP is 192.168.0.125
    Nodes are
    192.168.0.218 and 192.168.0.236

    I modify the existing my.cnf file in 192.168.0.218
    [mysqld]
    ndbcluster
    ndb-connectstring=192.168.0.125
    [mysql_cluster]
    ndb-connectstring=192.168.0.125
    After that I tried to restart mysql in .218 server. But Mysql can not start
    Where as in Management Node it says
    ndb_mgm> show
    Cluster Configuration
    ———————
    [ndbd(NDB)] 2 node(s)
    id=2 @192.168.0.218 (Version: 5.0.77, starting, Nodegroup: 0)
    id=3 (not connected, accepting connect from 192.168.0.236)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @192.168.0.125 (Version: 5.0.77)

    [mysqld(API)] 2 node(s)
    id=4 (not connected, accepting connect from any host)
    id=5 (not connected, accepting connect from any host)

    Can u please help me on that.
    Thanks

  21. Chuan says:

    Great guild. I do have question regarding to 7.0.7 mysql cluster package. In MySQL cluster, i only install cluster package for 2 data nodes and 1 sql node. Do I have to install separate mysql package for mysql node and additional mysql cluster package? It seems that the mysql package includes mysql packet because I was able to run mysqld with only mysql cluster package. The scienario is: 1 mgmt node (good), 2 data nodes(good), 1 mysql node (no good)…it only recognize data directory from its own machine?

  22. 2 Pings:
  23. [...] Setting Up A MySQL Cluster | beer planet (tags: cluster howto mysql tutorials) [...]

  24. [...] What is clustering? » Federated Search Blogglandium.org » Blog Archive » How not to provide robust clustered storage with Linux and GFSTraxmusic, pro audio reviews » Audio Archive » Cluster Sound launch227 Volts » Building a Hyper-V SQL 2008 ClusterSetting Up A MySQL Cluster | beer planet [...]

Leave a Reply

Connect with Facebook