Skip to main content
oliver
Silver ⭐️⭐️⭐️
May 31, 2017
Solved

Resolving Apache NiFi Time Offset Issues Caused by Daylight Saving Time Changes

I'm in the America/New_York timezone and my servers run ntp, and they show the right time. The header of NiFi running on those servers is off by one hour, eg system time says 11:00 and NiFi says 10:00. This question is very similar to

https://community.hortonworks.com/questions/76724/change-timezone-in-nifi.html

but I've tried that solution and no joy. This feels like a daylight savings problem, as the gui says 10:00:00 EST, and really that should be EDT since at time of writing it is summer.

I'm using Oracle Java 1.8.0_71.

Any ideas?

MattWho
MattWhoAnswer
Titanium ⭐️⭐️⭐️
May 31, 2017

@Oliver Meyn

In NiFi cluster, the time that is displayed could come form anyone of the connected nodes. It is important to use NTP on every node in your NiFi cluster to make sure that time stays in sync.

As far as timezone differences go, Make sure the symlink for /etc/localtime is pointing at the same /usr/share/timezone/... file on every one of you nIfi nodes.

Run the "date --utc" command on all your nodes and compare it to both of the following commands:

zdump /usr/share/zoneinfo/EST

zdump /usr/share/zoneinfo/US/Eastern

If you are looking for EDT time you need to make sure that the symlink for /etc/localtime is point to the following on all yoru nodes:

lrwxrwxrwx. 1 root root 25 Dec 1 2014 localtime -> ../usr/share/zoneinfo/US/Eastern

Thanks,

Matt

6 replies

MattWho
Titanium ⭐️⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️⭐️
May 31, 2017

@Oliver Meyn

In NiFi cluster, the time that is displayed could come form anyone of the connected nodes. It is important to use NTP on every node in your NiFi cluster to make sure that time stays in sync.

As far as timezone differences go, Make sure the symlink for /etc/localtime is pointing at the same /usr/share/timezone/... file on every one of you nIfi nodes.

Run the "date --utc" command on all your nodes and compare it to both of the following commands:

zdump /usr/share/zoneinfo/EST

zdump /usr/share/zoneinfo/US/Eastern

If you are looking for EDT time you need to make sure that the symlink for /etc/localtime is point to the following on all yoru nodes:

lrwxrwxrwx. 1 root root 25 Dec 1 2014 localtime -> ../usr/share/zoneinfo/US/Eastern

Thanks,

Matt

Translate
oliver
oliverAuthor
Silver ⭐️⭐️⭐️
June 1, 2017

@Matt Clarke thanks, but I am running ntp on all machines, my /etc/localtime all point to the same place (in my case /usr/share/zoneinfo/America/Toronto), and, crucially, the date command on each system returns the same thing, which reports back as EDT, eg:

Wed May 31 13:21:29 EDT 2017

I don't think the problem lies with my servers...

Translate
MattWho
Titanium ⭐️⭐️⭐️
Titanium ⭐️⭐️⭐️
June 1, 2017

@Oliver Meyn

You have run in to the following bug:

https://issues.apache.org/jira/browse/NIFI-3664

The good news is that the fix for this bug is part of HDF 2.1.3.

Thank you,

Matt

Translate
oliver
oliverAuthor
Silver ⭐️⭐️⭐️
June 1, 2017

I should have added - this is HDF 2.1.2 so NiFi 1.1.0

Translate