MySQL Cluster インストール

MySQL


MySQL Clusterを試すべく、先日作ったDebian(etch)環境(d:id:rx7:20070415:p1)にMySQLをインストールしてみました。


MySQL Clusterとは・・・公式サイト(http://www-jp.mysql.com/products/database/cluster/)より引用すると、、、

MySQL Cluster により、以下のことが可能になります。

  • 優れた費用効果で 99.999% の可用性を実現:シングル ポイント障害のない、パラレルサーバーアーキテクチャを使用しています。
  • 優れたパフォーマンスと高いスループットの提供:企業アプリケーションの厳しい要件を満たすことができます。
  • 段階的にアプリケーションを拡張可能:ニーズに合わせて、わざわざ高価なハードウェアを買わなくても、アプリケーションを拡張していくことができます。

MySQL Cluster は柔軟な分散アーキテクチャを採用しているため、アプリケーションの目的を満たすために必要なレベルのパフォーマンス、信頼性、およびスケーラビリティを、完璧に調整、制御することができます。

その他詳しい特徴については、公式サイト(http://www-jp.mysql.com/products/database/cluster/)をご参照ください。
また、上記のページの他に、MySQL Clusterについては、以下のページによくまとまった情報があります。

MySQL 5.1期待のクラスタリング機能
http://itpro.nikkeibp.co.jp/article/COLUMN/20060715/243478/
MySQL Cluster
http://k.hirohama.biz/wiki/index.php/MySQL_Cluster
MySQL Clusterを試す - クラスタ化した分散アドレス帳をつくる
http://journal.mycom.co.jp/special/2004/mysql/index.html


まだ、はっきりと動作確認は出来ていないので、上手くいけば後日にまた続きを書きたいと思います。

インストールしたのは、MySQL 5.1(beta)の最新版5.1.18-beta(2007/05/21時点)。
以下、作業ログです。OSインストールしただけの環境ですので、色々とエラーが出ていますが、まぁ備忘録ってことで。


まずはダウンロード!適当にディレクトリ作ってDLします。

$ mkdir ~/install
$ cd ~/install
$ wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.18-beta.tar.gz/from/http://mirror.mysql-partners-jp.biz/

で、解凍。この辺まではお約束ですね。

$ tar zxvf mysql-5.1.18-beta.tar.gz
$ cd mysql-5.1.18-beta

さて、configureです。あまり資料がないので、configureの中身を眺めながら、オプションを指定。

$ ./configure --with-plugins=ndbcluster --with-ndb-test --with-ndb-docs --with-ndb-port --with-ndb-port-base --with-charset=utf8 --prefix=/usr/local/mysql5

早速、エラーが出ました。

checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

あぁ、gccがないと。すんません。

$ sudo apt-get update
$ sudo apt-get install gcc

というわけで、gccをインストールして、、、再度configure。

$ ./configure --with-plugins=ndbcluster --with-ndb-test --with-ndb-docs --with-ndb-port --with-ndb-port-base --with-charset=utf8 --prefix=/usr/local/mysql5

さて、またエラー。

checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

あぁ、そういえばMySQLってCとC++で出来てたんだっけ。

$ sudo apt-get install g++

つーわけでインストール。もう1回configure。

$ ./configure --with-plugins=ndbcluster --with-ndb-test --with-ndb-docs --with-ndb-port --with-ndb-port-base --with-charset=utf8 --prefix=/usr/local/mysql5

次は、と・・・ライブラリがないと。この辺はMySQLインストール時に出るエラーで定番ですね。

checking for termcap functions library... configure: error: No curses/termcap library found

つーわけで、aptでちょちょいとインストール。

$ sudo apt-get install libncurses5-dev

で、再度configure。何回目やろ。。。

$ ./configure --with-plugins=ndbcluster --with-ndb-test --with-ndb-docs --with-ndb-port --with-ndb-port-base --with-charset=utf8 --prefix=/usr/local/mysql5

おー!configureが通ってMakefileが出来た模様。

Thank you for choosing MySQL!

というわけで、make。

$ make

が、その後、なかなか出くわさないエラーに悩まされる。ndbのtestまわり・・・かな?

make[5]: *** [atrt-main.o] Error 1
make[5]: Leaving directory `/root/install/mysql-5.1.18-beta/storage/ndb/test/run-test'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/root/install/mysql-5.1.18-beta/storage/ndb/test'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/root/install/mysql-5.1.18-beta/storage/ndb'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/install/mysql-5.1.18-beta/storage'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/install/mysql-5.1.18-beta'
make: *** [all] Error 2

よくわからないので、--with-ndb-testオプションを抜いてみよう。・・・というか切り分けのため最小限のオプションでやろうと思い、「--with-plugins=ndbcluster」オプションだけに絞ってみる。

$ make clean
$ ./configure --with-plugins=ndbcluster --with-charset=utf8 --prefix=/usr/local/mysql5
$ make

おぉぉ!makeできました!最後にインストール!

$ sudo make install

と、いうわけでインストールは無事完了。
とりあえず、素のシングル構成のMySQLが稼動するところまで確認して、今日はここまでにしよう。


次は、MySQL Clusterの設定をする部分ですね。また改めて書こうと思います。


続きは・・・d:id:rx7:20070602:p3