資源描述:
《linux下mysql集群的安裝》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、linux下mysql集群的安裝2011-05-1318:30?1397人閱讀?評(píng)論(1)?收藏?舉報(bào)mysqllinuxshell集群數(shù)據(jù)庫(kù)database目錄(?)[+]1.下載安裝文件操作系統(tǒng):CentOSrelease5.5Mysql:???mysql-cluster-gpl-7.1.10-linux-i686-glibc23.tar.gz2.安裝.tar.gz文件詳情參考mysql的官方手冊(cè)。?數(shù)據(jù)節(jié)點(diǎn)和mysql節(jié)點(diǎn)的安裝1.檢查系統(tǒng)中是否已經(jīng)存在mysql用戶和組。查看/etc/passwd和/etc/group文件,檢查系統(tǒng)是否已存在mysql用戶
2、和組。如果不存在,用以下命令添加:shell>groupaddmysqlshell>useradd–gmysqlmysql?2.解壓安裝。??????2.1進(jìn)入安裝文件所在目錄,假設(shè)在/var/tmp目錄下:??????shell>cd/var/tmp??????shell>tar–C/usr/local–xzvf?mysql-cluster-gpl-7.1.10-linux-i686-glibc23.tar.gz??????shell>ln–s/usr/local/mysql-cluster-gpl-7.1.10-linux-i686-glibc23?/usr/
3、local/mysql???????2.2執(zhí)行安裝腳本:??????shell>cdmysql??????shell>scripts/mysql_install_db–user=mysql???????2.3修改權(quán)限:shell>chown–Rroot?.shell>chown–Rmysqldatashell>chgrp–Rmysql.?2.4復(fù)制執(zhí)行文件,加入系統(tǒng)啟動(dòng)項(xiàng):shell>cpsupport-files/mysql.server/etc/rc.d/init.d/shell>chmod+x/etc/rc.d/init.d/mysql.servershel
4、l>chkconfig–addmysql.server??管理節(jié)點(diǎn)的安裝1.解壓安裝shell>cd/var/tmp??????shell>tar–xzvf?mysql-cluster-gpl-7.1.10-linux-i686-glibc23.tar.gz??????shell>cdmysql-cluster-gpl-7.1.10-linux-i686-glibc23??????shell>cpbin/ndb_mgm*/usr/local/bin?2.修改權(quán)限??????shell>cd/usr/local/bin??????shell>chmod+xndb_m
5、gm*?3.配置文件3.1創(chuàng)建數(shù)據(jù)節(jié)點(diǎn)和mysql節(jié)點(diǎn)的my.cnf配置文件shell>vi/etc/my.cnf?my.cnf內(nèi)容如下:[mysqld]#Optionsformysqldprocess:ndbcluster????????????????????????#runNDBstorageenginendb-connectstring=192.168.0.10?#locationofmanagementserver[mysql_cluster]#Optionsforndbdprocess:ndb-connectstring=192.168.0.10?#l
6、ocationofmanagementserver?3.2創(chuàng)建管理節(jié)點(diǎn)的config.ini配置文件shell>mkdir/var/lib/mysql-clustershell>cd/var/lib/mysql-clustershell>viconfig.ini?config.ini內(nèi)容如下:[ndbddefault]#Optionsaffectingndbdprocessesonalldatanodes:NoOfReplicas=2???#NumberofreplicasDataMemory=80M???#Howmuchmemorytoallocateforda
7、tastorageIndexMemory=18M??#Howmuchmemorytoallocateforindexstorage?????????????????#ForDataMemoryandIndexMemory,wehaveusedthe?????????????????#defaultvalues.Sincethe"world"databasetakesup?????????????????#onlyabout500KB,thisshouldbemorethanenoughfor?????????????????#thisexampleClusters
8、etup.