Created on 09-19-2016 11:43 AM - edited 08-18-2019 05:11 AM
I have followed http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.0/bk_Installing_HDP_AMB/content/_download_the_...
link to install ambari-server whose version is 2.1.2
and for mysql I followed https://docs.hortonworks.com/HDPDocuments/Ambari-2.1.1.0/bk_ambari_reference_guide/content/_using_am...
sudo ambari-server start
Using python /usr/bin/python2.7 Starting ambari-server Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Server PID at: /var/run/ambari-server/ambari-server.pid Server out at: /var/log/ambari-server/ambari-server.out Server log at: /var/log/ambari-server/ambari-server.log Waiting for server start......... ERROR: Exiting with exit code -1. REASON: Ambari Server java process died with exitcode 1. Check /var/log/ambari-server/ambari-server.out for more information.
and the error in /var/log/ambari-server/ambari-server.log is
ERROR [main] DBAccessorImpl:102 - Error while creating database accessor com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
and i have copied these jars in the /usr/share/java folder and also gave classpath for these jars in bashrc
Created 09-20-2016 07:43 AM
Its working now. I had to change my ambari.properties file...
added
db.mysql.jdbc.name=/var/lib/ambari-server/resources/mysql-connector-java-5.1.28.jar
and modified these lines
server.jdbc.rca.url=jdbc:mysql://localhost:3306/ambari
server.jdbc.url=jdbc:mysql://localhost:3306/ambari
Created 09-19-2016 11:45 AM
Please help me with this issue
Created 09-19-2016 12:28 PM
@Santhoshi G try exporting the classpath in /var/lib/ambari-server/ambari-env.sh and restart ambari-server
Created 09-19-2016 12:53 PM
Thanks pankaj for the reply, I added
export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java-5.1.28.jar
export CLASSPATH=$CLASSPATH:/usr/share/java/mysql.jar
export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java.jar
in /var/lib/ambari-server/ambari-env.sh
but again the same error is appearing
Created 09-19-2016 01:19 PM
can you connect to mysql from mysql cli or mysqladmin?
make sure its working
make sure you have rwx permissions for mysql directories
check the /var/log/mysql logs
make sure you can access mysql
telnet localhost 3306
make sure you have iptables and firewalls on your machine (and any on your network off) some firewalls in corporate or on your comcast/verizon/cable router will block some mysql ports)
See here:
http://stackoverflow.com/questions/6865538/solving-a-communications-link-failure-with-jdbc-and-mysql
Is mysql setup and running?
make sure your bind-address is set correctly to 127... or 0..
Linux: /etc/mysql/my.cnf or /etc/my.cnf
Created 09-20-2016 05:08 AM
Hello Spann,
I'm able to connect to mysql cli, and I'm able to connect to mysql through other projects of mine.
My bind address is 127.0.0.1 and logs in /var/log/mysql/error.log is empty.
Output for telnet localhost 3306
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'. [ 5.6.31-0ubuntu0.14.04.2�"q7[E(7�{!-_uS{54B3smysql_native_password
Connection closed by foreign host.
And the same error is appearing in logs.
ERROR [main] DBAccessorImpl:102 - Error while creating database accessor 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.
Created 09-20-2016 05:11 AM
And the permissions for mysql are:
/var/lib$ ls -l | grep 'mysql'
drwx------ 6 mysql mysql 4096 Sep 20 10:26 mysql
Created 09-20-2016 05:17 AM
Santhoshi G refer this link, you may get the solution
Created 09-20-2016 05:47 AM
Hello Mohan,
I tried this link. No use
Created 09-20-2016 07:43 AM
Its working now. I had to change my ambari.properties file...
added
db.mysql.jdbc.name=/var/lib/ambari-server/resources/mysql-connector-java-5.1.28.jar
and modified these lines
server.jdbc.rca.url=jdbc:mysql://localhost:3306/ambari
server.jdbc.url=jdbc:mysql://localhost:3306/ambari