您好,欢迎访问一九零五行业门户网

在ubuntu9.0上配置MySQL集群详细教程_MySQL

ubuntumysql集群
家在网上都能找到都是redhat系统等等,对ubuntu系统mysql集群就没有介绍文章,我现在写写ubuntu这个mysql集群方法。新手不要骂我,呵呵。
介绍网络环境:
测试环境:
server1: ndbd 192.168.245.11
server2: ndbd 192.168.245.12
server3: mysqld –ndb-cluster 192.168.245.13
ndbd: 数据库节点。
mysqld –ndb-cluster: mysql服务器节点,程序直接访问的是这台机器的ip。默认端口仍是3306。
ndbd_mgm ndbd_mgmd:管理节点。管理/查看各库节点和服务器节点的状态。
二、集群方案
1.管理节点:server3(192.168.245.13)
2.存储节点:server1(192.168.245.11),server2(192.168.245.12)
3.sql节点:server1(192.168.245.11),server2(192.168.245.12),server3(192.168.245.13)
三、mysql安装和配置
1.安装,sudo apt-get install mysql-server
2.配置这三台服务器上配置my.cnf,这三台服务器都要配置
vim /etc/mysql/my.cnf    —————————————–my.cnf开始——————————————–    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 = 16m   #    # * logging and replication    #    # both location gets rotated by the cronjob.    # be aware that 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 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 = 100m   #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 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 from this file!    # the files must end with ‘.cnf’, otherwise they’ll be ignored.    #  !includedir /etc/mysql/conf.d/     ubuntu@ubuntu:~$    ———————————my.cnf结束———————————————————  
其它类似信息

推荐信息