Page 1 of 1

Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 10:42 am
by devin.it3
I forgot to change the timezone while installing cluster, when I changed the timezones afterwards to fix the issue I'm unable to get the web server to change over to EST. It's messing up reporting that I pull, is there a way to remedy this post install? I was unable to find anyone else that made the same mistake as I was combing through the forums.

VERSION: 2.14-684a
BUILD: 180812-0902
Xeon Quad Core E3-1230v5 3.4 GHz
16 GB DDR4-2400 ECC

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 12:44 pm
by williamconley
Code: Select all
date; hwclock; ll /etc/local*; cat /etc/php5/apache2/php.ini | grep timezone; grep 'connections' /etc/my.cnf;  VARDB_pass=`awk '/VARDB_pass/{print $NF}' /etc/astguiclient.conf`; DB_SERVER=`awk '/VARDB_server/{print $NF}' /etc/astguiclient.conf`; mysql asterisk -h$DB_SERVER -u cron -p$VARDB_pass -e  "show variables like '%zone%'"; mysql asterisk -h$DB_SERVER -u cron -p$VARDB_pass -e  "select local_gmt from servers";


Post Results
Here's Mine from a sample server:
Code: Select all
Wed Aug 29 13:43:45 EDT 2018
2018-08-29 13:43:45.204670-0400
lrwxrwxrwx 1 root root 36 Aug 16 18:36 /etc/localtime -> /usr/share/zoneinfo/America/New_York
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
max_connections=2000
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| system_time_zone | EDT    |
| time_zone        | SYSTEM |
+------------------+--------+
+-----------+
| local_gmt |
+-----------+
| -5.00     |
+-----------+

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 5:21 pm
by devin.it3
My output, I'm EST but the servers are hosted in a COLO in Arizona

Code: Select all
Wed Aug 29 18:16:42 EDT 2018
2018-08-29 18:16:42.060798-0400
lrwxrwxrwx 1 root root 36 Aug 29 18:06 /etc/localtime -> /usr/share/zoneinfo/America/New_York
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/Phoenix
max_connections=2000
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| system_time_zone | EDT    |
| time_zone        | SYSTEM |
+------------------+--------+
+-----------+
| local_gmt |
+-----------+
| -5.00     |
| -5.00     |
| -5.00     |
+-----------+

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 5:32 pm
by devin.it3
The 4 other servers show as UTC and show proper timezone, only the web is stuck on Arizona

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 5:48 pm
by williamconley
The server's physical location has ZERO bearing on anything (Just an FYI).

But the PHP and MySQL must agree. Since mysql is set to system, and system is set to EDT, then the php.ini file must also have EDT. (America/New_York is EDT)

See the setting for my php.ini timezone? America/New_York

Yours: America/Phoenix

Otherwise, yours and mine match. So let's make 'em match all the way for fun. 8-)

Code: Select all
nano /etc/php5/apache2/php.ini


Change America/Phoenix to America/New_York

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 7:26 pm
by devin.it3
I like fun! lol however when I edited that file it changed it to EST but the time is now waaaaaaaay off, 4 hours ahead... I definitely missed something while editing that file. I appreciate the response Sir Conley, I'm grateful for your selfless sharing of knowledge!

Code: Select all
Thu Aug 30 00:20:39 UTC 2018
2018-08-30 00:20:39.935881+0000
lrwxrwxrwx 1 root root 36 Aug 29 22:06 /etc/localtime -> /usr/share/zoneinfo/America/New_York
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
max_connections=2000
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| system_time_zone | EDT    |
| time_zone        | SYSTEM |
+------------------+--------+
+-----------+
| local_gmt |
+-----------+
| -5.00     |
| -5.00     |
| -5.00     |
+-----------+

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 7:54 pm
by williamconley
For OS time ZONE your original response had:
Code: Select all
Wed Aug 29 18:16:42 EDT 2018

Your new response has:
Code: Select all
Thu Aug 30 00:20:39 UTC 2018

EDT has been changed to UTC

Your server must have the same time (and zone) as the php file. It used to have EDT (which was the same as America New York), but now has UTC. I think you were playing with other settings between the time you posted and the time you modified the php.ini.

Don't set your servers to UTC. Set them to the TZ of your office. (EDT or America/New_York, like it was originally, is good if that's your TZ).

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:02 pm
by devin.it3
You're correct, I went into 'yast timezone' and changed the timezone afterwards... where can I dictate between EDT and UTC? Once I changed the timezone settings it showed as UTC. Can I change back or is that also in the same file?

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:14 pm
by williamconley
In yast you should be able to choose USA and Eastern (New York). So you'd be on New York for both php.ini and system. Match.

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:19 pm
by devin.it3
Should I be unchecking hardware clock set to UTC on all of the servers? They all show as UTC after I made the timezone change after the fact.

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:32 pm
by devin.it3
In yast I set the TZ to EDT and the same in the php.ini but it's still spitting out UTC and setting me 4 hours ahead only on the web server.

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:33 pm
by williamconley
devin.it3 wrote:Should I be unchecking hardware clock set to UTC on all of the servers? They all show as UTC after I made the timezone change after the fact.

Yep. We've tried using that a few times but it always ends up having a "can't get past that" bug/problem for Vicidial servers.

As long as the HW clock knows the TZ it's in, there's really no difference in checking that box except that it seems to break a vicidial server (and a couple other types as well) for various "engineers should all be taken out behind the shed and slapped" reasons.

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:38 pm
by devin.it3
Even with that unchecked, same thing, showing up as UTC and giving me a 4 hour difference...

Code: Select all
Thu Aug 30 01:37:21 UTC 2018
2018-08-30 01:37:21.670383+0000
lrwxrwxrwx 1 root root 36 Aug 30 01:36 /etc/localtime -> /usr/share/zoneinfo/America/New_York
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
max_connections=2000
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| system_time_zone | EDT    |
| time_zone        | SYSTEM |
+------------------+--------+
+-----------+
| local_gmt |
+-----------+
| -5.00     |
| -5.00     |
| -5.00     |
+-----------+

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:50 pm
by williamconley
When's the last time you rebooted?

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 8:53 pm
by devin.it3
Right after I made the last change but perhaps I forgot, rebooting again now.

Re: Forgot to change timezone during cluster install

PostPosted: Wed Aug 29, 2018 9:10 pm
by williamconley
If you set it to America/New York, it should no longer be UTC. So ... try it again, reboot, change it to Zimbabwe and then back to New York (rebooting after each) ... something. :)

Re: Forgot to change timezone during cluster install

PostPosted: Thu Aug 30, 2018 1:25 pm
by devin.it3
williamconley wrote:If you set it to America/New York, it should no longer be UTC. So ... try it again, reboot, change it to Zimbabwe and then back to New York (rebooting after each) ... something. :)


Definitely something, thank you sir! Huge help and a time saver, I thank you for your assistance!