User Tools

Site Tools


system_administration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
system_administration [2016/11/23 14:32] – [병렬 처리] hyjeongsystem_administration [2024/02/23 15:02] (current) – [일반적인 방법] hyjeong
Line 2: Line 2:
 CentOS 6.x 기준의 리눅스 시스템 관리 팁을 정리한다. CentOS 6.x 기준의 리눅스 시스템 관리 팁을 정리한다.
 ===== 하드웨어 정보 ===== ===== 하드웨어 정보 =====
-==== CPU ==== +==== CPU & core ==== 
-  $ cat /proc/cpuinfo (일반 정보) +  $ cat /proc/cpuinfo #일반 정보 
-  $ grep "physical id" /proc/cpuinfo | sort -u | wc -l (물리적인 CPU 수 확인) +  $ grep "physical id" /proc/cpuinfo | sort -u | wc -l #물리적인 CPU 수 확인 
-  $ grep "cpu cores" /proc/cpuinfo | tail -1 (CPU 당 물리적 코어 수) +  $ grep "cpu cores" /proc/cpuinfo | tail -1 #CPU 당 물리적 코어 수 
-  $ grep -c processor /proc/cpuinfo (CPU 코어 전체 수 확인)+  $ grep -c processor /proc/cpuinfo #CPU 코어 전체 수 확인 
 +  $ lscpu #display information about the CPU architecture
  
-맨 마지막 명령으로 출력되는 수치는 가상 코어 수이다. /proc/cpuinfo에서는 하이퍼스레딩 기술에 의해 물리적 코어의 두 배에 해당하는 가상적 코어의 수를 출력한다. 따라서 (두번째 수치)x(세번째 수치)x2의 값이 나온다.+맨 마지막 명령으로 출력되는 수치는 가상 코어 수이다. /proc/cpuinfo에서는 하이퍼스레딩 기술에 의해 물리적 코어의 두 배에 해당하는 가상적 코어의 수를 출력한다. 따라서 (두번째 수치)x(세번째 수치)를 하면 (물리적 코어의 수)보다 두 배 큰 값이 나온다.
  
 +[[http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_CPU_%EA%B0%9C%EC%88%98_%ED%99%95%EC%9D%B8|리눅스 CPU core 개수 확인]]
 +가장 간단한 방법: nproc 명령을 실행한다. 'print the number of processing units available'
 +  $ nproc
 +  32
 ==== 디스크 ==== ==== 디스크 ====
-파티션, 포맷, RAID 구성 등에는 [[https://help.gnome.org/users/palimpsest/|Palimsest]] disk utility만한 것이 없다. RAID 콘트롤러가 내 시스템에 설치되어 있는지 궁금하다면 다음과 같이 해 보라. 또는 dmesg 명령어의 출력물을 잘 뒤져보라.+파티션, 포맷, RAID 구성 등에는 [[https://help.gnome.org/users/palimpsest/|Palimpsest]] disk utility만한 것이 없다. RAID 콘트롤러가 내 시스템에 설치되어 있는지 궁금하다면 다음과 같이 해 보라. 또는 dmesg 명령어의 출력물을 잘 뒤져보라.
  
   # lspci | grep RAID   # lspci | grep RAID
Line 27: Line 32:
      
 파일 이름에 오늘 날짜를 yyyy-mm-dd로 넣고 싶으면 아카이브 명을 microbe-backup-`date +%Y-%m-%d`.tar.gz라고 지정하면 된다. 파일 이름에 오늘 날짜를 yyyy-mm-dd로 넣고 싶으면 아카이브 명을 microbe-backup-`date +%Y-%m-%d`.tar.gz라고 지정하면 된다.
 +
 +=== 디렉토리만 골라서 tar를 실행하고 원본은 지우기 ===
 +
 +  $ ls -d */ | while read f
 +  > do
 +  > tar -cf ${f}.tar --remove-files ${f}
 +  > done
 +
  
 ==== tar over ssh ==== ==== tar over ssh ====
-저장공간이 부족하다면 tar 아카이브를 만드는 동시에 다른 서버로 ssh 전송을 하면 된다. 그렇게 하려면 별로 권장할만한 일은 아니지만 전송할 서버에 root로 원격 로그인이 가능하도록 만들어야 한다. /etc/ssh/sshd_config 파일을 열어서 #PermitRootLogin no을 PermitRootLogin yes로 고친 뒤 다음과 같이 실행한다. tar 아카이브 파일을 현재의 경로에 두지 않으므로, --exclude=/microbe-backup_2016-11-22.tar.gz 옵션을 줄 필요가 없다.+저장공간이 부족하다면 tar 아카이브를 만드는 동시에 다른 서버로 ssh 전송을 하면 된다. 그렇게 하려면 별로 권장할만한 일은 아니지만 전송할 서버에 root로 원격 로그인이 가능하도록 만들어야 한다. /etc/ssh/sshd_config 파일을 열어서 #PermitRootLogin no을 PermitRootLogin yes로 고친 뒤 다음과 같이 실행한다. tar 아카이브 파일을 현재의 경로에 두지 않으므로, %%--%%exclude=/microbe-backup_2016-11-22.tar.gz 옵션을 줄 필요가 없다.
  
   # tar cvpzf - --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys / | ssh -oPort=3030 root@192.168.130.208 "cat > /work/backup/microbe-backup_2016-11-22.tar.gz"   # tar cvpzf - --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys / | ssh -oPort=3030 root@192.168.130.208 "cat > /work/backup/microbe-backup_2016-11-22.tar.gz"
Line 35: Line 48:
 좀 더 명확히 하고 싶다면 파이프(|) 기호 오른쪽에 cat 대신 dd of=/path/file_name 이라고 하면 된다. [[https://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/|참조 링크]] 좀 더 명확히 하고 싶다면 파이프(|) 기호 오른쪽에 cat 대신 dd of=/path/file_name 이라고 하면 된다. [[https://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/|참조 링크]]
  
 +또 다른 방법을 소개한다. local과 remote 간에 사용자 계정명은 같은 경우이다.
 +
 +  $ rsync -avz --delete --rsh='ssh -p2022' <source> <destination ip>:/path/to/destination
 ==== rcp, scp, rsync (over ssh) ==== ==== rcp, scp, rsync (over ssh) ====
  
Line 51: Line 67:
   * [[http://mpitutorial.com/tutorials/|MPI tutorial]]   * [[http://mpitutorial.com/tutorials/|MPI tutorial]]
   * [[http://www.mpiblast.org/|mpiBLAST]]   * [[http://www.mpiblast.org/|mpiBLAST]]
-  * [[https://www.gnu.org/software/parallel/|GNU Parallel]]+  * [[https://www.gnu.org/software/parallel/|GNU Parallel official page]] 
 +  * [[https://www.gnu.org/software/parallel/parallel_tutorial.html|GNU Parallel official tutorial]]
   * [[https://www.biostars.org/p/63816/|GNU Parallel tutorial on biostars]]   * [[https://www.biostars.org/p/63816/|GNU Parallel tutorial on biostars]]
-  * https://www.biostars.org/p/76009/+  * [[https://www.biostars.org/p/76009/|Parallele BLAST+]] 
 +  * [[http://www.shakthimaan.com/posts/2014/11/27/gnu-parallel/news.html|GNU parallel의 매우 훌륭한 예제]]
   * https://peerj.com/articles/2248.pdf - Parallel BLAST on Berkeley Open Infrastructure for Network Computing (BIONIC)   * https://peerj.com/articles/2248.pdf - Parallel BLAST on Berkeley Open Infrastructure for Network Computing (BIONIC)
  
system_administration.1479879133.txt.gz · Last modified: 2021/03/17 13:09 (external edit)