Configure MySQL Cluster on ubuntu9.0 tutorial _ MySQL

Source: Internet
Author: User
Detailed tutorial on configuring MySQL clusters on ubuntu9.0 tumysql cluster

I can find all the RedHat systems on the internet. I have not introduced any articles about the MySQL Cluster of the Ubuntu system. now I am writing the MySQL Cluster method of Ubuntu. Don't scold me for being a newbie.

Introduction to the network environment:

Test environment:

Server1: ndbd 192.168.245.11

Server2: ndbd 192.168.245.12

Server3: mysqld-ndb-cluster 192.168.245.13

Ndbd: database node.

Mysqld-ndb-cluster: MySQL server node. the IP address of this machine is directly accessed by the program. The default port number is 3306.

Ndbd_mgm ndbd_mgmd: management node. Manage/view the status of each database node and server node.

II. Cluster Solution

1. Management Node: server3 (192.168.245.13)

2. storage nodes: server1 (192.168.245.11), server2 (192.168.245.12)

3. SQL nodes: server1 (192.168.245.11), server2 (192.168.245.12), and server3 (192.168.245.13)

III. mysql installation and configuration

1. install sudo apt-get install mysql-server

2. configure my. cnf on the three servers.

 
 
  1. Vim/etc/mysql/my. cnf
  2. -------------- My. cnf start ---------------
  3. Ubuntu @ ubuntu :~ $ Cat/etc/mysql/my. cnf
  4. #
  5. # The MySQL database server configuration file.
  6. #
  7. # You can copy this to one:
  8. #-"/Etc/mysql/my. cnf" to set global options,
  9. #-"~ /. My. cnf "to set user-specific options.
  10. #
  11. # One can use all long options that the program supports.
  12. # Run program with-help to get a list of available options and
  13. #-Print-defaults to see which it wocould actually understand use.
  14. #
  15. # For explanations see # http://dev.mysql.com/doc/mysql/en/serve... ables.html
  16. # This will be passed to all mysql clients
  17. # It has been reported that passwords shoshould be enclosed with ticks/quotes
  18. # Escpecially if they contain "#" chars...
  19. # Remember to edit/etc/mysql/debian. cnf when changing the socket location. [client] port = 3306 socket =/var/run/mysqld. sock
  20. # Here is entries for some specific programs
  21. # The following values assume you have at least 32 M ram
  22. # This was formally known as [safe_mysqld]. Both versions are currently parsed. [mysqld_safe] socket =/var/run/mysqld. sock nice = 0 [mysqld]
  23. #
  24. # * Basic Settings
  25. #
  26. #
  27. # * IMPORTANT
  28. # If you make changes to these settings and your system uses apparmor, you may
  29. # Also need to also adjust/etc/apparmor. d/usr. sbin. mysqld.
  30. # User = mysql pid-file =/var/run/mysqld. pid socket =/var/run/mysqld. sock port = 3306 basedir =/usr datadir =/var/lib/mysql tmpdir =/tmp language =/usr/share/mysql/english skip-external-locking
  31. #
  32. # Instead of skip-networking the default is now to listen only on
  33. # Localhost which is more compatible and is not less secure.
  34. # Bind-address = 127.0.0.1
  35. #
  36. # * Fine Tuning
  37. # Key_buffer = 16 M max_allowed_packet = 16 M thread_stack = 128 K thread_cache_size = 8
  38. # Max_connections = 100 # table_cache = 64 # thread_concurrency = 10
  39. #
  40. # * Query Cache Configuration
  41. # Query_cache_limit = 1 M query_cache_size = 16 M
  42. #
  43. # * Logging and Replication
  44. #
  45. # Both location gets rotated by the cronjob.
  46. # Be aware that this log type is a performance killer.
  47. # Log =/var/log/mysql. log
  48. #
  49. # Error logging goes to syslog. This is a Debian improvement
  50. #
  51. # Here you can see queries with especially long duration # log_slow_queries =/var/log/mysql/mysql-slow.log
  52. # Long_query_time = 2
  53. # Log-queries-not-using-indexes
  54. #
  55. # The following can be used as easy to replay backup logs or for replication.
  56. # Note: if you are setting up a replication slave, see README. Debian about
  57. # Other settings you may need to change.
  58. # Server-id = 1
  59. # Log_bin =/var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100 M
  60. # Binlog_do_db = include_database_name
  61. # Binlog_ignore_db = include_database_name
  62. #
  63. # * BerkeleyDB
  64. #
  65. # Using BerkeleyDB is now discouraged as its support will cease in 5.1.12. skip-bdb
  66. #
  67. # * MyISAM
  68. #
  69. # MyISAM is enabled by default with a 10 MB datafile in/var/lib/mysql /.
  70. # Read the manual for more MyISAM related options. There are unavailable!
  71. # You might want to disable MyISAM to shrink the mysqld process by circa 100 MB.
  72. # Skip-innodb
  73. #
  74. # * Security Features
  75. #
  76. # Read the manual, too, if you want chroot!
  77. # Chroot =/var/lib/mysql/
  78. #
  79. # For generating SSL certificates I recommend the OpenSSL GUI "tinyca ".
  80. #
  81. # Ssl-ca =/etc/mysql/cacert. pem
  82. # Ssl-cert =/etc/mysql/server-cert.pem
  83. # Ssl-key =/etc/mysql/server-key.pem ndbcluster ndb-connectstring = 192.168.245.13 [mysqldump] quick quote-names max_allowed_packet = 16 M [mysql]
  84. # No-auto-rehash
  85. # Faster start of mysql but no tab completition [isamchk] key_buffer = 16 M
  86. #
  87. # * NDB Cluster
  88. #
  89. # See/usr/share/doc/mysql-server-*/README. Debian for more information.
  90. #
  91. # The following configuration is read by the NDB Data Nodes (ndbd processes)
  92. # Not from the NDB Management Nodes (ndb_mgmd processes ).
  93. # [MYSQL_CLUSTER] ndb-connectstring = 192.168.245.13
  94. #
  95. # * IMPORTANT: Additional settings that can override those from this file!
  96. # The files must end with '. cnf', otherwise they'll be ignored.
  97. #! Includedir/etc/mysql/conf. d/
  98. Ubuntu @ ubuntu :~ $
  99. ----------- My. cnf ended -------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.