异常1:
Exception in thread “main” java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: KaTeX parse error: Expected '}', got 'EOF' at end of input: …a.io.tmpdir%7D/%7Bhive.session.id%7D_resources
修复办法:
创建目录:/Users/kefeng/BigData/hive/apache-hive-2.3.8-bin/data
修改hive-site.xml
<property>
<name>hive.exec.local.scratchdir</name>
<value>/Users/kefeng/BigData/hive/apache-hive-2.3.8-bin/data/${system:user.name}</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/Users/kefeng/BigData/hive/apache-hive-2.3.8-bin/data/${hive.session.id}_resources</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
异常2: schematool -dbType mysql -initSchema执行
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
异常3:schematool -dbType mysql -initSchema执行出现
Initialization script hive-schema-2.3.0.mysql.sql
Error: Duplicate key name ‘PCS_STATS_IDX’ (state=42000,code=1061)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
Underlying cause: java.io.IOException : Schema script failed, errorcode 2
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
数据库可能被创建,检查并删除
异常4: schematool -dbType mysql -initSchema执行出现
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ‘=’ (code 61); expected a semi-colon after the reference for entity ‘useSSL’
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value>
异常5:Tue Mar 30 18:48:18 CST 2021 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value>