Created 08-28-2018 05:38 AM
"Database check failed to complete." when starting ambari-server
[root@ham ~]# sudo ambari-server start Using python /usr/bin/python Starting ambari-server Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Ambari database consistency check started... No errors were found. ERROR: Exiting with exit code 1. REASON: Database check failed to complete. Please check /var/log/ambari-server/ambari-server.log and /var/log/ambari-server/ambari-server-check-database.log for more information. [root@ham ~]#
Please check the attached log for the same & suggest the fixambari-server-start-error.txt
Created 08-28-2018 05:42 AM
The error which youa re getting is basically "NoRouteToHostException" means your MySQl Database host is not resolving.
Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:259) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:307)
First of all please check if you have the JDBC properties properly defined inside the "/etc/ambari-server/conf/ambari.properties" ?
# grep 'jdbc' /etc/ambari-server/conf/ambari.properties . . custom.mysql.jdbc.name=mysql-connector-java.jar server.jdbc.database=mysql server.jdbc.database_name=ambari server.jdbc.driver=com.mysql.jdbc.Driver server.jdbc.hostname=your_mysql.example.com server.jdbc.port=3306 server.jdbc.url=jdbc:mysql://your_mysql.example.com:3306/ambari server.jdbc.user.name=ambari server.jdbc.user.passwd=/etc/ambari-server/conf/password.dat
Please run the following command inside the MySQL Database host (terminal) to verify if the Port 3306 is opened by MySQL and Firewall is disabled ?
# hostname -f # netstat -tnlpa | grep 3306 # service iptables stop (CentOS 6) # systemctl stop firewalld (CentOS 7)
Make sure that the "server.jdbc.url" is correctly set and the MySQL running on that host is reachable from ambari server host? Follopwing commands you will need to run from ambari server host to verify if the Database hostname & port are accessible or not?
# telnet your_mysql.example.com 3306 # nc -v your_mysql.example.com 3306
Also please make sure that you have done the MySQL setup for Ambari Server as described in the following doc:
https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.2/bk_ambari-administration/content/using_amba...
Specially check if your "server.jdbc.database_name" name is setup properly and the user "server.jdbc.user.name" has proper privileges on ambari DB to execute queries?
# mysql -u root -p CREATE USER '<AMBARIUSER>'@'%' IDENTIFIED BY '<AMBARIPASSWORD>'; GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'%'; CREATE USER '<AMBARIUSER>'@'localhost' IDENTIFIED BY '<AMBARIPASSWORD>'; GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'localhost'; CREATE USER '<AMBARIUSER>'@'<AMBARISERVERFQDN>' IDENTIFIED BY '<AMBARIPASSWORD>'; GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'<AMBARISERVERFQDN>'; FLUSH PRIVILEGES
Also please check if you are able to connect to MySQl database using the mysql client from ambri server host?
# mysql -u ambari -p Enter Password: bigdata
.