hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grandl Robert <rgra...@yahoo.com>
Subject hive unable to use metastore database
Date Thu, 28 Aug 2014 22:31:29 GMT
Hi guys,

I was trying to configure the metastore database, following the steps:

1. sudo apt-get install mysql-server
2. sudo service mysql start
3. sudo apt-get install libmysql-java
-> copied /user/share/java/libmysql-*.jar to $HIVE_HOME/lib

4. 
sudo /usr/bin/mysql_secure_installation
[...]
Enter current password for root (enter for none):
OK, successfully used password, moving on...
[...]
Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] N
[...]
Remove test database and access to it [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
All done!


5. 

mysql -u root -p
Enter password:
mysql> CREATE DATABASE metastore;
mysql> USE metastore;
mysql> SOURCE $HIVE_HOME/scripts/metastore/upgrade/mysql/hive-schema-0.10.0.mysql.sql;

6. 
mysql> CREATE USER 'hive'@'nectar-11' IDENTIFIED BY 'hive';
mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'hive'@'nectar-11';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES,EXECUTE ON metastore.* TO 'hive'@'nectar-11';
mysql> FLUSH PRIVILEGES;
mysql> quit;

Then I set the following properties in hive-site.xml
property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://nectar-11/metastore</value> 
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
</property>

<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>hive</value>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>hive</value>
</property>


But when I start hive, it throws a bunch of exception with the main cause being:
Caused by: java.sql.SQLException: Unable to open a test connection to the given database.
JDBC url = jdbc:mysql://nectar-11/metastore, username = hive. Terminating connection pool
(set lazyInit to true if you expect to start your database after your app). Original Exception:
------
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not
received any packets from the server.

Do you have any ideas, what I am doing wrong here ? Thanks.
Mime
View raw message