<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive Metastore trouble with jbdc mysql in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-Metastore-trouble-with-jbdc-mysql/m-p/204782#M166771</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/45308/xoffey.html" nodeid="45308"&gt;@Michael Coffey&lt;/A&gt;&lt;/P&gt;&lt;P&gt;We see the following error:&lt;/P&gt;&lt;PRE&gt;Metastore connection URL: jdbc:mysql://hadoop12.xxxxx.com/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. 
Underlying cause: 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. SQL Error code: 0 org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version. 
    at org.apache.hive.beeline.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:80) 
.
.
org.apache.hive.beeline.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:76) 
... 11 more Caused by: java.net.ConnectException: Connection refused (Connection refused) 
    at java.net.PlainSocketImpl.socketConnect(Native Method) 
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)&lt;/PRE&gt;&lt;P&gt;.&lt;BR /&gt;Basically this is MySQL connection issue. So you should check the couple of things first:&lt;BR /&gt;&lt;BR /&gt;1). The machine where you are running the MySQL please check the following, If the MySQL is running:&lt;/P&gt;&lt;PRE&gt;# ssh root@hadoop12.neocortix.com
# ps -ef | grep mysql&lt;/PRE&gt;&lt;P&gt;2). Check if the Port of MySQL is opened or not? By Passing the MySQL server PID to the following command :&lt;/P&gt;&lt;PRE&gt;# netstat -tnlpa | grep `cat /var/run/mysqld/mysqld.pid`
tcp6       0      0 :::3306                 :::*                    LISTEN      1235/mysqld   
&lt;/PRE&gt;&lt;P&gt;3). Check if using the following kind of Java Utility you are able to establish the JDBC connection to the MySQL from the ambari-server host AND from the same host where mySQL is installed?&lt;/P&gt;&lt;PRE&gt;# /usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar -Djava.library.path=/var/lib/ambari-agent/cache org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://hadoop12.xxxxx.com/hive" "hive" "hive" com.mysql.jdbc.Driver
&lt;/PRE&gt;&lt;P&gt;**NOTE:** The JAR "DBConnectionVerification.jar" is provided by Ambari for DB connection check.  You will need to change the JAVA path in the above command. &lt;/P&gt;&lt;P&gt;Also please use the correct Hostname (and change : hadoop12.xxxxx.com to correct one) to verify the connectivity. (I have masked the hostname)&lt;/P&gt;&lt;P&gt;Above will isolate the issue of MySQL DB connectivity. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Usually the "CommunicationsException : Communications link failure" error indicates that there is either some MySQL DB server issue or the N/W issue. &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Oct 2017 12:23:51 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2017-10-03T12:23:51Z</dc:date>
  </channel>
</rss>

