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
- Vim/etc/mysql/my.cnf
- ————————————— –my.cnf Start —————————————— –
- ubuntu@ubuntu:~$ cat/etc/mysql/my.cnf
- #
- # The MySQL database server configuration file.
- #
- # can copy this to one of:
- #-"/ETC/MYSQL/MY.CNF" to set global options,
- #-"~/.MY.CNF" to set user-specific options.
- #
- # One can use ' all long ' options that ' the program supports.
- # Run Program With–help to get a list of available options and with
- #–print-defaults to the which it would actually understand and use.
- #
- # for explanations Http://dev.mysql.com/doc/mysql/en/serve ... ables.html
- # This is passed to all MySQL clients
- # It has been reported that passwords should is enclosed with ticks/quotes
- # escpecially if they contain "#" chars ...
- # Remember to edit/etc/mysql/debian.cnf when changing the socket location. [Client] Port = 3306 Socket =/var/run/mysqld/mysqld.sock
- # Here's entries for some specific programs
- # The following values assume your have at least 32M RAM
- # This is formally known as [Safe_mysqld]. Both versions are currently parsed. [Mysqld_safe] socket =/var/run/mysqld/mysqld.sock Nice = 0 [mysqld]
- #
- # * Basic Settings
- #
- #
- # * IMPORTANT
- # If You do changes to these settings and your system uses AppArmor
- # also need to also adjust/etc/apparmor.d/usr.sbin.mysqld.
- # 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
- #
- # Instead of skip-networking The default is now to listen only
- # localhost which are more compatible and are not less secure.
- # bind-address = 127.0.0.1
- #
- # * Fine Tuning
- # Key_buffer = 16M Max_allowed_packet = 16M Thread_stack = 128K Thread_cache_size = 8
- #max_connections = #table_cache = #thread_concurrency = 10
- #
- # * Query Cache Configuration
- # query_cache_limit = 1M Query_cache_size = 16M
- #
- # * Logging and Replication
- #
- # Both location gets rotated by the cronjob.
- # Be aware the This log type is a performance killer.
- #log =/var/log/mysql/mysql.log
- #
- # Error logging goes to syslog. This is a Debian improvement
- #
- # Here you can-queries with especially long duration #log_slow_queries =/var/log/mysql/mysql-slow.log
- #long_query_time = 2
- #log-queries-not-using-indexes
- #
- # The following can is used as easy to replay backup logs or for replication.
- # note:if You are setting up a replication slave. Debian about
- # Other settings for may need to change.
- #server-id = 1
- #log_bin =/var/log/mysql/mysql-bin.log Expire_logs_days = Max_binlog_size = 100M
- #binlog_do_db = Include_database_name
- #binlog_ignore_db = Include_database_name
- #
- # * BerkeleyDB
- #
- # Using BerkeleyDB is now discouraged as its support to cease in 5.1.12. Skip-bdb
- #
- # * MyISAM
- #
- # MyISAM is enabled by default with a 10MB datafile in/var/lib/mysql/.
- # Read the manual for more MyISAM related options. There are many!
- # You might want to disable MyISAM to shrink the mysqld process by circa 100MB.
- #skip-innodb
- #
- # * Security Features
- #
- # Read The manual, too, if you want chroot!
- # chroot =/var/lib/mysql/
- #
- # for generating SSL certificates I recommend the OpenSSL GUI ' Tinyca '.
- #
- # SSL-CA=/ETC/MYSQL/CACERT.PEM
- # SSL-CERT=/ETC/MYSQL/SERVER-CERT.PEM
- # Ssl-key=/etc/mysql/server-key.pem Ndbcluster ndb-connectstring=192.168.245.13 [mysqldump] Quick quote-names max_ Allowed_packet = 16M [MySQL]
- #no-auto-rehash
- # faster start of MySQL but no tab completition [Isamchk] Key_buffer = 16M
- #
- # * NDB Cluster
- #
- # See/usr/share/doc/mysql-server-*/readme. Debian for more information.
- #
- # The following configuration is read by the NDB Data Nodes (ndbd processes)
- # not from the NDB Management Nodes (NDB_MGMD processes).
- # [Mysql_cluster] ndb-connectstring=192.168.245.13
- #
- # * Important:additional settings that can override those to this file!
- # The files must end with '. Cnf ', and otherwise they ' ll be ignored.
- #!includedir/etc/mysql/conf.d/
- ubuntu@ubuntu:~$
- ——————————— end of the my.cnf ———————————————————