Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

HiveMetastore & Hiveserver2 Failed to start On HortonWorks Hadoop cluster ?

Solved Go to solution

Re: HiveMetastore & Hiveserver2 Failed to start On HortonWorks Hadoop cluster ?

New Contributor

Hi Geoffrey Shelton Okot,

Yeah i tried with an existing database, didnt work too , i tried with the ip adress and with localhost too ! the error is the same !

107955-existing-db.jpg

PS:i cant see ur screenshot

Re: HiveMetastore & Hiveserver2 Failed to start On HortonWorks Hadoop cluster ?

Mentor

@Adil BAKKOURI

Have you seen my latest update?

Highlighted

Re: HiveMetastore & Hiveserver2 Failed to start On HortonWorks Hadoop cluster ?

New Contributor

Hi Geoffrey Shelton Okot,

Yeah i tried with an existing database, didnt work too , i tried with the ip adress and with localhost too ! the error is the same !

107955-existing-db.jpg

PS:i cant see ur screenshot

Re: HiveMetastore & Hiveserver2 Failed to start On HortonWorks Hadoop cluster ?

New Contributor

Hi Geoffrey Shelton Okot ,


Yeah i dont understund why it doesnt work !!

I tried all the solutions but still got the same error as my first publication, Here is my Os details:


?root@RHBigData1:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial?

Here is my hiveserver2.log error:


java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://master.rh.bigdata.cluster/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.SQLSyntaxErrorException: Access denied for user 'hive'@'master.rh.bigdata.cluster' to database 'hive'
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:832)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361)
        at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416)
        at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
        at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:483)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:296)
        at sun.reflect.GeneratedConstructorAccessor71.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:606)

.
.
.
.
.
Caused by: java.sql.SQLSyntaxErrorException: Access denied for user 'hive'@'master.rh.bigdata.cluster' to database 'hive'

or my hive@master.rh.bigdata.cluster User have all the privileges on this database??


Re: HiveMetastore & Hiveserver2 Failed to start On HortonWorks Hadoop cluster ?

New Contributor


mysql> SELECT table_name, table_schema, engine FROM information_schema.tables;

+---------------------------------------+--------------------+--------+
| table_name                            | table_schema       | engine |
+---------------------------------------+--------------------+--------+
| CHARACTER_SETS                        | information_schema | MEMORY |
| COLLATIONS                            | information_schema | MEMORY |
| COLLATION_CHARACTER_SET_APPLICABILITY | information_schema | MEMORY |
| COLUMNS                               | information_schema | InnoDB |
| COLUMN_PRIVILEGES                     | information_schema | MEMORY |
| ENGINES                               | information_schema | MEMORY |
| EVENTS                                | information_schema | InnoDB |
| FILES                                 | information_schema | MEMORY |
| GLOBAL_STATUS                         | information_schema | MEMORY |
| GLOBAL_VARIABLES                      | information_schema | MEMORY |
| KEY_COLUMN_USAGE                      | information_schema | MEMORY |
| OPTIMIZER_TRACE                       | information_schema | InnoDB |
| PARAMETERS                            | information_schema | InnoDB |
| PARTITIONS                            | information_schema | InnoDB |
| PLUGINS                               | information_schema | InnoDB |
| PROCESSLIST                           | information_schema | InnoDB |
| PROFILING                             | information_schema | MEMORY |
| REFERENTIAL_CONSTRAINTS               | information_schema | MEMORY |
| ROUTINES                              | information_schema | InnoDB |
| SCHEMATA                              | information_schema | MEMORY |
| SCHEMA_PRIVILEGES                     | information_schema | MEMORY |
| SESSION_STATUS                        | information_schema | MEMORY |
| SESSION_VARIABLES                     | information_schema | MEMORY |
| STATISTICS                            | information_schema | MEMORY |
| TABLES                                | information_schema | MEMORY |
| TABLESPACES                           | information_schema | MEMORY |
| TABLE_CONSTRAINTS                     | information_schema | MEMORY |
| TABLE_PRIVILEGES                      | information_schema | MEMORY |
| TRIGGERS                              | information_schema | InnoDB |
| USER_PRIVILEGES                       | information_schema | MEMORY |
| VIEWS                                 | information_schema | InnoDB |
| INNODB_LOCKS                          | information_schema | MEMORY |
| INNODB_TRX                            | information_schema | MEMORY |
| INNODB_SYS_DATAFILES                  | information_schema | MEMORY |
| INNODB_FT_CONFIG                      | information_schema | MEMORY |
| INNODB_SYS_VIRTUAL                    | information_schema | MEMORY |
| INNODB_CMP                            | information_schema | MEMORY |
| INNODB_FT_BEING_DELETED               | information_schema | MEMORY |
| INNODB_CMP_RESET                      | information_schema | MEMORY |
| INNODB_CMP_PER_INDEX                  | information_schema | MEMORY |
| INNODB_CMPMEM_RESET                   | information_schema | MEMORY |
| INNODB_FT_DELETED                     | information_schema | MEMORY |
| INNODB_BUFFER_PAGE_LRU                | information_schema | MEMORY |
| INNODB_LOCK_WAITS                     | information_schema | MEMORY |
| INNODB_TEMP_TABLE_INFO                | information_schema | MEMORY |
| INNODB_SYS_INDEXES                    | information_schema | MEMORY |
| INNODB_SYS_TABLES                     | information_schema | MEMORY |
| INNODB_SYS_FIELDS                     | information_schema | MEMORY |
| INNODB_CMP_PER_INDEX_RESET            | information_schema | MEMORY |
| INNODB_BUFFER_PAGE                    | information_schema | MEMORY |
| INNODB_FT_DEFAULT_STOPWORD            | information_schema | MEMORY |
| INNODB_FT_INDEX_TABLE                 | information_schema | MEMORY |
| INNODB_FT_INDEX_CACHE                 | information_schema | MEMORY |
| INNODB_SYS_TABLESPACES                | information_schema | MEMORY |
| INNODB_METRICS                        | information_schema | MEMORY |
| INNODB_SYS_FOREIGN_COLS               | information_schema | MEMORY |
| INNODB_CMPMEM                         | information_schema | MEMORY |
| INNODB_BUFFER_POOL_STATS              | information_schema | MEMORY |
| INNODB_SYS_COLUMNS                    | information_schema | MEMORY |
| INNODB_SYS_FOREIGN                    | information_schema | MEMORY |
| INNODB_SYS_TABLESTATS                 | information_schema | MEMORY |
| columns_priv                          | mysql              | MyISAM |
| db                                    | mysql              | MyISAM |
| engine_cost                           | mysql              | InnoDB |
| event                                 | mysql              | MyISAM |
| func                                  | mysql              | MyISAM |
| general_log                           | mysql              | CSV    |
| gtid_executed                         | mysql              | InnoDB |
| help_category                         | mysql              | InnoDB |
| help_keyword                          | mysql              | InnoDB |
| help_relation                         | mysql              | InnoDB |
| help_topic                            | mysql              | InnoDB |
| innodb_index_stats                    | mysql              | InnoDB |
| innodb_table_stats                    | mysql              | InnoDB |
| ndb_binlog_index                      | mysql              | MyISAM |
| plugin                                | mysql              | InnoDB |
| proc                                  | mysql              | MyISAM |
| procs_priv                            | mysql              | MyISAM |
| proxies_priv                          | mysql              | MyISAM |
| server_cost                           | mysql              | InnoDB |
| servers                               | mysql              | InnoDB |
| slave_master_info                     | mysql              | InnoDB |
| slave_relay_log_info                  | mysql              | InnoDB |
| slave_worker_info                     | mysql              | InnoDB |
| slow_log                              | mysql              | CSV    |
| tables_priv                           | mysql              | MyISAM |
| time_zone                             | mysql              | InnoDB |
| time_zone_leap_second                 | mysql              | InnoDB |
| time_zone_name                        | mysql              | InnoDB |
| time_zone_transition                  | mysql              | InnoDB |
| time_zone_transition_type             | mysql              | InnoDB |
| user                                  | mysql              | MyISAM |
+---------------------------------------+--------------------+--------+
92 rows in set (0.01 sec)

Re: HiveMetastore & Hiveserver2 Failed to start On HortonWorks Hadoop cluster ?

Mentor

@Adil BAKKOURI

Hurrah we are now there, thats the error I was expecting now this is a case closed.

Validate the hostname by running

# hostname -f 

This should give you the FQDN

The error below is very simple its a privilege issue with the hive user and database creation script you run, you didn't give the correct privileges to the hive user "Access denied for user 'hive'@'master.rh.bigdata.cluster' to database 'hive'"


To resolve the above please do the following assumptions

Root password = gr3atman

Hive password = hive

Hostname = master.rh.bigdata.cluster

mysql -uroot -pgr3atman
mysql> GRANT ALL PRIVILEGES ON hive.* to 'hive'@'localhost' identified by 'hive';
mysql> GRANT ALL PRIVILEGES ON hive.* to 'hive'@'master.rh.bigdata.cluster' identified by 'hive';
mysql> GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'master.rh.bigdata.cluster';
mysql> flush privileges;


All of the above should succeed. Now your hive should fire up Bravo !!


************

If you found this answer addressed your question, please take a moment to log in and click the "accept" link on the answer.

That would be a great help to Community users to find the solution quickly for these kinds of errors.

Don't have an account?
Coming from Hortonworks? Activate your account here