How to configure MySQL cluster in ubuntu9.0
This article is about how to configure MySQL clusters in ubuntu9.0. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
Test environment:
Server1: ndbd 192.168.245.11
Server2: ndbd 192.168.245.12
Server3: mysqld-ndb-cluster 192.168.245.13
Ndbd: node.
D-ndb-cluster: the MySQL server node, and the program accesses the IP of this machine directly. The default port is still 3306.
Ndbd_mgm ndbd_mgmd: manage the node. Manage / view the status of each library node and server node.
II. Cluster scheme
1. Management node: server3 (192.168.245.13)
two。 Storage node: server1 (192.168.245.11), server2 (192.168.245.12)
3.SQL node: server1 (192.168.245.11), server2 (192.168.245.12), server3 (192.168.245.13)
III. Installation and configuration of mysql
1. Installation, sudo apt-get install mysql-server
two。 Configure my.cnf on these three servers, all of which need to be configured
Vim / etc/mysql/my.cnf
-- my.cnf starts--
Ubuntu@ubuntu:~$ cat / etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You 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 see which it would actually understand and 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 should 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/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was 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 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/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 on
# localhost which is more compatible and is 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 = 100 # table_cache = 64 # thread_concurrency = 10
#
# * Query Cache Configuration
# query_cache_limit = 1m query_cache_size =