배포 전략

IT 2019. 10. 25. 18:50

Rolling

각 서버별로 한대씩 순차적으로 배포하는 방법

 

Blue Green

이전 배포된 내용을 Blue, 새로 배포할 내용을 Green 이라고 칭하고, 새로운 배포물을 배포하고, 기존의 모든 연결을 새로운 배포물로 바라보게 Routing 을 수정하는 방법.

 

Canary

새로운 배포물을 배포하고, 일부 사용자에게 노출하고, 운영에 문제없으면 전체 사용자에게 배포하는 방법.

'IT' 카테고리의 다른 글

Dictionary  (0) 2019.10.25
Posted by leechwin
,

Dictionary

IT 2019. 10. 25. 18:36

Monolithic Architecture

여러개의 서비스가 하나의 큰 프로젝트에 묶여있는 상태에서 개발하는 방식으로, 각 서비스별 간에 디펜던시가 복잡하고, 하나의 서비스가 모든 서비스에 영향을 주기때문에 장애시 전체 프로젝트가 멈출 수 있다.

또한 개발 언어가 종속적이다.

 

Microservice Architecture(MSA)

단일 어플리케이션을 작은 서비스 모음으로 나눠 개발하는 접근 방식으로, 각 서비스는 각자의 프로세스에서 실행되며 HTTP 리소스 API 같은 경량의 매커니즘을 사용해 통신한다.

이런 서비스는 비즈니스 역량을 기반으로 구축되며 완전히 자동화된 배포 머신에 의해 독립적으로 배포될 수 있다.

서비스들에 대한 최소한의 중앙 집중 관리가 필요하며 다양한 프로그래밍 언어와 다양한 데이터 스토리지 기술을 사용해 작성할 수 있다.

'IT' 카테고리의 다른 글

배포 전략  (0) 2019.10.25
Posted by leechwin
,

리눅스에 ssh 등으로 접속하다가 password 기간 만료로 새로 변경해야 되는 경우가 있다.

이때 임시로 password 를 변경하고, 다시 passwd 명령으로 변경하려면 다음과 같은 에러와 함께 변경이 안되는 경우가 있다.

(current) UNIX password: 
You must wait longer to change your password
passwd: Authentication token manipulation error

 

접속된 사용자가 passwd 명령에 대한 권한이 없는등 여러가지 문제가 있을 수 있는데,

chage 명령으로 사용자 password 등에 관련된 정보를 한번 확인해보면 문제를 파악 할 수 있는 경우가 있다.

Usage: chage [options] LOGIN

Options:
  -d, --lastday LAST_DAY        set date of last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -R, --root CHROOT_DIR         directory to chroot into
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS

 

자신의 계정 정보를 확인해본다.

chage -l leechwin
Last password change				        : 10월 10, 2019
Password expires					:  1월 08, 2020
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: 7
Maximum number of days between password change		: 90
Number of days of warning before password expires	: 7

 

계정 정보에 Minimum number of days between password change 부분이 7로 되어있는데 passwd 로 password 를 바꾼뒤에 7일뒤에 다시 passwd 로 password 를 바꿀 수 있다는 의미이다.

passwd 로 password 를 무한정 바꾸고 싶다면 다음 명령어로 해당 정보를 0 으로 설정 하면 된다.(단 root 계정으로 변경 실행해야 한다.)

# chage -d 0 leechwin

 

혹은 "/etc/shadow" 파일에 user 정보를 직접 수정가능하다.

 

Reference

Posted by leechwin
,

크롬에서 일부 도메인에 대해서 접속이 안되는 경우가 있다.

DNS 서버의 문제가 있을경우 DNS 를 변경하여 해결 할 수도 있지만, DNS 문제가 아니라면, 개인 PC 에서는 다음과 같이 실행 해본다.

  • Windows 실행창(Windows + R)을 띄우고 services.msc 실행
  • DNS Client 를 찾아서 다시 시작을 실행

'Web' 카테고리의 다른 글

[Javascript] Number 진법 변환  (0) 2021.01.31
개발 블로그 링크  (0) 2020.07.05
[Javascript] Drag&Drop 을 막고싶은 경우  (0) 2019.02.25
[Javascript] 함수 Performance 체크  (0) 2016.12.25
[Bootstrap] Input 태그의 Clear 버튼  (0) 2016.12.16
Posted by leechwin
,

리눅스에서 설정파일이나 스크립트 파일을 수정한 뒤에 재부팅을 하지않고, 수정내용을 바로 적용하려면 source 명령을 수행하면 된다.

source 명령은 bash 내부 명령으로 포함되어있다.


  • $ source <script file>


Posted by leechwin
,

리눅스에서는 로그파일을 실시간으로 확인하는 방법중에 하나로 tail 명령에 대해 알아보자.


  • Tail
    • $ tail -f <대상파일>
    • 위와 같이 실행하면 대상 파일의 마지막 10라인을 출력하며, 해당 파일에 추가되는 행을 계속 출력하여 준다.


  • 옵션
    • f: 파일의 마지막 10라인을 실시간으로 계속 해서 출력한다.
    • n: 기본 10라인이 아닌 n 만큼의 라인을 출력한다.
      • $ tail -n 20 <대상파일>


  • Help 문서

  •  Usage: tail [OPTION]... [FILE]...

     Print the last 10 lines of each FILE to standard output.

     With more than one FILE, precede each with a header giving the file name.


     With no FILE, or when FILE is -, read standard input.


     Mandatory arguments to long options are mandatory for short options too.

      -c, --bytes=[+]NUM       output the last NUM bytes; or use -c +NUM to

                                 output starting with byte NUM of each file

      -f, --follow[={name|descriptor}]

                               output appended data as the file grows;

                                 an absent option argument means 'descriptor'

      -F                       same as --follow=name --retry

      -n, --lines=[+]NUM       output the last NUM lines, instead of the last 10;

                                 or use -n +NUM to output starting with line NUM

          --max-unchanged-stats=N

                               with --follow=name, reopen a FILE which has not

                                 changed size after N (default 5) iterations

                                 to see if it has been unlinked or renamed

                                 (this is the usual case of rotated log files);

                                 with inotify, this option is rarely useful

          --pid=PID            with -f, terminate after process ID, PID dies

      -q, --quiet, --silent    never output headers giving file names

          --retry              keep trying to open a file if it is inaccessible

      -s, --sleep-interval=N   with -f, sleep for approximately N seconds

                                 (default 1.0) between iterations;

                                 with inotify and --pid=P, check process P at

                                 least once every N seconds

      -v, --verbose            always output headers giving file names

      -z, --zero-terminated    line delimiter is NUL, not newline

          --help     display this help and exit

          --version  output version information and exit



Posted by leechwin
,

리눅스에서는 파일이나 디렉토리를 연결하는 링크의 개념이 있는데, 이 링크를 'ln' 명령으로 만들 수 있다.

링크는 하드링크(hard link)와 심볼릭링크(symbolic link) 2개의 종류로 만들 수 있다.

  • 하드링크
    • 하드링크 생성
      • $ ln <source> <target>
    • 하드링크는 원본파일과 동일한 내용의 다른 파일이다.
    • 원본파일의 내용이 변경되면 하드링크된 파일의 내용도 자동으로 변경된다.
    • 디렉토리는 하드링크 할 수 없다.


  • 심볼릭링크
    • 심볼릭링크 생성
      • $ ln -s <source> <target>
    • 심볼릭링크는 기존 파일을 가리키도록 링크만 되어있는 특별한 유형의 파일로 '바로가기'와 비슷한 파일이다.
    • 디렉토리도 심볼릭링크 가능하다.
    • 심볼릭 링크가 가리키고있는 파일이 변경되거나 삭제되면, 제동작을 하지 못하고, 해당링크는 'dangling soft link' 라고 한다.

  • Help 문서

  •  Usage: ln [OPTION]... [-T] TARGET LINK_NAME   (1st form)

      or:  ln [OPTION]... TARGET                  (2nd form)

      or:  ln [OPTION]... TARGET... DIRECTORY     (3rd form)

      or:  ln [OPTION]... -t DIRECTORY TARGET...  (4th form)

     In the 1st form, create a link to TARGET with the name LINK_NAME.

     In the 2nd form, create a link to TARGET in the current directory.

     In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.

     Create hard links by default, symbolic links with --symbolic.

     By default, each destination (name of new link) should not already exist.

     When creating hard links, each TARGET must exist.  Symbolic links

     can hold arbitrary text; if later resolved, a relative link is

     interpreted in relation to its parent directory.


     Mandatory arguments to long options are mandatory for short options too.

          --backup[=CONTROL]      make a backup of each existing destination file

      -b                          like --backup but does not accept an argument

      -d, -F, --directory         allow the superuser to attempt to hard link

                                    directories (note: will probably fail due to

                                    system restrictions, even for the superuser)

      -f, --force                 remove existing destination files

      -i, --interactive           prompt whether to remove destinations

      -L, --logical               dereference TARGETs that are symbolic links

      -n, --no-dereference        treat LINK_NAME as a normal file if

                                    it is a symbolic link to a directory

      -P, --physical              make hard links directly to symbolic links

      -r, --relative              create symbolic links relative to link location

      -s, --symbolic              make symbolic links instead of hard links

      -S, --suffix=SUFFIX         override the usual backup suffix

      -t, --target-directory=DIRECTORY  specify the DIRECTORY in which to create

                                    the links

      -T, --no-target-directory   treat LINK_NAME as a normal file always

      -v, --verbose               print name of each linked file

          --help     display this help and exit

          --version  output version information and exit

     



Posted by leechwin
,

Synergy 의 client 중에 하나가 Mac 일경우, Mac 스크린락이 동작하면 Synergy Host 에서 키가 동작하지 않아 난감한 상황이 닥치곤 한다.

이때에는 Mac 에서 다음과 같은 방법으로 설정하여 Mac의 자동실행 항목으로 Synergy 를 등록하면 Mac 에 스크린락이 동작하여도 Synergy Host 의 키입력이 동작한다.


Mac 에서 자동실행 항목 등록 방법

  1. 시스템 환경설정 클릭
  2. 현재 사용자의 로그인 항목 탭 클릭
  3. 하단에 '+' 버튼 클릭
  4. 응용 프로그램에서 Synergy 항목을 선택 후 추가
  5. 로그인할때 자동으로 실행됩니다. 목록에 Synergy 가 추가되었다면, 이후 스크린락이 동작하여도 Synergy 도 정상 동작한다.


Posted by leechwin
,

특정 Dom 이나 전체 Window 에 Drag&Drop 동작을 막고 싶은경우, dragoverdrop 이벤트에 핸들러를 추가하는 방법으로 처리하는경우가 있는데, 이렇게 해도 잘 안되는 경우가 있다.

window.addEventListener('dragover', (e) => {
  e.stopPropagation();
  e.preventDefault();
}, false);

window.addEventListener('drop', (e) => {
  e.stopPropagation();
  e.preventDefault();
}, false);

이런경우에는 drag&drop 시에 drag 되는 data 를 유지하기 위해 사용되는 DataTransfer 객체값을  수정해주면 제대로 동작한다.

window.addEventListener('dragover', (e) => {
  e.stopPropagation();
  e.preventDefault();
  e.dataTransfer.effectAllowed = 'none';
  e.dataTransfer.dropEffect = 'none';
}, false);

window.addEventListener('drop', (e) => {
  e.stopPropagation();
  e.preventDefault();
  e.dataTransfer.effectAllowed = 'none';
  e.dataTransfer.dropEffect = 'none';
}, false);

위와 같이 effectAllowed 와 dropEffect 속성을 'none' 으로 수정하여 적용하면 Drag&Drop 동작이 적용되지 않는다.

  • effectAllowed
    • 드래그 효과를 제한할 수 있고, 다음과 같은 문자열 값이 사용된다.
    • none, copy, link, move, copyLink, copyMove, linkMove, all
  • dropEffect
    • 마우스를 놓았을 때 발생하는 효과

Reference


'Web' 카테고리의 다른 글

개발 블로그 링크  (0) 2020.07.05
[Chrome] DNS_PROBE_FINISHED_NXDOMAIN 오류  (0) 2019.04.09
[Javascript] 함수 Performance 체크  (0) 2016.12.25
[Bootstrap] Input 태그의 Clear 버튼  (0) 2016.12.16
[FONTAWESOME] icon 제공 라이브러리  (0) 2016.12.16
Posted by leechwin
,

특정 버전의 npm 을 설치할때에는 다음과 같이 실행한다.

  • npm i -g npm@{version}

예졔

  • $ npm i -g npm@6.4.1


Posted by leechwin
,