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/22 17:50] – [tar over ssh] 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 구성 등에는 [[https://help.gnome.org/users/palimpsest/|Palimpsest]] disk utility만한 것이 없다. RAID 콘트롤러가 내 시스템에 설치되어 있는지 궁금하다면 다음과 같이 해 보라. 또는 dmesg 명령어의 출력물을 잘 뒤져보라. 
 + 
 +  # lspci | grep RAID 
 +  81:00.0 RAID bus controller: Adaptec Series 6 - 6G SAS/PCIe 2 (rev 01) 
 +  # systool -c scsi_host -v (sysfsutils-2.x rpm 패키지 설치 필요) 
 +   
 +==== LVM ==== 
 +[[http://www.linuxjournal.com/content/lvm-demystified|LVM, demystified]] 
 ===== 백업하기 ===== ===== 백업하기 =====
 ==== 일반적인 방법 ==== ==== 일반적인 방법 ====
Line 19: 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"
      
 좀 더 명확히 하고 싶다면 파이프(|) 기호 오른쪽에 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) ====
 +
 +==== lftp ====
 +커맨드 라인 인터페이스를 갖춘 ftp 프로그램 중에서 가장 강력하다고 느끼는 것이 바로 lftp이다. 특히 lftp의 동기화 기능은 대단히 단순하지만 유용하다. 원격 컴퓨터에 SSH로 접속하여 특정 디렉토리를 그대로 미러링하고 싶다면 다음과 같이 한다.
 +
 +  $ lftp -p 3030 sftp://user@111.222.333.444
 +  Password:
 +  lftp user@111.222.333.44:~> cd target_directory
 +  lftp user@111.222.333.44:target_directory> mirror .
 +  
 +
 +
 +===== 병렬 처리 =====
 +이 항목은 독립된 페이지로 발전할 가능성이 매우 크다. 우선은 중요한 웹 링크의 기록을 남긴다.
 +  * [[http://mpitutorial.com/tutorials/|MPI tutorial]]
 +  * [[http://www.mpiblast.org/|mpiBLAST]]
 +  * [[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/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)
  
 ===== 다른 아이템 ===== ===== 다른 아이템 =====
  
  
system_administration.1479804652.txt.gz · Last modified: 2021/03/17 13:09 (external edit)