Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Hive issue.

avatar

Hdp version:-HDP 2.4.2.0-258.

I am running follwing command :-

hive --service metatool -listFSRoot

but getting error:-

ava.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://hdp-test/hive?createDatabaseIfNotExist=true, username = hive. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------

java.sql.SQLException: Access denied for user 'hive'@'hdp-test' (using password: YES)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)

and also :-

/usr/hdp/2.4.2.0-258/hive/bin/schematool -dbType mysql -info

WARNING: Use "yarn jar" to launch YARN applications.

Metastore connection URL: jdbc:mysql://hdp-test/hive?createDatabaseIfNotExist=true

Metastore Connection Driver : com.mysql.jdbc.Driver

Metastore connection User: hive

org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.

*** schemaTool failed ***

Thanks in advance.

1 ACCEPTED SOLUTION

avatar

This issue is resolved after exporting the HIVE home directory:-

export HIVE_CONF_DIR=/etc/hive/2.4.2.0-258/0/conf

After exporting the directory i got following output

Initializing HiveMetaTool..

16/09/01 06:53:54 INFO metastore.ObjectStore: ObjectStore, initialize called

16/09/01 06:53:54 INFO DataNucleus.Persistence: Property hive.metastore.integral.jdo.pushdown unknown - will be ignored

16/09/01 06:53:54 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored

16/09/01 06:53:55 INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,Database,Type,FieldSchema,Order"

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MFieldSchema" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MOrder" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MFieldSchema" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MOrder" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Query: Reading in results for query "org.datanucleus.store.rdbms.query.SQLQuery@0" since the connection used is closing

16/09/01 06:53:56 INFO metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL

16/09/01 06:53:56 INFO metastore.ObjectStore: Initialized ObjectStore

Listing FS Roots..

hdfs://hdptest/db_new.db

hdfs://hdptest/db_new1.db

hdfs://hdptest/demo_database.db

And for second command output is :-

/usr/hdp/2.4.2.0-258/hive/bin/schematool -dbType mysql -info

WARNING: Use "yarn jar" to launch YARN applications.

Metastore connection URL: jdbc:mysql://hdp-test/hive?createDatabaseIfNotExist=true

Metastore Connection Driver : com.mysql.jdbc.Driver

Metastore connection User: hive

Hive distribution version: 1.2.1000

Metastore schema version: 1.2.1000

schemaTool completed

View solution in original post

1 REPLY 1

avatar

This issue is resolved after exporting the HIVE home directory:-

export HIVE_CONF_DIR=/etc/hive/2.4.2.0-258/0/conf

After exporting the directory i got following output

Initializing HiveMetaTool..

16/09/01 06:53:54 INFO metastore.ObjectStore: ObjectStore, initialize called

16/09/01 06:53:54 INFO DataNucleus.Persistence: Property hive.metastore.integral.jdo.pushdown unknown - will be ignored

16/09/01 06:53:54 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored

16/09/01 06:53:55 INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,Database,Type,FieldSchema,Order"

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MFieldSchema" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MOrder" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MFieldSchema" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Datastore: The class "org.apache.hadoop.hive.metastore.model.MOrder" is tagged as "embedded-only" so does not have its own datastore table.

16/09/01 06:53:56 INFO DataNucleus.Query: Reading in results for query "org.datanucleus.store.rdbms.query.SQLQuery@0" since the connection used is closing

16/09/01 06:53:56 INFO metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL

16/09/01 06:53:56 INFO metastore.ObjectStore: Initialized ObjectStore

Listing FS Roots..

hdfs://hdptest/db_new.db

hdfs://hdptest/db_new1.db

hdfs://hdptest/demo_database.db

And for second command output is :-

/usr/hdp/2.4.2.0-258/hive/bin/schematool -dbType mysql -info

WARNING: Use "yarn jar" to launch YARN applications.

Metastore connection URL: jdbc:mysql://hdp-test/hive?createDatabaseIfNotExist=true

Metastore Connection Driver : com.mysql.jdbc.Driver

Metastore connection User: hive

Hive distribution version: 1.2.1000

Metastore schema version: 1.2.1000

schemaTool completed