Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Wrong timezone in Ranger admin

Solved Go to solution

Wrong timezone in Ranger admin

Contributor

I'm running HDP 2.5 and are having problems with the timezone/dates for the audit records in ranger. The underlaying storage of the data is Solr. This is my setup/environment:

- My current timezone is UTC +2. - I log audit data to both HDFS and Solr - Audit data on HDFS shows the correct date - A query direct in Solr gives me dates in correct UTC time. - Ranger Admin interface / Audit shows the dates that is 2 hours into the future.

Example: Ranger Admin Audit date: 09/20/2016 09:36:29 AM

Solr query date: "evtTime": "2016-09-20T05:36:29.586Z"

HDFS Audit date: "evtTime":"2016-09-20 07:36:29.586"

My quess is that when Ranger reads the data from Solr, Solr converts the date to localtime (UTC +2), and then Ranger do the same conversion once more. Not the first system that have done this misstake.

Can anybody give me some help/pointer on where to look to fix this issue?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Wrong timezone in Ranger admin

Super Collaborator

I have a solution....

We had this issue, caused by this: https://issues.apache.org/jira/browse/RANGER-1249

To fix it, create a file: /etc/ranger/admin/ranger-admin-env-tz.sh

Add this:

JAVA_OPTS="$JAVA_OPTS -Duser.timezone=UTC"

Now chmod +x /etc/ranger/admin/ranger-admin-env-tz.sh

Now restart ranger admin.

I know this was asked long ago, but if this solves your problem (which it did for me), please accept the answer.

6 REPLIES 6

Re: Wrong timezone in Ranger admin

ranger admin shows time in timezone of your local machine where you have opened the ranger ui

Re: Wrong timezone in Ranger admin

Contributor

@Berry Österlund Please check https://issues.apache.org/jira/browse/RANGER-798 , the patch on this JIRA should be resolving this issue.

Re: Wrong timezone in Ranger admin

Contributor

Yes, that looks like a valid solution. But RANGER-798 should be implemented in 0.6.0, and thats what I'm running. Will investigate this further and update with my findings.

Highlighted

Re: Wrong timezone in Ranger admin

Super Collaborator

I have a solution....

We had this issue, caused by this: https://issues.apache.org/jira/browse/RANGER-1249

To fix it, create a file: /etc/ranger/admin/ranger-admin-env-tz.sh

Add this:

JAVA_OPTS="$JAVA_OPTS -Duser.timezone=UTC"

Now chmod +x /etc/ranger/admin/ranger-admin-env-tz.sh

Now restart ranger admin.

I know this was asked long ago, but if this solves your problem (which it did for me), please accept the answer.

Re: Wrong timezone in Ranger admin

Thanks, that worked! The bug still appears in Ranger-0.6 included in HDP-2.5.3.

Re: Wrong timezone in Ranger admin

This is fixed in the next maintenance version of HDP 2.5 as well as HDP 2.6 (Ranger 0.7)