Caused by: java.net.ConnectException: Connection refused (Connection refused)
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 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
... 19 more
+ NUM_TABLES='[ main] SqlRunner ERROR Error connecting to db with user '\''sentry'\'' and jdbcUrl '\''jdbc:mysql://localhost:3306/sentry?useUnicode=true&characterEncoding=UTF-8'\'''
+ [[ 1 -ne 0 ]]
+ echo 'Failed to count existing tables.'
+ exit 1
Created 08-28-2019 12:44 AM
Created 08-26-2019 01:18 PM
Hi,
The message "java.net.ConnectException: Connection refused" is quite clear, the backend database has refused the connection request. Check that your DB is is up and running and that you can connect to it from the localhost. Haven't you moved the Sentry role or the database to another host?Or do you have SSL enabled/required for the backend database?
Created 08-26-2019 08:06 PM
I am able to connect from the localhost as sentry, root etc. without any issues
does the password provided in the sentry configuration in CM need to be encrypted or something.?
How can I confirm that the jdbc url is correct ?
We just upgraded CM/CDH from 5.12 to 6.2
Created 08-27-2019 01:16 AM
You can use any JDBC client to test whether the JDBC connection URL is proper, for example:
http://jdbcsql.sourceforge.net/
or
http://squirrel-sql.sourceforge.net/
Have you tried to use the fully qualified domain name of the host instead of localhost? (make sure to allow the connection for the sentry user for the FQDN too on MySQL side)
Created 08-27-2019 10:24 AM
Using Squirell, I finally able to connect only with these additional JDBC URL settings:
jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
How can I set those properties in CM for MySQL
Created 08-28-2019 12:44 AM