Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 08-31-2016 09:59 AM
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.
Created 09-01-2016 06:55 AM
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
Created 09-01-2016 06:55 AM
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