Kouhei Sutou
kou****@clear*****
2012年 8月 2日 (木) 22:09:00 JST
須藤です。 In <CAAy_OuBD9eUkN_DRC0-ELXxY-_cPWVXG1Do=BLqtB****@mail*****> "[groonga-dev,00992] mroongaのINSTALL PLUGIN実行時のエラーについて" on Thu, 2 Aug 2012 11:45:59 +0900, 山口裕太郎 <trape****@gmail*****> wrote: > ■環境は以下の通りです > $ cat /etc/redhat-release > CentOS release 6.3 (Final) > > > $ yum list installed | grep "mysql" > mysql.x86_64 5.5.25a-9.el6.art > mysql-devel.x86_64 5.5.25a-9.el6.art > mysql-libs.x86_64 5.5.25a-9.el6.art > mysql-mroonga.x86_64 2.05-0.el6 @groonga > mysql-server.x86_64 5.5.25a-9.el6.art > mysqlclient16.x86_64 5.1.59-2.el6.art Atomicorp Free RPMS Repository http://www.atomicorp.com/ を使っているんですね。 > ■INSTALL PLUGIN時のエラー > ERROR 1126 (HY000): Can't open shared library > '/usr/lib64/mysql/plugin/ha_mroonga.so' > (errno: 2 /usr/lib64/mysql/plugin/ha_mroonga.so: undefined symbol: > _ZN7handler26get_dynamic_partition_infoEP14PARTITION_INFOj) packages.groonga.orgで配布しているCentOS 6用のmroongaは CentOS 6標準のyumリポジトリに入っているMySQL 5.1用にビルドさ れているので5.5.25aでは動かすことができないのです。 > 外部リポジトリのMySQLを利用していることが原因らしいのですが、 > MySQLにすでにデータが格納されており再インストールをすることが難しい状況です。 > > > MySQLを再インストールせずにmroongaを > 使用する方法がございましたらご教授いただけると幸いです。 自分でAtomicorp Free RPMS Repository用のmroongaのRPMをビルド する方法と、今回、私が試しに作ったRPMをインストール方法を紹介 します。 私が作ったRPMをインストールする方が簡単ですが、今回用に作った だけなので、新しいバージョンのmroonga用のRPMが提供されないと いうデメリットがあります。一方、自分でビルドする方法は mroongaがバージョンアップしても自分でRPMを作れるのでRPMでバー ジョンアップできます。ただし、自分でRPMを作るのが少し面倒です。 それでは、簡単な方法から紹介します。 1) 私がビルドしたRPMをインストールする方法 % sudo rpm -Uvh http://packages.groonga.org/tmp/mysql-mroonga-2.05-0.el6.x86_64.rpm 2) 自分でRPMをビルドする方法 前提: * ビルド用に一般ユーザーを作ってあるとします。 * Atomicorp Free RPMS Repositoryが登録されているとします。 % wget -q -O - http://www.atomicorp.com/installers/atomic | sudo sh * packages.groonga.orgのyumリポジトリが登録されているとします。 % sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-0.noarch.rpm 注意: * コマンド中でsrc.rpmをダウンロードしている部分はバージョン があがったら↓のようなURLになります。 (最後のパスの2.06-0のところがバージョン番号になる。) http://packages.groonga.org/centos/6/source/SRPMS/mysql-mroonga-2.06-0.el6.src.rpm それでは、実際のコマンドです。 % sudo yum install -y rpm-build rpmdevtools tar groonga-devel groonga-libs mysql-server mysql mysql-devel cmake libaio-devel bison gcc gcc-c++ make pkgconfig % rpmdev-setuptree % wget http://packages.groonga.org/tmp/mysql-mroonga-2.05-0.el6.src.rpm % rpm -ivh mysql-mroonga-2.05-0.el6.src.rpm % rpmbuild -ba --define 'use_system_mysql 1' --define 'mysql_version 5.5.25a' --define 'mysql_release 9' --define 'mysql_dist art' --define 'mysql_download_base_url http://www6.atomicorp.com/channels/source/mysql' --define 'mysql_spec_file mysql-art.spec' ~/rpmbuild/SPECS/mysql-mroonga.spec これが終わると~/rpmbuild/RPMS/x86_64/以下にRPMができあがるの で、それをインストールするとAtomicorp Free RPMS Repositoryの MySQLでmroongaが動きます。 -- 須藤 功平 <kou****@clear*****> 株式会社クリアコード <http://www.clear-code.com/> (03-6231-7270) プログラミングが好きなソフトウェア開発者を募集中: http://www.clear-code.com/recruitment/