0034-CM啓動報InnoDB engine not found分析

溫馨提示:要看高清無碼套圖,請使用手機打開並單擊圖片放大查看。

1.問題描述

cloudera-scm-server服務啓動失敗,日誌報錯如下:

2017-09-10 10:23:47,267 ERROR main:com.cloudera.enterprise.dbutil.DbUtil: InnoDB engine not found. Show engines reported: [MRG_MYISAM, CSV, MyISAM, MEMORY]
2017-09-10 10:23:47,268 ERROR main:com.cloudera.server.cmf.bootstrap.EntityManagerFactoryBean: InnoDb engine isn't present or enabled. SCM requires InnoDb MySQL db engine.

0034-CM啓動報InnoDB engine not found分析

2.問題復現

測試環爲CDH5.12.1,以下爲復現步驟。

  1. 將/tmp目錄修改爲755權限
[root@ip-172-31-6-148 /]# chmod 755 tmp/
[root@ip-172-31-6-148 /]# ll
total 116
drwxr-xr-x. 231 root root 20480 Sep 10 15:48 tmp
[root@ip-172-31-6-148 /]# 

0034-CM啓動報InnoDB engine not found分析

2.重啓mysql服務

[root@ip-172-31-6-148 /]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
[root@ip-172-31-6-148 /]# 

0034-CM啓動報InnoDB engine not found分析

3.啓動cloudera-scm-server服務

[root@ip-172-31-6-148 /]# service cloudera-scm-server restart
Stopping cloudera-scm-server:                               [  OK  ]
Starting cloudera-scm-server:                               [  OK  ]
[root@ip-172-31-6-148 /]#

4.查看啓動日誌報錯如問題描述一致

0034-CM啓動報InnoDB engine not found分析

3.解決方法

將/tmp目錄權限修改爲777,重啓mysql和cloudera-scm-server服務

  1. 修改/tmp目錄權限爲777
[root@ip-172-31-6-148 /]# chmod 777 tmp/
[root@ip-172-31-6-148 /]# ll
total 116
drwxrwxrwx. 231 root root 20480 Sep 10 15:48 tmp
[root@ip-172-31-6-148 /]# 

0034-CM啓動報InnoDB engine not found分析

2.重啓msyql服務

[root@ip-172-31-6-148 /]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
[root@ip-172-31-6-148 /]# 

0034-CM啓動報InnoDB engine not found分析

3.重啓cloudera-scm-server服務

[root@ip-172-31-6-148 /]# service cloudera-scm-server restart
Stopping cloudera-scm-server:                               [  OK  ]
Starting cloudera-scm-server:                               [  OK  ]
[root@ip-172-31-6-148 /]#

CM正常啓動,問題解決。

4.備註

  • 出現InnoDBengines not found

登錄mysql通過show engines命令查看mysql引擎

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)

mysql> 

0034-CM啓動報InnoDB engine not found分析

注意:如果沒有顯示InnoDB Engine可能是/tmp目錄權限不足導致,也可能是源碼編譯的時候未編譯InnoDB引擎;

  • 可以通過showplugins命令查看mysql支持的插件
mysql> show plugins;
+------------+--------+----------------+---------+---------+
| Name       | Status | Type           | Library | License |
+------------+--------+----------------+---------+---------+
| binlog     | ACTIVE | STORAGE ENGINE | NULL    | GPL     |
| partition  | ACTIVE | STORAGE ENGINE | NULL    | GPL     |
| CSV        | ACTIVE | STORAGE ENGINE | NULL    | GPL     |
| MEMORY     | ACTIVE | STORAGE ENGINE | NULL    | GPL     |
| InnoDB     | ACTIVE | STORAGE ENGINE | NULL    | GPL     |
| MyISAM     | ACTIVE | STORAGE ENGINE | NULL    | GPL     |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL    | GPL     |
+------------+--------+----------------+---------+---------+
7 rows in set (0.00 sec)
mysql> 

0034-CM啓動報InnoDB engine not found分析

如果沒有InnoDB則可以通過INSTALL命令安裝

  • 使用INSTALL命令安裝InnoDB

查看mysql插件安裝目錄

mysql> show variables like 'plugin_dir'; 
+---------------+-------------------------+
| Variable_name | Value                   |
+---------------+-------------------------+
| plugin_dir    | /usr/lib64/mysql/plugin |
+---------------+-------------------------+
1 row in set (0.00 sec)

0034-CM啓動報InnoDB engine not found分析

查看linux目錄下是否有ha_innodb*.so的文件

[root@ip-172-31-6-148 ~]# cd /usr/lib64/mysql/plugin 
[root@ip-172-31-6-148 plugin]# ll
total 1416
lrwxrwxrwx 1 root root      25 Sep 10 15:47 ha_innodb_plugin.so -> ha_innodb_plugin.so.0.0.0
lrwxrwxrwx 1 root root      25 Sep 10 15:47 ha_innodb_plugin.so.0 -> ha_innodb_plugin.so.0.0.0
-rwxr-xr-x 1 root root 1259136 Jan 26  2017 ha_innodb_plugin.so.0.0.0
[root@ip-172-31-6-148 plugin]# 

0034-CM啓動報InnoDB engine not found分析

執行Install命令安裝InnoDB引擎

mysql> INSTALL PLUGIN InnoDB SONAME 'ha_innodb_plugin.so';
Query OK, 0 rows affected (0.23 sec)

mysql>

0034-CM啓動報InnoDB engine not found分析

如果沒有ha_innodb_plugin.so文件則需要考慮重新編譯InnoDB引擎。


醉酒鞭名馬,少年多浮誇! 嶺南浣溪沙,嘔吐酒肆下!摯友不肯放,數據玩的花!

溫馨提示:要看高清無碼套圖,請使用手機打開並單擊圖片放大查看。

推薦關注Hadoop實操,第一時間,分享更多Hadoop乾貨,歡迎轉發和分享。

0034-CM啓動報InnoDB engine not found分析
原創文章,歡迎轉載,轉載請註明:轉載自微信公衆號Hadoop實操

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章