CloudGarage의 RancherOS에서 ntp 다시 쓰기

소개



어드벤트 캘린더입니다.

Ubuntu에 대해 쓸 예정이었지만 공식 씨가 내는 것이 좋다고 생각했기 때문에 (준비하고있는 것 같다) 때문에 RancherOS에서 ntp를 다시 쓰는 방법에 대해 씁니다.

(오늘은 12/25 일입니다.이 기사는 12/09 분입니다. 연말에 바쁘고 쓸 시간이 없었습니다 ... 미안 해요.)

인스턴스 시작





cloud-config.yml

#cloud-config

hostname: ros002.cg.homesoc.io

write_files:
  - container: ntp
    path: /etc/ntp.conf
    permissions: "0644"
    owner: root:root
    content: |
      statsdir /var/log/ntpstats/
      statistics loopstats peerstats clockstats
      filegen loopstats file loopstats type day enable
      filegen peerstats file peerstats type day enable
      filegen clockstats file clockstats type day enable

      tinker panic 0
      # Common pool
      pool ntp.nict.jp burst iburst

      # - Allow only time queries, at a limited rate.
      # - Allow all local queries (IPv4, IPv6)
      restrict -4 default kod notrap nomodify nopeer noquery limited
      restrict -6 default kod notrap nomodify nopeer noquery limited
      restrict 127.0.0.1
      restrict ::1
      restrict source notrap nomodify noquery

rancher:
  console: ubuntu
  services:
    console:
      environment:
        TZ: 'JST-9'
    syslog:
      environment:
        TZ: 'JST-9'
ssh_authorized_keys:
  - ssh-rsa AAAA

설치


-i 에서 RancherOS 버전을 사용하고 있습니다.
$ sudo ros install -c cloud-config.yml -d /dev/vda -i rancher/os:v1.1.0   
> INFO[0000] No install type specified...defaulting to generic 
Installing from rancher/os:v1.1.0
Continue [y/N]: y
> INFO[0422] start !isoinstallerloaded                    
> INFO[0422] trying to load /bootiso/rancheros/installer.tar.gz 
404361ced64e: Loading layer 4.221 MB/4.221 MB
4361304d3da7: Loading layer 14.97 MB/14.97 MB
09ba8a5cee0e: Loading layer 4.608 kB/4.608 kB
e5afbc3cfca1: Loading layer 18.08 MB/18.08 MB
a18e5c9a9926: Loading layer 1.636 MB/1.636 MB
ee1a08a7474f: Loading layer 1.536 kB/1.536 kB
c692731ace1c: Loading layer  2.56 kB/2.56 kB
2102ea1d03a0: Loading layer 3.072 kB/3.072 kB
> INFO[0425] Loaded images from /bootiso/rancheros/installer.tar.gz 
> INFO[0425] starting installer container for rancher/os:v1.1.0 (new) 
Unable to find image 'rancher/os:v1.1.0' locally
v1.1.0: Pulling from rancher/os
88286f41530e: Pull complete 
7a7b4049d35a: Pull complete 
6d0f27679d20: Pull complete 
7c7c05c276b7: Pull complete 
975d860f1c0a: Pull complete 
42b26e4cc3f1: Pull complete 
840171e25f6d: Pull complete 
ac39a7aecb22: Pull complete 
8fe7acd95ac8: Pull complete 
f53ce665ee5b: Pull complete 
Digest: sha256:582d9d7f22e72e8ea2edc8f4439fbfefb06906d2c80bd95b6d42bc19b20431bf
Status: Downloaded newer image for rancher/os:v1.1.0
Installing from rancher/os:v1.1.0
mount: /dev/sr0 is write-protected, mounting read-only
mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 13106688 4k blocks and 13107200 inodes
Filesystem UUID: 72c87223-8df4-40c2-99cd-d65cbede6006
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done   

Continue with reboot [y/N]: y
> INFO[0504] Rebooting  


ntp 설정을 확인해보십시오.



bash
$ sudo apt-get update; sudo apt-get install ntp
$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 ntp.nict.jp     .POOL.          16 p    -   64    0    0.000    0.000   0.000
*ntp-b2.nict.go. .NICT.           1 u   56   64    7    2.680    2.974   2.671
+ntp-a3.nict.go. .NICT.           1 u   51   64    7    2.225    3.107   2.759
+ntp-a2.nict.go. .NICT.           1 u   52   64    7    2.219    3.158   2.808
+ntp-b3.nict.go. .NICT.           1 u   55   64    7    2.673    2.929   2.564


NICT입니다.

좋은 웹페이지 즐겨찾기