엔서블 특징

1.에이전트 설치 필요없음 - 이게 제일 장점인듯 호스트서버에만 엔서블 설치하면되니까
ㄴ다만 클라이언트에도 2.6 이상의 파이썬이 설치돼있어야한다. centos5 버전은 파이썬2.4 설치돼있어서 중복으로 설치해야함
2.yaml 로 저장돼있어서 많은 사람들(운영, 관리, 개발팀등)이 쉽게 알아볼 수 있음
3.대부분의 OS에 사용가능(윈도우도 가능하고 네트워크 장비들까지도 됨)
4.멱등성
5.모듈 많음
6.쉬움
7.오픈소스

 

 

엔서블 vi 탭을 띄어쓰기 2개로 변경하는법

- vi 에서 yaml 작성할때 탭으로 가능하도록 설정

$HOME/.vimrc 파일안에 아래 입력 .vimrc 파일 없으면 만들어주면 된다.
autocmd FileType yaml setlocal ai ts=2 sw=2 et

'job > ansible' 카테고리의 다른 글

ansible - 디렉토리 구조  (0) 2019.05.02
ansible- error  (0) 2019.04.26
ansible-3 playbook  (0) 2019.04.25
ansible-2 hosts(그룹), 멱등성  (0) 2019.04.22
ansible 공부  (0) 2018.10.10

yum install -y nodejs 한 다음 yum install -y npm 하면 npm 패키지 설치하면서 기존에 설치된 nodejs 패키지랑 충돌나서 npm 설치가 안됨

 

  file /usr/lib/node_modules/npm/node_modules/ini from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/init-package-json from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/lockfile from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/npm-user-validate from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/once from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/opener from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/read from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/sha from install of npm-1.3.6-5.el6.noarch conflicts with file from package nodejs-2:9.11.2-1nodesource.x86_64

 

  file /usr/lib/node_modules/npm/node_modules/retry conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/rimraf conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/semver conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/sha conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/slide conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/tar conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/uid-number conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/node_modules/which conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64
  file /usr/lib/node_modules/npm/package.json conflicts between attempted installs of npm-1.3.6-5.el6.noarch and nodejs-2:9.11.2-1nodesource.x86_64

 

이런식으로 충돌납니다. 위와같이 충돌나면 rpm -qa | grep node 해서 나온거 삭제해주고

 

npm 패키지 안에 nodejs 도 들어있으니까 nodejs 설치할필요없이 npm만 yum으로 설치해주면 됨

 

 

그다음 npm install socket.io 하면 

npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io

npm ERR! Error: CERT_UNTRUSTED
npm ERR!     at SecurePair. (tls.js:1370:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:320:10)ㄴ

 

이런식으로 에러 난다.

 

https 인증 어쩌구 저쩌구 하는데 

npm config set strict-ssl false

인증 우회 하고 다시 npm install socket.io 설치하면 

/usr/lib/node_modules/socket.io/usr/lib/node_modules/socket.io]# pwd 
/usr/lib/node_modules/
socket.io

 

 

/usr/lib/node_modules/socket.io]# ll
total 48
drwxr-xr-x 2 root root  4096 2019-04-10 09:50 lib
drwxr-xr-x 8 root root  4096 2019-04-10 09:50 node_modules
-rw-r--r-- 1 root root 18733 2019-04-10 09:50 package.json
-rw-r--r-- 1 root root 16588 1985-10-26 17:15 Readme.md

 

잘 설치됐다.

'job > linux' 카테고리의 다른 글

서버 점검..  (0) 2019.06.11
centos 5 yum error  (0) 2019.04.29
ionice  (1) 2019.04.09
strace debug  (0) 2019.02.21
php-fpm 메모리 사용률 확인하고 튜닝하기  (2) 2019.02.20

ionice란...

 

말그대로 io 우선순위 정하는거인데

 

나같은경우는 백업시 실 서비스에 영향을 주지 않게하기위해서 우선순위를 가장 마지막으로 하기 위해 ionice란 명령어를 사용한다.

 

보통 ionice -c2 -n 7 옵션으로 사용하는데

 

-n 옵션은 우선순위를 0~7 까지 지정한다. 7이 제일 꼴찌 0이 가장 우선


0 for none, 1 for realtime, 2 for best-effort, 3 for idle.

위와같이 설명 돼 있다.

 

 

0은 말그대로 none  스케쥴링을 없게끔 하는듯 하고...

1 rt(real time)는 우선순위를 지정할 순 있는데 rt가 best-effort보다 우선이다. 즉 best-effort 보다 rt가 우선순위가 더 빠르고 rt중에서도 우선순위를 정할 수 있다.

 

2 는 best-effort 로 
이것은 특정 io 우선 순위를 요구하지 않은 프로세스에 대한 효과적인 스케줄링 클래스다. 이 세분류는 0-7에서 우선 순위 논쟁을 하며, 낮은 숫자는 우선 순위가 더 높다. 동일한 최상의 작업 우선순위로 실행하는 프로그램은 라운드 로빈 방식으로 제공된다.
번역기 돌리면 위와같다. 

-n 옵션을 사용하기위해서는 -c2 로 설정해야하는듯 하다. 그래야 0~7까지 분류를 하니까

 

마지막으로 3은 idle 다른 작업이 없을때 실행한다는 뜻이다.

 

idle로 하면 아마도 디스크가 아무것도 사용이 안될때만 실행하는듯하고...

 

1(rt)은 우선순위를 높게 정할때 사용해야할듯, 너무 우선순위가 높아버리면 또 문제가 있으려나. 2(best effort)로 하고 우선순위를 0으로 정해주는게 좋을듯도 싶다.

 

나는 우선순위를 늦추는게 목적이니 2(best effort)로하고 우선순위도 7로 지정

'job > linux' 카테고리의 다른 글

centos 5 yum error  (0) 2019.04.29
nodejs npm , socket.io 설치  (0) 2019.04.10
strace debug  (0) 2019.02.21
php-fpm 메모리 사용률 확인하고 튜닝하기  (2) 2019.02.20
geoip iptables 설치  (2) 2019.02.15

+ Recent posts