Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
... 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
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?
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
You can use any JDBC client to test whether the JDBC connection URL is proper, for example:
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)
Using Squirell, I finally able to connect only with these additional JDBC URL settings:
How can I set those properties in CM for MySQL