Support Questions

Find answers, ask questions, and share your expertise

Renewing Phoenix Connection Using Kerberos Tomcat

avatar
New Contributor

Hi All,

I am using apache phoenix to query data from hbase. I am using keytab mechanism to connect to phoenix. When i Create phoenix connection pool everything works well for the 24hrs period which is the ticket_lifetime of kerberos token and the connections fail after 24hrs. I have tried to create a new Connection pool object for every 2 hrs and destroy the old connection pool once active connections expired on previous data source. But this also fails. The only way it gets renewed is after restarting tomcat.

I have followed similar approach to refresh hadoop configuration. I am trying to access hdfs file system and i got same issue after 24hrs this issue has been fixed if i recreate the new hadoop configuration after every 2hrs and kill the old configuration. I looked for about 2 days but not able to figure out why the connection pool is taking old kerberos token even though i create a new connection pool object .
Can any one let me know what can be done to renew the phoenix connection on kerberos cluster ?

1 ACCEPTED SOLUTION

avatar
Expert Contributor

Hi @Koundinya Ravulapati,

I could think of two ways.

- Renewal of ticket via code i.e running background thread to renew ticket.

You can refer below mentioned link-

https://github.com/joshelser/phoenix-kerberos/blob/master/src/main/java/com/github/joshelser/Phoenix...

- Running kinit in cron job and using ticket from cache.

Thanks

Shubham

View solution in original post

3 REPLIES 3

avatar
Expert Contributor

Hi @Koundinya Ravulapati,

I could think of two ways.

- Renewal of ticket via code i.e running background thread to renew ticket.

You can refer below mentioned link-

https://github.com/joshelser/phoenix-kerberos/blob/master/src/main/java/com/github/joshelser/Phoenix...

- Running kinit in cron job and using ticket from cache.

Thanks

Shubham

avatar
Expert Contributor

@Koundinya Ravulapati,If above information helped you, Could you please accept answer?

avatar
New Contributor

Thanks @schhabra the solution worked for me. Thanks for the help