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

master 서버 1대/ slave 서버 3대 리플리케이션 구성

CPU : E5-2620 v3 @ 2.40GHz, 24core / RAM : 96GB 4대 모두 동일사양 / 디비 용량 1.1TB / 테이블 약 220개, 그중 용량 큰 테이블은 약 40개정도(개당 10~40GB)

사양은 4대 모두 동일

 

 

관리 방법 정리
1.mysqldump
장점 : 간편하다.. 가장 기본적인 방법
(디비 용량이 작다면 심플하게 table 단위로 mysqldump 백업이 가장 좋다고 본다.)

단점 : 백업 시간이 오래걸리고 복원하는데도 오래걸린다. 

약 500GB 테이블단위로 백업하는데 약 2시간 30분 걸리고 377GB로 백업됨


1-1.mysqldump후 .sql 파일을 한번더 tar로 압축하여 보관

약 20GB 짜리 덤프파일 하나를 tar -cvzf 로 압축할경우 약 2.6GB로 압축됨, 압축하는데 걸리는 시간은 8분~8분30초

약 40GB 짜리 덤프파일 하나를 tar -cvzf 로 압축할경우 약 5.7GB로 압축됨, 압축하는데 걸리는 시간은 약 25분소요
ㄴ이 파일 압축 푸는데 걸리는 시간은 약 10분인데 400기가 데이터 날리면 약 100분동안 압축 푸는시간 날리는거

 

장점 : 용량을 많이 줄일 수 있으니까(상황에 따라 다르겠지만 실 데이터에 약 8분의1정도 압축됨) 그만큼 보관 주기도 길게 잡을 수 있다.

단점 : 백업하고 복원하는데 시간 더럽게 오래 걸린다.용량 큰 디비에 이거 하나만 가지고 운영하는건 거의 도라이짓임(누가 디비를 잘못 삭제해서 장애 한번나면... 복원하는데 시간 더럽게 오래걸림)

 

 

2.xtrabackup

장점 : 속도가 빠르다. 증분백업도 된다.
단점 : 용량이 크다. 추가로 설치해야한다.(ibdata나 디렉토리등 데이터를 복사하는 방식이라 실제 데이터와 용량이 거의 같다. 즉 1TB짜리 실 데이터 백업하려면 1TB가 필요, 증분 백업이 가능하기에 어느정도 커버 가능하다본다.)

 

 

xtrabackup

500GB 백업하는데 약 2시간 40분
덤브백업하는데 
real    165m33.431s
user    77m40.210s
sys     8m34.757s

 

+ Recent posts