본문으로 바로가기

시놀로지Nas Docker timezone 변경하기

category Programing 2020. 3. 29. 21:44
반응형

얼마전 구입한 시놀로지 Nas DS218+

여기에 DB를 구축하기 위해 오라클을 설치했다

오라클 버전은 xe-11g-r21

시놀로지NAS에 DB를 구축하기 위해서는 Docker 를 설치하고 그 위에 이미지로 설치를 하는 방식인가보다

솔직히 대충 이런거같긴한데 자세히는 모르겠다

 

DB를 구축하고나서 SQL DEVELOPER로 DB를 연결하고, 테이블을 만들고, 데이터를 입력해보니 뭔가 이상하다.

시간이 안맞아

아 뭐 리눅스 시간이 안맞나 보다 해서, Docker 의 오라클 컨테이너의 터미널을 실행해서 date 를 날려보니 시간이 안맞아!

그런데 희한한건 NAS 의 시간은 맞다.

 

먼저 해줘야 할건 바로 컨테이너의 환경변수 설정

먼저 컨테이너를 종료하고 편집에서

아래의 환경변수를 추가

변수

TZ

Asia/Seoul

그리고 나서 터미널에서

dpkg-reconfigure tzdata

 

명령어를 실행해주면 된다

하지만 여기서 문제!!!

  


  

root@wnameless-oracle-xe-11g-r21:# dpkg-reconfigure tzdata

debconf: unable to initialize frontend: Dialog

debconf: (No usable dialog-like program is installed, so the dialog based fronte

nd cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)

debconf: falling back to frontend: Readline

debconf: unable to initialize frontend: Readline

debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Ter

m::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/pe

rl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr

/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local

/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/

FrontEnd/Readline.pm line 7.)

debconf: falling back to frontend: Teletype

dpkg-query: package 'tzdata' is not installed and no information is available

Use dpkg --info (= dpkg-deb --info) to examine archive files,

and dpkg --contents (= dpkg-deb --contents) to list their contents.

/usr/sbin/dpkg-reconfigure: tzdata is not installed


dpkg-reconfigure tzdata를 쳤더니 위와같은 에러가 나온다

 

아무리 해도 안된다 ㅠㅠ

apt-get 을 해도 안된다 ㅠㅠ

 

약 한두시간 놀면서 삽질한 결과...

 

root@wnameless-oracle-xe-11g-r21:# apt-get install tzdata

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following NEW packages will be installed:

tzdata

0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.

Need to get 190 kB of archives.

After this operation, 3106 kB of additional disk space will be used.

Ign:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 tzdata all 2019

b-0ubuntu0.18.04

Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 tzdata all 201

9b-0ubuntu0.18.04

404 Not Found [IP: 91.189.88.152 80]

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata_2

019b-0ubuntu0.18.04_all.deb 404 Not Found [IP: 91.189.88.152 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-mis

sing?

 

이런 에러가 발생하면 apt를 업데이트 해줘야한다

 

root@wnameless-oracle-xe-11g-r21:/etc# apt-get -y update

생략....

더보기

    

Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease

Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]

Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]

Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]

Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages

[832 kB]

Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1155

kB]

Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1

362 kB]

Get:8 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Package

s [7904 B]

Get:9 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Package

s [35.2 kB]

Get:10 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [86

1 kB]

Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages

[11.9 kB]

Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages

[48.7 kB]

Get:13 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages

[4247 B]

                                                                                                                                            

Fetched 4569 kB in 4s (1194 kB/s)                                                                                                                          

 

Reading package lists... Done

 

자 여기까지 됐으면 다시

 

 

root@wnameless-oracle-xe-11g-r21:# apt-get install tzdata

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following NEW packages will be installed:

tzdata

0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.

Need to get 190 kB of archives.

After this operation, 3107 kB of additional disk space will be used.

Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 tzdata all 2019

c-0ubuntu0.18.04 [190 kB]

Fetched 190 kB in 2s (121 kB/s)

debconf: delaying package configuration, since apt-utils is not installed

Selecting previously unselected package tzdata.

(Reading database ... 7213 files and directories currently installed.)

Preparing to unpack .../tzdata_2019c-0ubuntu0.18.04_all.deb ...

Unpacking tzdata (2019c-0ubuntu0.18.04) ...

Setting up tzdata (2019c-0ubuntu0.18.04) ...

debconf: unable to initialize frontend: Dialog

debconf: (No usable dialog-like program is installed, so the dialog based fronte

nd cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)

debconf: falling back to frontend: Readline

debconf: unable to initialize frontend: Readline

debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Ter

m::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/pe

rl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr

/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local

/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/

FrontEnd/Readline.pm line 7.)

debconf: falling back to frontend: Teletype

 

Current default time zone: 'Asia/Seoul'

Local time is now: Sun Mar 29 21:19:21 KST 2020.

Universal Time is now: Sun Mar 29 12:19:21 UTC 2020.

Run 'dpkg-reconfigure tzdata' if you wish to change it.

 

root@wnameless-oracle-xe-11g-r21:/etc# date

Sun Mar 29 21:19:26 KST 2020

 

드디어 시간 맞추기 완료!

이후 확인해보니 DB에도 현재시간이 제대로 INSERT 된다.

아자!

반응형