Today, I started spark. I always reported an error when connecting hive. The error is as follows
21/12/12 19:55:26 ERROR Hive: Cannot initialize metastore due to autoCreate error javax.jdo.JDODataStoreException: Required table missing : "`DBS`" in Catalog "" Schema "". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.schema.autoCreateTables" Exception in thread "main" org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql));
Looking at the yellow font in the back, I first initialized the metadata. I wrote it in my last blog. Later, I found that it was not the metadata problem, but the need to open {datanucleus schema.autoCreateTables
<property> <name>datanucleus.schema.autoCreateAll</name> <value>true</value> </property>
Complete hive site xm:
<configuration> <!-- Location of metadata generated by Hive--> <property> <name>hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </property> <!--- Use local service to connect to Hive, default is true--> <property> <name>hive.metastore.local</name> <value>true</value> </property> <!-- URL address of the database connection JDBC--> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false&serverTimezone=UTC</value> </property> <!-- Database connection driver, i.e. MySQL driver--> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <!-- MySQL database user name--> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <!-- MySQL Database Password--> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>123456</value> </property> <property> <name>hive.metastore.schema.verification</name> <value>false</value> </property> <property> <name>datanucleus.schema.autoCreateAll</name> <value>true</value> </property> </configuration>
Similar Posts:
- :org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
- Hiveserver2 Connect Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop01:100…
- [Solved] hadoop Configuration Modify Error: hive.ql.metadata.HiveException
- Hive initialization metadata error [How to Solve]
- Error when starting ./spark-shell command [How to Solve]
- “Execution error, return code 1 from org. Apache. Hadoop. Hive. QL. Exec. Movetask” error occurred when hive imported data locally
- [Solved] Springboot Project Connect MYSQL Error: Establishing SSL connection without server’s identity verification is not recommended.
- Hive connection HBase external table error, can’t get the locations
- org.apache.thrift.TApplicationException: Required field ‘client_protocol’ is unset!
- For the problem of establishing SSL connection in mysql, set usessl = false to explicitly disable SSL, or set usessl = true