本篇文章给大家分享的是有关ubuntu9.0中怎么配置MySQL集群,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

  测试环境:

  Server1: ndbd 192.168.245.11

  Server2: ndbd 192.168.245.12

  Server3: mysqld –ndb-cluster 192.168.245.13

  ndbd: 节点。

  d –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

#

#TheMySQLdatabaseserverconfigurationfile.

#

#Youcancopythistooneof:

#-“/etc/mysql/my.cnf”tosetglobaloptions,

#-“~/.my.cnf”tosetuser-specificoptions.

#

#Onecanusealllongoptionsthattheprogramsupports.

#Runprogramwith–helptogetalistofavailableoptionsandwith

#–print-defaultstoseewhichitwouldactuallyunderstandanduse.

#

#Forexplanationssee#http://dev.mysql.com/doc/mysql/en/serve...ables.html

#Thiswillbepassedtoallmysqlclients

#Ithasbeenreportedthatpasswordsshouldbeenclosedwithticks/quotes

#escpeciallyiftheycontain“#”chars…

#Remembertoedit/etc/mysql/debian.cnfwhenchangingthesocketlocation.[client]port=3306socket=/var/run/mysqld/mysqld.sock

#Hereisentriesforsomespecificprograms

#Thefollowingvaluesassumeyouhaveatleast32Mram

#Thiswasformallyknownas[safe_mysqld].Bothversionsarecurrentlyparsed.[mysqld_safe]socket=/var/run/mysqld/mysqld.socknice=0[mysqld]

#

#*BasicSettings

#

#

#*IMPORTANT

#Ifyoumakechangestothesesettingsandyoursystemusesapparmor,youmay

#alsoneedtoalsoadjust/etc/apparmor.d/usr.sbin.mysqld.

#user=mysqlpid-file=/var/run/mysqld/mysqld.pidsocket=/var/run/mysqld/mysqld.sockport=3306basedir=/usrdatadir=/var/lib/mysqltmpdir=/tmplanguage=/usr/share/mysql/englishskip-external-locking

#

#Insteadofskip-networkingthedefaultisnowtolistenonlyon

#localhostwhichismorecompatibleandisnotlesssecure.

#bind-address=127.0.0.1

#

#*FineTuning

#key_buffer=16Mmax_allowed_packet=16Mthread_stack=128Kthread_cache_size=8

#max_connections=100#table_cache=64#thread_concurrency=10

#

#*QueryCacheConfiguration

#query_cache_limit=1Mquery_cache_size=<span class="attribute-value"

以上就是ubuntu9.0中怎么配置MySQL集群,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。