Mroongaバージョンアップで毎度MariaDBが上がらなくなるのでメモ

2020年5月8日Mroonga/GroongaMariaDB,Mecab,mroonga,起動しない

放置していたサーバーのupdateをしようとyum updateを叩くと、結構頻繁にMroongaがアップデートしていますね。

毎度の事ながらyum updateするとMariaDBが立ち上がらなくなるのでメモ
どうやらコンフィグでMecabを指定した状態でアップデートすると、Mroonga関連プラグインが正しくインストールされない模様

環境はCentOS7、Mroongaはepelから。
パーサ、トークナイザにMecabを使用。

MariaDBを起動しようとするとこんなメッセージが。

mysqld[6129]: 2019-02-14 11:21:40 0 [ERROR] /usr/sbin/mysqld: unknown variable 'mroonga_default_parser=TokenMecab'

MariaDBのコンフィグからMecabの指定をコメントアウト

#mroonga_default_parser = TokenMecab
#mroonga_default_tokenizer = TokenMecab

MariaDBを再起動

[root@localhost ~]# systemctl restart mariadb

起動状態でMariaDBにログインし、mroongaバージョンやらを確認

MariaDB [(none)]> show variables like 'mroonga_%';
Empty set (0.001 sec)

MariaDB [(none)]> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| CSV | YES | Stores tables as CSV files | NO | NO | NO |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| MyISAM | YES | Non-transactional engine with good performance and small data footprint | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.000 sec)

Mroongaプラグインが入っていない状態である事を確認
Mroongaプラグインをインストール

[root@localhost ~]# mysql -uroot -p < /usr/share/mroonga/install.sql

再度MariaDBにログインして確認

MariaDB [(none)]> show variables like 'mroonga_%';
+----------------------------------------+----------------------+
| Variable_name | Value |
+----------------------------------------+----------------------+
| mroonga_action_on_fulltext_query_error | ERROR_AND_LOG |
| mroonga_boolean_mode_syntax_flags | DEFAULT |
| mroonga_condition_push_down_type | ONE_FULL_TEXT_SEARCH |
| mroonga_database_path_prefix | |
| mroonga_default_parser | TokenBigram |
| mroonga_default_tokenizer | TokenBigram |
| mroonga_default_wrapper_engine | |
| mroonga_dry_write | OFF |
| mroonga_enable_operations_recording | ON |
| mroonga_enable_optimization | ON |
| mroonga_libgroonga_embedded | OFF |
| mroonga_libgroonga_support_lz4 | ON |
| mroonga_libgroonga_support_zlib | ON |
| mroonga_libgroonga_support_zstd | ON |
| mroonga_libgroonga_version | 9.0.0 |
| mroonga_lock_timeout | 900000 |
| mroonga_log_file | groonga.log |
| mroonga_log_level | NOTICE |
| mroonga_match_escalation_threshold | 0 |
| mroonga_max_n_records_for_estimate | 1000 |
| mroonga_query_log_file | |
| mroonga_vector_column_delimiter | |
| mroonga_version | 9.00 |
+----------------------------------------+----------------------+
23 rows in set (0.001 sec)

MariaDB [(none)]> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| CSV | YES | Stores tables as CSV files | NO | NO | NO |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| MyISAM | YES | Non-transactional engine with good performance and small data footprint | NO | NO | NO |
| Mroonga | YES | CJK-ready fulltext search, column store | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.000 sec)

めでたしめでたし。
念のためサーバーごと再起動をかけて自動起動の状態も確認しておく