Configuring the MySQL cluster detailed tutorial on ubuntu9.0

Source: Internet
Author: User
Tags manual end key log mysql socket mysql database

Home can be found on the Internet are Redhat systems and so on, the Ubuntu system MySQL cluster does not introduce articles, I now write to write Ubuntu this MySQL cluster method. Novice don't scold me, hehe.

Introducing 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 program directly accesses the IP of this machine. The default port is still 3306.

NDBD_MGM NDBD_MGMD: admin node. Manage/View the status of each library node and server node.

II. Cluster programme

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), Server3 (192.168.245.13)

Third, MySQL installation and configuration

1. Installation, sudo apt-get install Mysql-server

2. Configure the three servers to configure MY.CNF, these three servers are configured

 
 
  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. # can copy this to one of:
  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 with
  13. #–print-defaults to the which it would actually understand and use.
  14. #
  15. # for explanations Http://dev.mysql.com/doc/mysql/en/serve ... ables.html
  16. # This is passed to all MySQL clients
  17. # It has been reported that passwords should is 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/mysqld.sock
  20. # Here's entries for some specific programs
  21. # The following values assume your have at least 32M RAM
  22. # This is formally known as [Safe_mysqld].  Both versions are currently parsed. [Mysqld_safe] socket =/var/run/mysqld/mysqld.sock Nice = 0 [mysqld]
  23. #
  24. # * Basic Settings
  25. #
  26. #
  27. # * IMPORTANT
  28. # If You do changes to these settings and your system uses AppArmor
  29. # also need to also adjust/etc/apparmor.d/usr.sbin.mysqld.
  30. # user = MySQL Pid-file =/var/run/mysqld/mysqld.pid socket =/var/run/mysqld/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
  33. # localhost which are more compatible and are not less secure.
  34. # bind-address = 127.0.0.1
  35. #
  36. # * Fine Tuning
  37. # Key_buffer = 16M Max_allowed_packet = 16M Thread_stack = 128K Thread_cache_size = 8
  38. #max_connections = #table_cache = #thread_concurrency = 10
  39. #
  40. # * Query Cache Configuration
  41. # query_cache_limit = 1M Query_cache_size = 16M
  42. #
  43. # * Logging and Replication
  44. #
  45. # Both location gets rotated by the cronjob.
  46. # Be aware the This log type is a performance killer.
  47. #log =/var/log/mysql/mysql.log
  48. #
  49. # Error logging goes to syslog. This is a Debian improvement
  50. #
  51. # Here you can-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 is used as easy to replay backup logs or for replication.
  56. # note:if You are setting up a replication slave. Debian about
  57. # Other settings for may need to change.
  58. #server-id = 1
  59. #log_bin =/var/log/mysql/mysql-bin.log Expire_logs_days = Max_binlog_size = 100M
  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 to cease in 5.1.12. Skip-bdb
  66. #
  67. # * MyISAM
  68. #
  69. # MyISAM is enabled by default with a 10MB datafile in/var/lib/mysql/.
  70. # Read the manual for more MyISAM related options. There are many!
  71. # You might want to disable MyISAM to shrink the mysqld process by circa 100MB.
  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 = 16M [MySQL]
  84. #no-auto-rehash
  85. # faster start of MySQL but no tab completition [Isamchk] Key_buffer = 16M
  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 to this file!
  96. # The files must end with '. Cnf ', and otherwise they ' ll be ignored.
  97. #!includedir/etc/mysql/conf.d/
  98. ubuntu@ubuntu:~$
  99. ——————————— end of the my.cnf ———————————————————




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.