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.
- Vim/etc/mysql/my. cnf
- -------------- My. cnf start ---------------
- Ubuntu @ ubuntu :~ $ Cat/etc/mysql/my. cnf
- #
- # The MySQL database server configuration file.
- #
- # You can copy this to one:
- #-"/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
- #-Print-defaults to see which it wocould actually understand use.
- #
- # For explanations see # http://dev.mysql.com/doc/mysql/en/serve... ables.html
- # This will be passed to all mysql clients
- # It has been reported that passwords shoshould be 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. sock
- # Here is entries for some specific programs
- # The following values assume you have at least 32 M ram
- # This was formally known as [safe_mysqld]. Both versions are currently parsed. [mysqld_safe] socket =/var/run/mysqld. sock nice = 0 [mysqld]
- #
- # * Basic Settings
- #
- #
- # * IMPORTANT
- # If you make changes to these settings and your system uses apparmor, you may
- # Also need to also adjust/etc/apparmor. d/usr. sbin. mysqld.
- # 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
- #
- # Instead of skip-networking the default is now to listen only on
- # Localhost which is more compatible and is not less secure.
- # Bind-address = 127.0.0.1
- #
- # * Fine Tuning
- # Key_buffer = 16 M max_allowed_packet = 16 M thread_stack = 128 K thread_cache_size = 8
- # Max_connections = 100 # table_cache = 64 # thread_concurrency = 10
- #
- # * Query Cache Configuration
- # Query_cache_limit = 1 M query_cache_size = 16 M
- #
- # * Logging and Replication
- #
- # Both location gets rotated by the cronjob.
- # Be aware that this log type is a performance killer.
- # Log =/var/log/mysql. log
- #
- # Error logging goes to syslog. This is a Debian improvement
- #
- # Here you can see 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 be used as easy to replay backup logs or for replication.
- # Note: if you are setting up a replication slave, see README. Debian about
- # Other settings you may need to change.
- # Server-id = 1
- # Log_bin =/var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100 M
- # Binlog_do_db = include_database_name
- # Binlog_ignore_db = include_database_name
- #
- # * BerkeleyDB
- #
- # Using BerkeleyDB is now discouraged as its support will cease in 5.1.12. skip-bdb
- #
- # * MyISAM
- #
- # MyISAM is enabled by default with a 10 MB datafile in/var/lib/mysql /.
- # Read the manual for more MyISAM related options. There are unavailable!
- # You might want to disable MyISAM to shrink the mysqld process by circa 100 MB.
- # 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 = 16 M [mysql]
- # No-auto-rehash
- # Faster start of mysql but no tab completition [isamchk] key_buffer = 16 M
- #
- # * 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 from this file!
- # The files must end with '. cnf', otherwise they'll be ignored.
- #! Includedir/etc/mysql/conf. d/
- Ubuntu @ ubuntu :~ $
- ----------- My. cnf ended -------------------