Support Questions

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

Upgrade Sentry Database Tables fails after upgrade from 5.12 to 6.2

avatar
Contributor

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

 

1 ACCEPTED SOLUTION

avatar
Super Guru
@ChineduLB

If you go to CM > Sentry > Configuration > search for "database", you should be able to see those database options, the one you need is "Sentry Server Database Password".

Plus, you also need to make sure that the username and password you used here can connect to Sentry database.

Cheers
Eric

View solution in original post

5 REPLIES 5

avatar

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?

avatar
Contributor

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 

 

avatar

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)

avatar
Contributor

 

 

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

avatar
Super Guru
@ChineduLB

If you go to CM > Sentry > Configuration > search for "database", you should be able to see those database options, the one you need is "Sentry Server Database Password".

Plus, you also need to make sure that the username and password you used here can connect to Sentry database.

Cheers
Eric