|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近由权威调查机构Evans数据公司进行的一项调查显示,MySQL在过去两年已经获得了25%的市场份额。该调查公司还预测,相比其他的开源数据库和闭源数据库。 家在网上都能找到都是RedHat体系等等,对Ubuntu体系MySQL集群就没有先容文章,我如今写写Ubuntu这个MySQL集群办法。老手不要骂我,呵呵。
先容收集情况:
测试情况:
Server1:ndbd192.168.245.11
Server2:ndbd192.168.245.12
Server3:mysqld–ndb-cluster192.168.245.13
ndbd:数据库节点。
mysqld–ndb-cluster:MySQL服务器节点,程序间接会见的是这台呆板的IP。默许端口还是3306。
ndbd_mgmndbd_mgmd:办理节点。办理/检察各库节点和服务器节点的形态。
2、集群计划
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)
3、mysql安装和设置
1.安装,sudoapt-getinstallmysql-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=16M##*LoggingandReplication##Bothlocationgetsrotatedbythecronjob.#Beawarethatthislogtypeisaperformancekiller.#log=/var/log/mysql/mysql.log##Errorlogginggoestosyslog.ThisisaDebianimprovement##Hereyoucanseequerieswithespeciallylongduration#log_slow_queries=/var/log/mysql/mysql-slow.log#long_query_time=2#log-queries-not-using-indexes##Thefollowingcanbeusedaseasytoreplaybackuplogsorforreplication.#note:ifyouaresettingupareplicationslave,seeREADME.Debianabout#othersettingsyoumayneedtochange.#server-id=1#log_bin=/var/log/mysql/mysql-bin.logexpire_logs_days=10max_binlog_size=100M#binlog_do_db=include_database_name#binlog_ignore_db=include_database_name##*BerkeleyDB##UsingBerkeleyDBisnowdiscouragedasitssupportwillceasein5.1.12.skip-bdb##*MyISAM##MyISAMisenabledbydefaultwitha10MBdatafilein/var/lib/mysql/.#ReadthemanualformoreMyISAMrelatedoptions.Therearemany!#YoumightwanttodisableMyISAMtoshrinkthemysqldprocessbycirca100MB.#skip-innodb##*SecurityFeatures##Readthemanual,too,ifyouwantchroot!#chroot=/var/lib/mysql/##ForgeneratingSSLcertificatesIrecommendtheOpenSSLGUI“tinyca”.##ssl-ca=/etc/mysql/cacert.pem#ssl-cert=/etc/mysql/server-cert.pem#ssl-key=/etc/mysql/server-key.pemndbclusterndb-connectstring=192.168.245.13[mysqldump]quickquote-namesmax_allowed_packet=16M[mysql]#no-auto-rehash#fasterstartofmysqlbutnotabcompletition[isamchk]key_buffer=16M##*NDBCluster##See/usr/share/doc/mysql-server-*/README.Debianformoreinformation.##ThefollowingconfigurationisreadbytheNDBDataNodes(ndbdprocesses)#notfromtheNDBManagementNodes(ndb_mgmdprocesses).#[MYSQL_CLUSTER]ndb-connectstring=192.168.245.13##*IMPORTANT:Additionalsettingsthatcanoverridethosefromthisfile!#Thefilesmustendwith‘.cnf’,otherwisethey’llbeignored.#!includedir/etc/mysql/conf.d/Ubuntu@ubuntu:~$———————————my.cnf停止———————————————————
复制代码 <p><Pstyle="TEXT-INDENT:2em">
首先我们要知道,或许有一项技术存在很多理由让我们可以选择使用MySQL学习教程,但是让我们不使用它往往只要有一个理由就足够了。 |
|