MySQL群集雙機類比

來源:互聯網
上載者:User

硬體設定

普通PC server * 2 (最小叢集環境需要4台伺服器)

類比環境

red hat linux9 for x86 (or red hat AS 2以上版本),glibc-2.2, static, gcc

MySQL版本4.1.12 binares

mysql-max binary版本目前只支援linux、max os x和solaris

本方案不涉及從原始碼編譯安裝

主機 IP地址 用途

ndb1_mgmd_sqld 1192.168.1.100 Ndb node1+mgmd node1+sqld node1

ndb2_sqld2 192.168.1.200 Ndb node2+sqld node2

Mgmd:management server

sqld:mysql server

ndb:storaged node (share-nothing,base in memory)

安裝

從http://dev.mysql.com/downloads/mysql/4.1.html下載mysql-max-4.1.12-pc-linux-gnu-i686.tar.gz到/var/tmp

Storage and SQL Node Installation

在兩台主機上執行如下過程

shell>groupadd mysql

shell>useradd -g mysql mysql

shell>tar zxfv mysql-max-4.1.12-pc-linux-gnu-i686.tar.gz

shell>cp -vr mysql-max-4.1.12-pc-linux-gnu-i686 /usr/local/mysql-max-4.1.12-pc-linux-gnu-i686

shell>cd /usr/local

shell>ln -s mysql-max-4.1.12-pc-linux-gnu-i686 mysql

shell>cd mysql;scripts/mysql_install_db –user=mysql

shell>chown -R root .;chown -R mysql data;chgrp -R mysql .

shell>cp support-files/mysql.server /etc/rc.d/init.d/

shell>chmod +x /etc/rc.d/init.d/mysql.server

shell>chkconfig --add mysql.server

shell>chkconfig –level 3 mysql.server off

Management Node Installation

在主機ndb1_mgmd_sqld1上執行如下過程

shell>cd /var/tmp

shell>tar -zxvf mysql-max-4.1.12a-pc-linux-gnu-i686.tar.gz /usr/local/bin '*/bin/ndb_mgm*'

Configuration

Configuring the Storage and SQL Nodes

在兩台主機上執行如下過程:

shell>vi /etc/my.cnf

[MYSQLD]             # Options for mysqld process:

ndbcluster           # run NDB engine

ndb-connectstring=192.168.1.100  # location of MGM node

[MYSQL_CLUSTER]         # Options for ndbd process:

ndb-connectstring=192.168.1.100  # location of MGM node

Configuring the Management Node

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.