Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hive DB issue in connection

avatar
Contributor

Hi,

Below is the logs

 

Host checks started.
Check execute list: db_connection_check
DB connection check started.
WARNING: File /var/lib/ambari-agent/cache/DBConnectionVerification.jar already exists, assuming it was downloaded before
WARNING: File /var/lib/ambari-agent/cache/mysql-connector-java.jar already exists, assuming it was downloaded before
call['/usr/jdk64/jdk1.8.0_112/bin/java -cp /var/lib/ambari-agent/cache/DBConnectionVerification.jar:/var/lib/ambari-agent/cache/mysql-connector-java.jar -Djava.library.path=/var/lib/ambari-agent/cache org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://host.com/metastore" "hive" [PROTECTED] com.mysql.jdbc.Driver'] {}
call returned (1, 'ERROR: Unable to connect to the DB. Please check DB connection properties.\ncom.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.')
DB connection check completed.
Host checks completed.
Check db_connection_check was unsuccessful. Exit code: 1. Message: ERROR: Unable to connect to the DB. Please check DB connection properties.
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.

Command failed after 1 tries

 

1 ACCEPTED SOLUTION

avatar
Master Mentor

@irfangk1 

 

Please download it from here irfangk1_download

HTH

View solution in original post

16 REPLIES 16

avatar
Contributor

cat /etc/ambari-server/conf/ambari.properties | grep mysql
custom.mysql.jdbc.name=mysql-connector-java.jar
previous.custom.mysql.jdbc.name=mysql-connector-java.jar

avatar
Master Mentor

@irfangk1 
Can you share the screenshot of your Ambari Hive config  because when I see "jdbc:mysql://host.com/metastore" "hive"   that means you dont have  not The default  TCP port 

for PostgreSQL is usually 5432 see in the postgresql.conf

avatar
Contributor

Mysql is not starting now check the below error

service mysql restart
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.


& after putting port of mysql,

WARNING: File /var/lib/ambari-agent/cache/DBConnectionVerification.jar already exists, assuming it was downloaded before
WARNING: File /var/lib/ambari-agent/cache/mysql-connector-java.jar already exists, assuming it was downloaded before
2019-10-11 10:26:28,466 - call['/usr/jdk64/jdk1.8.0_112/bin/java -cp /var/lib/ambari-agent/cache/DBConnectionVerification.jar:/var/lib/ambari-agent/cache/mysql-connector-java.jar -Djava.library.path=/var/lib/ambari-agent/cache org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://172.27.3.12: 3306" "hive" [PROTECTED] com.mysql.jdbc.Driver'] {}
2019-10-11 10:26:28,607 - call returned (1, 'ERROR: Unable to connect to the DB. Please check DB connection properties.\ncom.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: \'java.lang.NumberFormatException: For input string: " 3306"\'.')
2019-10-11 10:26:28,608 - DB connection check completed.
2019-10-11 10:26:28,608 - Host checks completed.
2019-10-11 10:26:28,608 - Check db_connection_check was unsuccessful. Exit code: 1. Message: ERROR: Unable to connect to the DB. Please check DB connection properties.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: " 3306"'.

Command failed after 1 tries

 

avatar
Master Mentor

@irfangk1 

 

That means you didn't install MySQL. Can I ask you one question? What documentation are you using as a reference?The basic steps are described when you are preparing the environment. To me it seems you launched the deployment using the embedded database Postgresql but now you want to switch to MySQL. To do that you need to install mysql and pre-create the ambari database before launching the Ambari server setup, that explains why you are getting all those errors.
I can send you a procedure in 9 hours

avatar
Contributor

Please send procedure. Thanks 

avatar
Master Mentor

@irfangk1 

 

Please download it from here irfangk1_download

HTH

avatar
Contributor

Hi Shelton,

I am waiting for the procedure