報錯環境:
CDH中集成的hive服務,啓動報錯,因此初始化一下元數據。java
配置文件:/etc/hive/conf hive-site.xmlmysql
命令目錄:/opt/cloudera/parcels/CDH-5.15.1-1.cdh5.15.1.p0.4/lib/hive/binsql
報錯現象:
執行如下命令的時候報錯:apache
./schematool -dbType mysql -initSchemaoop
[root@master bin]# ./schematool -dbType mysql -initSchema Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0 which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.8.0_191/bin:/root/bin) Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0 Metastore connection URL: jdbc:mysql://192.168.52.26:3306/hive Metastore Connection Driver : com.mysql.jdbc.Driver Metastore connection User: APP org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version. *** schemaTool failed ***
解決方法:
在hive-site.xml文件中添加如下內容spa
<property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.52.26:3306/hive</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>root</value> </property>
保存以後從新執行命令。code