LoginSignup
10
11

More than 5 years have passed since last update.

centos6.5にmroonga標準パッケージのSCL mysql5.5を突っ込んだ話

Posted at

概要

mroongaがメジャーバージョンアップしたため、centos6の標準パッケージにあるmysql5.1が非推奨となりました。
そこで、mroonga推奨SCL mysql5.5に対応したときの四苦八苦したことをメモします。

mroongaインストール

インストール手順はmroonga公式とほぼ同じですが、ちょっと違います。

注意点

SCLでインストールしたソフトウェアは /opt/rh に入ります。
なので、SCLのmysqlは /opt/rh/mysql55/ となり、 my.cnf/opt/rh/mysql55/root/etc/my.cnf にあります。
また、これらのソフトウェアはyumでインストールしてもPATHが通っていないので、自分で設定する必要があります。
詳しくはIDC Frontier Engineers' Blog

インストール手順

詳細はコメントを見てください。

% yum install centos-release-SCL
% rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
% yum makecache
# 変更:>>>
# mysql mysql55-mysql-server -> mysql55 mysql55-* 
% yum install -y mysql55 mysql55-*
# 変更:<<<

# 変更:>>>
# my.cnf[/opt/rh/mysql55/root/etc/my.cnf]のディレクトリ設定を/mysqlに変更
% cat /opt/rh/mysql55/root/etc/my.cnf
[mysqld]
user=mysql
#datadir=/opt/rh/mysql55/root/var/lib/mysql
datadir=/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under different user or group, 
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mysql55-mysqld.log
pid-file=/mysql/mysqld.pid

# /mysqlにselinuxラベル「mysql_db_t」を追加
% ls -lZ / | grep mysql
drwxr-xr-x. mysql mysql system_u:object_r:s0 mysql

% semanage fcontext -a -t mysqld_db_t "/mysql(/.*)?"
% restorecon -R -v /mysql

% ls -lZ / | grep mysql
drwxr-xr-x. mysql mysql system_u:object_r:mysqld_db_t:s0 mysql
# 変更:<<<

% /etc/init.d/mysql55-mysqld start
% yum install -y mysql55-mroonga
(% sudo scl enable mysql55 mysqladmin -u root password 'new-password')
10
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11