How to install a MySQL cluster on a single UNIX/Linux server

logo mysql sun How to install a MySQL cluster on a single UNIX/Linux server In this tutorial I will show you how to install a MySQL cluster on a single node: obviously you will not gain any hardware redundancy with this setup but it is useful if you need to create a test installation as it was for me. You can find many tutorials about this topic but they are quite old and MySQL Cluster changed a lot in last years.

What is a MySQL cluster?

Let’s start explaining the architecture of a MySQL cluster with an image taken from dev.mysql.com:

cluster components 1 How to install a MySQL cluster on a single UNIX/Linux server

As you may see the MySQL cluster is an aggregation of many components:

  • one management server;
  • many MySQL daemons that acts as “frontend”;
  • many data nodes that store the real data.

This tutorial will guide you in the creation of a cluster with:

  • one management node;
  • two MySQL daemons;
  • two data nodes.

Obviously you can expand this configuration simply adding the components you need. As stated at the beginning of this tutorial you can create all this setup on a single server (well you need 3 IPs on the server) or, and that would be very easy, you can split the MySQL cluster components on many servers.

Pages: 1 2 3 4 5 6 7

26 Responses to “How to install a MySQL cluster on a single UNIX/Linux server”

  1. Karuna says:

    Hi,
    Thanks a lot. This demonstration is very useful to me and it is working fine. I have installed and tested the mysql clusters in my single linux machine.

    Very useful……………….. :)

  2. apiero says:

    Hi Karuna,

    many thanks for your feedback: I tried all these steps for a clean installation but I’m also the writer of this tutorial ;)

    Bye
    Apiero

  3. Snehalkumar Patel says:

    Hi..
    I am facing problem after completing cluster configuration, cluster runs properly but i dont see “Master” in [ndbd(NDB)] 2 nodes, both nodes show:
    [ndbd(NDB)] 2 node(s)
    id=2 @192.168.42.174 (mysql-5.1.23 ndb-6.2.15, starting, Nodegroup: 0)
    id=3 @192.168.42.175 (mysql-5.1.23 ndb-6.2.15, starting, Nodegroup: 0)

    :-(
    I am using Redhat Enterprise 5.
    Please Help

  4. apiero says:

    Hi,

    did you verify that the firewall was disabled? Maybe it is blocking some ports
    Try, as root, with:
    /etc/init.d/iptables stop
    /etc/init.d/ip6tables stop

    Please let me know if it works or not.

    Bye
    Apiero

  5. Kagan says:

    when trying to run the deamon in the final step get the following error msg:

    /usr/lib/mysql_cluster/node_1/bin/mysqld: Table ‘mysql.plugin’ doesn’t exist
    090122 18:01:18 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
    090122 18:01:18 InnoDB: Started; log sequence number 0 46409
    090122 18:01:18 [Note] Starting Cluster Binlog Thread
    090122 18:01:18 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

    any idea why?

  6. apiero says:

    Hi Kagan,

    did you use the exact versions of MySQL that I did? It looks like you missed the first part of page 6 (http://www.brucalipto.org/linux/how-to-install-a-mysql-cluster/6).

    Please let me know if it works or not.

    Bye
    Apiero

  7. Alexwebmaster says:

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  8. Fernando says:

    hi mate, i’ve managed to get almost everything working..
    instead of doing everything on one host, i did it with 3 VMs, one is management, and 2 nodes/storage.
    I got the nodes to connect without problems. but i can’t get the mysql database to connect. any ideas?

    Cluster Configuration
    ———————
    [ndbd(NDB)] 2 node(s)
    id=2 @172.12.13.105 (Version: 7.0.6, starting, Nodegroup: 0)
    id=3 @172.12.13.106 (Version: 7.0.6, starting, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @mgm01 (Version: 7.0.6)

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

    thanks

  9. totojack says:

    Hi.

    Do you think is it better a cluster or a replication (1 master – n slave) configuration in a situation of an high load website?
    And have you ever tried mysql proxy as loadbalancer?

  10. apiero says:

    Hi,

    I think that in a situation of an high load website a cluster would be better but keep in mind that the MySQL cluster has many “limitation”: not really limitations but its own rules. Keep in mind that MySQL is very fast so maybe a simple node could be sufficient.
    I tried to look at MySQL proxy as loadbalancer but I did not understand how does it work: actually if I would need to setup something “big” with MySQL I would try MMM (Multi-Master Replication Manager) for MySQL[1].

    Please let me know what was your choice!
    Bye
    Apiero
    [1]http://mysql-mmm.org/

  11. Rebel says:

    Hi,

    (still alive ?)

    im having a question …

    i am running the ndb managment server and the mysql server one on the same server and the mysql server 2 on a second server.

    if the server 1 (with mysql1 and mgmt server) crashes > there is data loss > what will append when i will restart the whole servers ?

    the cluster system is only transmitting the queries ? isn’t it?

  12. I normally don’t write-up in Blogs but your weblog forced me to, awesome operate.. stunning

  13. Been looking for this article for long time ago and finally found here. thanks for sharing this post. appreciate!

  14. China Dishes says:

    good good…this post deserves nothing …hahaha just joking :P …good submit :P

  15. be a mad dog says:

    Thank you. Good website you got here. Have some extra websites to direct to with a bit more stuff like this?

  16. Herry says:

    This is very useful info. Thanks for writing it. I am waiting for your new article

  17. Loving the information on this site, you have done great job on the content .

  18. Neon Light says:

    .~’ that seems to be a great topic, i really love it `-:

  19. Bathroom says:

    Nice post!!! Thank you very much for sharing.

  20. Great post. I was checking constantly this blog and I’m impressed! Very helpful information specifically the last part :) I care for such information a lot. I was looking for this particular information for a very long time. Thank you and best of luck.

  21. Excellent post! Thank you for sharing! Bookmarked! Just in case you update this in the future! Good thing I stumbled upon this internet site. Thank you! I wouldn’t have known! Where did you get the resource for this blog post? It’s very informative! Do you mind if I pick up some material from this post? I will link back to your article.

  22. Right now it appears like WordPress is the preferred blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?

  23. http://uhowtoget.com/how-to-get-fat-a-guide-to-get-fat says:

    Just like the old saying goes, within the pro’s head there are few options, even so , for a person with the beginner’s brain, the world is open up.

  24. Manu says:

    Can have mysql cluster his components distributed on machines with different SO (Win-management,Linux-data and sql nodes,etc) ?

    • apiero says:

      Hi,

      I found in MySQL Cluster FAQ[1] that it is possible.

      Bye
      Apiero

      [1]http://dev.mysql.com/doc/refman/5.0/en/faqs-mysql-cluster.html#qandaitem-B-10-1-31

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>