lxyuma BLOG

開発関係のメモ

awsのec2にmroongaをインストール

mroongaって?


groongaベースのmysqlのストレージエンジン
MyIsamとかInnnoDBとかと同列)


groongaは全文検索エンジンらしい。

俺は使った事ない。


ちなみに、solrは立てた事ある。

結局、solrと比べて、どこが美味しいのかが一番気になる。

どっちがいいのだろうか。。。


  • 参考資料

mroongaインストール手順(cent5)
http://mroonga.github.com/ja/docs/install.html#centos-5
簡単な説明
http://lab.bizreach.co.jp/2012/06/mysqlgroonga-2272.html

sudo yum remove 'mysql*'
sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-0.noarch.rpm


この後、

sudo yum makecache

Loaded plugins: priorities, security, update-motd, upgrade-helper
10gen | 951 B 00:00
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
http://packages.groonga.org/centos/latest/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: groonga. Please verify its path and try again


とか言われる。

なんやねん。と思ったら、こんな記事が。


http://zonotex.blogspot.jp/2012/08/awsec2mroonga.html


ありがとう。

sudo vim /etc/yum.repos.d/groonga.repo


[groonga]
name= for CentOS $releasever - $basearch
baseurl=http://packages.groonga.org/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-groonga

このbaseurlを書き換える

baseurl=http://packages.groonga.org/centos/6/$basearch/

sudo yum makecache

Loaded plugins: priorities, security, update-motd, upgrade-helper
10gen | 951 B 00:00
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
groonga | 951 B 00:00
groonga/filelists | 113 kB 00:00
groonga/other | 28 kB 00:00
groonga 211/211
groonga 211/211
Metadata Cache Created

よし!

yum -y install mysql51.x86_64 mysql51-common.x86_64 mysql51-libs.x86_64 mysql51-server.x86_64

※普通にmysql入れたら駄目だったので、注意。(後のrequireでひっかかる)

sudo service mysqld start

sudo yum install mysql-mroonga

    • > Finished Dependency Resolution

Error: Package: mysql-mroonga-2.09-0.el6.x86_64 (groonga)
Requires: mysql-server = 5.1.66-1.el6_3
Installed: mysql51-server-5.1.66-1.56.amzn1.x86_64 (@amzn-updates)
mysql-server = 5.1.66-1.56.amzn1
Available: mysql-server-5.5-1.3.amzn1.noarch (amzn-main)
mysql-server = 5.5-1.3.amzn1
Available: mysql51-server-5.1.61-4.54.amzn1.x86_64 (amzn-main)
mysql-server = 5.1.61-4.54.amzn1
Available: mysql55-server-5.5.24-1.24.amzn1.x86_64 (amzn-main)
mysql-server = 5.5.24-1.24.amzn1
Available: mysql55-server-5.5.28-1.25.amzn1.x86_64 (amzn-updates)
mysql-server = 5.5.28-1.25.amzn1
Error: Package: mysql-mroonga-2.09-0.el6.x86_64 (groonga)
Requires: mysql = 5.1.66-1.el6_3
Installed: mysql51-5.1.66-1.56.amzn1.x86_64 (@amzn-updates)
mysql = 5.1.66-1.56.amzn1
Available: mysql-5.5-1.3.amzn1.noarch (amzn-main)
mysql = 5.5-1.3.amzn1
Available: mysql51-5.1.61-4.54.amzn1.x86_64 (amzn-main)
mysql = 5.1.61-4.54.amzn1
Available: mysql55-5.5.24-1.24.amzn1.x86_64 (amzn-main)
mysql = 5.5.24-1.24.amzn1
Available: mysql55-5.5.28-1.25.amzn1.x86_64 (amzn-updates)
mysql = 5.5.28-1.25.amzn1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

はぁぁぁ(´⊙д⊙屮)屮

versionがちょい違うらしい。

sudo yum install mysql-mroonga --skip-broken


..........略
Packages skipped because of dependency problems:
groonga-libs-2.0.9-0.el6.x86_64 from groonga
mysql-mroonga-2.09-0.el6.x86_64 from groonga

ま、いっか。

mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.66 Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show engines;

                                                                                                                                                                                                                                              • +
Engine Support Comment Transactions XA Savepoints
                                                                                                                                                                                                                                              • +
MRG_MYISAM YES Collection of identical MyISAM tables NO NO NO
CSV YES CSV storage engine NO NO NO
MyISAM DEFAULT Default engine as of MySQL 3.23 with great performance NO NO NO
InnoDB YES Supports transactions, row-level locking, and foreign keys YES YES YES
MEMORY YES Hash based, stored in memory, useful for temporary tables NO NO NO
                                                                                                                                                                                                                                              • +

5 rows in set (0.00 sec)

mroongaが無い!

ふおおおおおおヽ( ╹□╹ )ノ


。。。。続く。