您好,登錄后才能下訂單哦!
一、hive創建表失敗,報錯:
CREATE TABLE pokes (foo INT, bar STRING);
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
解決方法:
mysql> SET @@global.innodb_large_prefix = 1;
mysql> ALTER DATABASE hivedb character set latin1;
二、drop表報錯卡主,日志看不到信息,
解決方法:
方法一:最后找到問題是mysql5.6.30,換了一個mysql5.1數據庫版本,解決問題
方法二:針對mysql5.6.30的bug,需要手動初始化hive metastore,否則用戶在drop table時候會卡主。在dmp-gateway數據庫(配置文件中指定的mysql)
[root@DMP-GATEWAY ~]# cd /opt/amos/hive/bin/
[root@DMP-GATEWAY bin]# ./schematool -dbType mysql –initSchema
結果:
Starting metastore schema initialization to 1.2.0
Initialization script hive-schema-1.2.0.mysql.sql
Initialization script completed
查看數據庫:
[root@DMP-GATEWAY ~]# mysql -uroot –p
mysql> show databases;
--------------------
Database
--------------------
information_schema
exp
hive
hivedb 可以看到hivedb數據庫被創建
三、在mestatore初始化后,會自動創建hivedb數據庫,清空所有表,或者
drop database hivedb
create database hivedb
source hive-txn-schema-0.14.0.mysql.sql
source hive-schema-1.2.0.mysql.sql
git地址:
https://github.com/apache/hive/tree/release-1.2.1/metastore/scripts/upgrade/mysql
四、報錯
no library native-lzo
需要 yum install -y lzo
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。