<?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-server2 DB connection issue in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-server2-DB-connection-issue/m-p/210545#M172487</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/19336/stephencoyle.html" nodeid="19336"&gt;@steve coyle&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As the error seems to be related to missing mysql driver class:&lt;/P&gt;&lt;PRE&gt;java.lang.ClassNotFoundException: com.mysql.jdbc.Driver&lt;/PRE&gt;&lt;P&gt;- Can you please check if you have copied the "mysql-connector.jar"  inside the following location?&lt;/P&gt;&lt;PRE&gt;# cp  -r  /usr/lib/hive/lib/mysql-connector-java.jar   /usr/share/java/&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Additionally please refer to: &lt;A href="https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.1/bk_ambari-reference/content/using_hive_with_mysql.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.1/bk_ambari-reference/content/using_hive_with_mysql.html&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;# yum install mysql-connector-java*
# ls -l /usr/share/java/mysql-connector-java.jar
# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2017 02:41:18 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2017-08-03T02:41:18Z</dc:date>
    <item>
      <title>Hive-server2 DB connection issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-server2-DB-connection-issue/m-p/210544#M172486</link>
      <description>&lt;P&gt;recently upgraded to ambari 2.4 got though a previous oozie issue and now when im restarting hive i get this error for hiver-server2:&lt;/P&gt;&lt;PRE&gt;stderr:   /var/lib/ambari-agent/data/errors-4864.txt

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py", line 211, in &amp;lt;module&amp;gt;
    HiveServer().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 720, in restart
    self.start(env, upgrade_type=upgrade_type)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py", line 88, in start
    hive_service('hiveserver2', action = 'start', upgrade_type=upgrade_type)
  File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line 89, in thunk
    return fn(*args, **kwargs)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py", line 106, in hive_service
    validate_connection(params.hive_jdbc_target, params.hive_lib)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py", line 162, in validate_connection
    path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin', tries=5, try_sleep=10)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 273, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/jdk64/jdk1.8.0_40/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/hdp/current/hive-server2/lib/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification 'jdbc:mysql://&amp;lt;server name removed&amp;gt;/hive?createDatabaseIfNotExist=true' hive [PROTECTED] com.mysql.jdbc.Driver' returned 1. ERROR: Unable to connect to the DB. Please check DB connection properties.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver&lt;/PRE&gt;&lt;P&gt;i inherited this cluster so i have no idea what DB it was connecting and i cant for the life of me find anything about it in the documentation i was left. &lt;/P&gt;&lt;P&gt;knox and ranger are not enabled but it seems kerberos is but nothing has changed with that. &lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 02:31:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-server2-DB-connection-issue/m-p/210544#M172486</guid>
      <dc:creator>stephen_coyle</dc:creator>
      <dc:date>2017-08-03T02:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Hive-server2 DB connection issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-server2-DB-connection-issue/m-p/210545#M172487</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/19336/stephencoyle.html" nodeid="19336"&gt;@steve coyle&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As the error seems to be related to missing mysql driver class:&lt;/P&gt;&lt;PRE&gt;java.lang.ClassNotFoundException: com.mysql.jdbc.Driver&lt;/PRE&gt;&lt;P&gt;- Can you please check if you have copied the "mysql-connector.jar"  inside the following location?&lt;/P&gt;&lt;PRE&gt;# cp  -r  /usr/lib/hive/lib/mysql-connector-java.jar   /usr/share/java/&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Additionally please refer to: &lt;A href="https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.1/bk_ambari-reference/content/using_hive_with_mysql.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.1/bk_ambari-reference/content/using_hive_with_mysql.html&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;# yum install mysql-connector-java*
# ls -l /usr/share/java/mysql-connector-java.jar
# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 02:41:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-server2-DB-connection-issue/m-p/210545#M172487</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-08-03T02:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hive-server2 DB connection issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-server2-DB-connection-issue/m-p/210546#M172488</link>
      <description>&lt;P&gt;ahhhhh yes! &lt;/P&gt;&lt;PRE&gt;ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar&lt;/PRE&gt;&lt;P&gt;ran that command and it worked. guess when it was updated it broke that connection? either way its working now! thanks so much! &lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 02:54:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-server2-DB-connection-issue/m-p/210546#M172488</guid>
      <dc:creator>stephen_coyle</dc:creator>
      <dc:date>2017-08-03T02:54:02Z</dc:date>
    </item>
  </channel>
</rss>

