Pivotal Knowledge Base

Follow

HowTo - Change the timezone on DCA

Goal

The below guide provides you step by step procedure on how to change the timezone of the DCA through DCA_SETUP and also to how this can be done manually.

Solution

Below are the steps on how to change the timezone in DCA using dca_setup and manually.

DCA_SETUP

-- Connect to the master server as root.

-- Check the current time

[root@mdw ~]# date
Sat May 17 19:38:55 JST 2014

-- Run dca_setup

[root@mdw ~]# dca_setup

  ____    ____     _      ____         _                 
 |  _ \  / ___|   / \    / ___|   ___ | |_  _   _  _ __  
 | | | || |      / _ \   \___ \  / _ \| __|| | | || '_ \ 
 | |_| || |___  / ___ \   ___) ||  __/| |_ | |_| || |_) |
 |____/  \____|/_/   \_\ |____/  \___| \__| \__,_|| .__/ 
                                                  |_|    

*******************************************************************************
Main Menu (Press Ctrl-C to exit)

 1) Install DCA  -- DEFAULT
 2) Modify DCA Settings 
  • Select option 2: to modify the DCA settings.
select [1]: 2
*******************************************************************************
DCA Settings Menu

 1) Regenerate DCA Config files 
 2) Change DCA Locale 
 3) Change DCA Timezone 
 4) Clocks Configuration 
 5) Regenerate SSH Keys 
 6) Change machine passwords 
 7) Initialize GPDB 
 8) Initialize GPDB Standby Master 
 9) Expand DCA 
10) Rebalance Mirrors 
11) DB Watcher 
12) Networking: Masters 
13) Networking: Segments 
14) Networking: Switches 
15) Hadoop 
16) Light bars 
17) Bios/Firmware/OMSA 
18) RAID controller battery 
19) Configure Security Settings 
20) Health Monitoring 
  • Select Option 3: to change DCA timezone.
select: 3
*******************************************************************************
Timezone Selection

 1) Other  -- DEFAULT
 2) America/Buenos_Aires 
 3) America/Chicago 
 4) America/Denver 
 5) America/Edmonton 
 6) America/Los_Angeles 
 7) America/Mexico_City 
 8) America/Montreal 
 9) America/New_York 
10) America/Sao_Paulo 
11) America/Vancouver 
12) Asia/Bangkok 
13) Asia/Calcutta 
14) Asia/Dubai 
15) Asia/Hong_Kong 
16) Asia/Jakarta 
17) Asia/Kuala_Lumpur 
18) Asia/Riyadh 
19) Asia/Seoul 
20) Asia/Shanghai 
21) Asia/Singapore 
22) Asia/Taipei 
23) Asia/Tel_Aviv 
24) Asia/Tokyo 
25) Australia/Sydney 
26) Europe/Berlin 
27) Europe/Copenhagen 
28) Europe/Dublin 
29) Europe/Helsinki 
30) Europe/Istanbul 
31) Europe/London 
32) Europe/Moscow 
33) Europe/Oslo 
34) Europe/Paris 
35) Europe/Rome 
36) Europe/Stockholm 
37) Europe/Zurich 

-- select the preferred timezone from the provided list , For eg.s to change to America/NewYork timezone you can choose 9 and then the DCA_SETUP will do the rest of the steps.

New Timezone (enter number) [1]: 9
*******************************************************************************
The following is the configuration for the cluster:
# of segment hosts       :     8
# of dia hosts           :     0
# of hadoop master hosts :     0
# of hadoop worker hosts :     0
# of hbase worker hosts  :     0
# of racks               :     1
gpdb port                :  5432
san configuration        :    No

The following actions will be performed:
001) set DCA timezone to America/New_York

Enter yes to continue or no to exit this application: (Yy|Nn): y
*******************************************************************************
Testing connectivity as root
Connectivity test includes the following host types: mdws sdws
connectivity is good.
*******************************************************************************
Set DCA timezone
*******************************************************************************
SUCCESS -- DONE

-- cross verification show the new timezone.

[root@mdw ~]# date
Sat May 17 06:50:36 EDT 2014

-- The same is reflected on all the segments

[root@mdw ~]# gpssh -f /home/gpadmin/gpconfigs/hostfile
=> date
[sdw4] Sat May 17 06:50:43 EDT 2014
[sdw5] Sat May 17 06:50:43 EDT 2014
[sdw6] Sat May 17 06:50:43 EDT 2014
[sdw7] Sat May 17 06:50:43 EDT 2014
[sdw1] Sat May 17 06:50:43 EDT 2014
[sdw2] Sat May 17 06:50:43 EDT 2014
[sdw3] Sat May 17 06:50:43 EDT 2014
[smdw] Sat May 17 06:50:54 EDT 2014
[sdw8] Sat May 17 06:50:43 EDT 2014
[ mdw] Sat May 17 06:50:43 EDT 2014
=> 

Manual Timezone Change

-- Have a look at the location "/usr/share/zoneinfo" for all the timezone files.

-- The current time

[root@mdw ~]# date
Sat May 17 06:39:43 EDT 2014

-- The localtime is now pointing to

[root@mdw ~]#  ls -lrth /etc/localtime
lrwxrwxrwx 1 root root 36 May 17 06:39 /etc/localtime -> /usr/share/zoneinfo/America/New_York

-- Removing the link and cross verifying.

[root@mdw ~]# rm /etc/localtime
[root@mdw ~]#  ls -lrth /etc/localtime
ls: /etc/localtime: No such file or directory

-- Recreate the link with the timezone of your choice.

[root@mdw ~]#  ln -s /usr/share/zoneinfo/America/Fortaleza /etc/localtime
[root@mdw ~]#  ls -lrth /etc/localtime
lrwxrwxrwx 1 root root 37 May 17 07:42 /etc/localtime -> /usr/share/zoneinfo/America/Fortaleza

-- The time now reflects

[root@mdw ~]# date
Sat May 17 07:42:22 BRT 2014

-- Make the same modifications on the rest of the segments that are part of the cluster.

Please NOTE

-- If you have database was running during the time of change , then you would need to bounce the database to reflect the new timezone in the database.

-- If after the timezone your "date" command doesn't reflect the new change, then you might be encountering the issue as mentioned in the article here

Comments

Powered by Zendesk