OSSなDWH InfiniDB の話 ① ~インストール
OSSのDWHで、infinidbというものがあり、競合OSSのInfoBright、LucidDB、MonetDBよりも、高いパフォーマンスを出しているとのことで、あ、パフォーマンスにつきましては、以下のURLをごらんください。
http://www.mysqlperformanceblog.com/2010/01/07/star-schema-bechmark-infobright-infinidb-and-luciddb/
前々から、ずっと気にしていたのでちょっと入れてみようかな?と思い、導入にいたったわけです。 前回ブログにアップした、infobrightと同じ系列の列指向のデータベースです。 Infobrightのコミュニティ版とInfiniDBのコミュニティ版(InfiniDB Community Edition)の差はなんといっても、こちら、InfiniDBエンジンで作成したテーブルに対してINSERT,UPDATE,DELETEが行えるのです!!(Infobrightのコミュニティ版は、INSERT,UPDATE,DELETEは行えず、LOADのみサポートしている) 実際、DWHなんだからいらないでしょ?という考えもあるのですが、やはり、このあたりを、コミュニティ版でも対応してくれる、してくれないの差は大きいですね。
inifiniDBの特徴について抜粋します。(http://journal.mycom.co.jp/news/2010/02/03/052/index.html)
" 大規模データボリュームにおける高速なデータ読み込み機能 " マルチスレッドアーキテクチャをベースとしマルチコアCPUの高い性能 " インデックス化なしで従来のMySQLよりも高速な操作 (INSERT、UPDATEなど) " トランザクションへの対応 " 無償で利用できるコミュニティエディションに加え、エンタープライズ向けの有償版では複数のサーバを並列して動作させることが可能になる。 infinidbは、とにかくパフォーマンス重視の形態なので、infobrightと比べると、データの圧縮率は悪いです。(むしろ、MyISAMと比べるとデータ容量は大きくなる?)
▼今回、掲載した、InfiniDBのバージョンは2.0.0-2で最近リリースしたものです。
▼OSは、CENTOS5.5 の64BIT版で検証しております。 ▼検証環境の、ディスクおよび、メモリは以下のとおりです。
Filesystem サイズ 使用 残り 使用% マウント位置 /dev/mapper/VolGroup00-LogVol00 28G 2.6G 24G 10% / /dev/sda1 99M 19M 75M 21% /boot tmpfs 502M 13M 490M 3% /dev/shm
free -m
total used free shared buffers cached Mem: 1002 957 45 0 67 629 -/+ buffers/cache: 261 741 Swap: 2015 0 2015
インストール手順 1.InfiniDBのダウンロード 以下のURLから、InfiniDBをダウンロードします。(ユーザー登録が必要です) http://www.infinidb.org/downloads 2.上記にてログインいたしますと、バイナリリリースというメニューがありますので、そこから最新版をダウンロードします
3.インストール対象のサーバに、ダウンロードしたファイルを保存し、解凍します [root@dwh1]# tar zxvf calpont-infinidb-2.0.0-2.x86_64.rpm.tar.gz calpont-2.0.0-2.x86_64.rpm calpont-mysql-2.0.0-2.x86_64.rpm calpont-mysqld-2.0.0-2.x86_64.rpm 4.解凍されたファイルをrpmでインストールします [root@dwh1]# rpm -ivh calpont-*.rpm 準備中… ########################################### [100%] 1:calpont-mysqld ########################################### [ 33%] Calpont RPM install completed 2:calpont ########################################### [ 67%] Calpont RPM install completed 3:calpont-mysql ########################################### [100%] Calpont RPM install completed 5.my.cnfの編集をします。ここでは、日本語対応をするための編集です。赤字の部分を編集してください [root@dwh1]# cd /usr/local/Calpont/mysql/
vi my.cnf
以下の箇所を追記
[mysqld] sql_mode = 'IGNORE_SPACE' default-character-set=utf8 skip-character-set-client-handshake 6.初期設定を行うためのスクリプトを実行します 初期設定スクリプトを起動 [root@dwh1]# /usr/local/Calpont/bin/install-infinidb.sh DEPENDENCY LIBRARY CHECK
All libraries found
DISK SPACE CHECK
Make sure there is enough local or mounted disk space for the InfiniDB System Catalog and the planned test Database. Minumum disk space is 1.7 GB for the InfiniDB system catalog.
Filesystem サイズ 使用 残り 使用% マウント位置 /dev/mapper/VolGroup00-LogVol0028G 2.5G 24G 10% /
No '/usr/local/Calpont/data1' mounted disk found
Check the JumpGuide Guide for information on how to setup a mounted disk
if you require additional disk space for the InfiniDB Database
MEMORY SPACE CHECK Check and set InfiniDB Configuration to optimal settings of approximately 25% of total memory.
Memory Total in megabytes is 1002
A minumum of 2GB of memory is recommend, which this machine doesn't seem to have.
We recommend using a machine with more memory. If you know you have more memory than shown, see the InfiniDB Tuning Guide for instructions on how to configure InfiniDB's use of system memory.
Setting Configuration memory setting to 256M
SETUP INFINIDB MYSQL
Starting MySQL. [ OK ] Shutting down MySQL [ OK ] Starting MySQL. [ OK ] Shutting down MySQL [ OK ] Starting MySQL. [ OK ] Shutting down MySQL. [ OK ]
InfiniDB is setup for autostart using 'chkconfig'
InfiniDB Installation Completed
7.エイリアスを作成します [root@dwh1]# . /usr/local/Calpont/bin/calpontAlias ※上記ファイルの中身はこのような感じになっております。 view /usr/local/Calpont/bin/calpontAlias
! /bin/bash
#
$Id: calpontAlias.os 1736 2009-11-23 15:47:30Z rdempsey $
# alias idbmysql='/usr/local/Calpont/mysql/bin/mysql defaults-file=/usr/local/Calpont/mysql/my.cnf -u root' 8.サービスを開始します [root@dwh1]# service infinidb start Starting Calpont InfiniDB Database Plaform: …… DONE creating system catalog (be patient): . done. Starting Calpont InfiniDB Mysqld: Starting MySQL. [ OK ] Perform Functionality test: InfiniDB Logging check: DONE Platform Process check: DONE MySQL Daemon check: MySQL running (6854) [ OK ] Database check: DONE 9.サービスを登録し、自動起動の設定をします サービス登録&自動起動オン [root@dwh1]# /sbin/chkconfig add infinidb [root@dwh1]# /sbin/chkconfig infinidb on 10.infiniDBのクライアントを起動します。 [root@dwh1]# idbmysql
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.39 MySQL Community / InfiniDB Community Edition 2.0-1 Final (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
ここまでいけば、セットアップは無事完了です。データベースの作成およびユーザーの作成等に関しては、MySQLと同様なので割愛します。
インストール後の状態確認 mysql> show databases; + + | Database | + + | information_schema | | calpontsys | | mysql | | test | + + 4 rows in set (0.00 sec)
mysql> status;
/usr/local/Calpont/mysql/bin/mysql Ver 14.14 Distrib 5.1.39, for unknown-linux-gnu (x86_64) using EditLine wrapper
Connection id: 2 SSL: Not in use Current pager: stdout Using outfile: ” Using delimiter: ; Server version: 5.1.39 MySQL Community / InfiniDB Community Edition 2.0-1 Final (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Client characterset: utf8 Server characterset: utf8 UNIX socket: /usr/local/Calpont/mysql/lib/mysql/mysql.sock Uptime: 3 min 16 sec
Threads: 1 Questions: 8 Slow queries: 0 Opens: 20 Flush tables: 1 Open tables: 9 Queries per second avg: 0.40
mysql> show engines; + + + + + + + | Engine | Support | Comment | Transactions | XA | Savepoints | + + + + + + + | CSV | YES | CSV storage engine | NO | NO | NO | | InfiniDB | YES | Calpont InfiniDB storage engine | YES | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | + + + + + + + 5 rows in set (0.00 sec)
細かい設定については、次回掲載します。
ちなみにですが、アンインストールにつきましては、以下の手順で行います。 service infinidb stop or /usr/local/Calpont/bin/infinidb stop chkconfig del infinidb rm -rf /usr/local/Calpont