r11 - 22 Dec 2011 - 06:55:45 - GunmoRyuYou are here: KoreaCmsWiki >  UOS Web > SopoSystem

소포(SOPO) 소개

화일을 분산전송하여 전송속도를 높이기 위해 만든 프로그램이다.
소포라는 이름은 박인규 교수님께서 지어 주셨는데 말 그대로 우편 배달할때의 그 소포이다. smile

소포 사용 설명서 (Using Instruction)

사용자는 /home/cernsopo/outbox에 화일을 넣으면
자동으로 gate.sscc.uos.ac.kr의 /home/cernsopo/inbox에 전송된다.
SOPO는 2분씩 outbox에 있는 화일을 감지하여 하나씩 전송한다.
폴더전송은 아직 되지 않는다.

소포 설치 설명서 (Installation Instruction)

1. 전송용 계정 만들기 (Make a ID for sending)

보내는 서버와 받는 서버간의 같은이름의 전송용 계정이 필요하다.
여기서는 dd.cern.ch와 gate.sscc.uos.ac.kr에 cernsopo라고 계정을 만들었다.
계정 홈이 권한755로 돼있는지 확인한다. 700이면 다른사람이 이용못하기 때문이다.

2. 계정간 암호묻지않게 하기 (No password setting)

전송계정간 nopassword login 설정이 필요하다.
ssh-keygen 으로 설정해준다.

1) 보내는서버 계정홈에서

[dd] /home/cernsopo > ssh-keygen -t rsa  
라고 치고 나오는 질문엔 엔터친다.

2) ls -al 해보면 ~/.ssh 폴더가 생성돼 있을것이다. 안에는 id_rsa 와 id_rsa.pub 화일이 있다.

3)

[dd] /home/cernsopo/.ssh > cp id_rsa.pub authorized_keys
하여 같은내용의 authorize 화일을 만든다.

4) .ssh 폴더를 받는서버 계정홈으로 복사한다.

[dd] /home/cernsopo > scp -r .ssh 받는서버주소:~
라고 치고 엔터하고 받는서버계정 암호를 입력한다.
처음 접속하는것이면 질문하는데 yes라고 답한다.
known_hosts는 yes후 생성되는 화일이므로 복사돼도 상관없는 화일이다.

5)

[dd] /home/cernsopo > ssh 받는서버주소
하여 암호질문 없이 로그인 되는지 시험해본다.

3. 전송용 폴더 만들기 (Make a folder for sending)

다음 네 폴더를 보내는서버 계정홈과 받는서버 계정홈에 만들어준다.
inbox : 전송받는 폴더이다. 권한은 777로 준다. chmod 777 inbox
intemp : 분산전송받는 폴더이다. intemp에 받은 화일들이 합쳐져 inbox에 저장된다.
outbox : 전송보낼 폴더이다. 권한은 777로 준다. chmod 777 outbox
outtemp : 분산전송보내는 폴더이다. outbox에 있는 화일을 outtemp에서 쪼갠후 전송한다.

[kl-22] /home/keksopo > mkdir inbox intemp outbox outtemp
[kl-22] /home/keksopo > chmod 777 inbox outbox
[kl-22] /home/keksopo > 

4. SOPO화일 복사 (Install SOPO file)

보내는서버 계정홈(~)에 checkfile.shsopo.sh 파일을 복사해둔다.
실행권한인 755로 준다. 그냥은 윈도와 유닉스의 줄바꿈 차이로 실행이 안되므로 dos2unix를 써야한다.

[kl-22] /home/keksopo > wget http://www.cms-kr.org/twiki/pub/Computing/SopoSystem/checkfile.sh
--20:05:34--  http://www.cms-kr.org/twiki/pub/Computing/SopoSystem/checkfile.sh
           => `checkfile.sh'
Resolving www.cms-kr.org... 210.125.178.92
Connecting to www.cms-kr.org|210.125.178.92|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 496 [text/x-sh]

100%[====================================>] 496           --.--K/s

20:05:34 (39.42 MB/s) - `checkfile.sh' saved [496/496]

[kl-22] /home/keksopo > wget http://www.cms-kr.org/twiki/pub/Computing/SopoSystem/sopo.sh
--20:05:52--  http://www.cms-kr.org/twiki/pub/Computing/SopoSystem/sopo.sh
           => `sopo.sh'
Resolving www.cms-kr.org... 210.125.178.92
Connecting to www.cms-kr.org|210.125.178.92|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,714 (1.7K) [text/x-sh]

100%[====================================>] 1,714         --.--K/s

20:05:52 (77.84 MB/s) - `sopo.sh' saved [1714/1714]

[kl-22] /home/keksopo > dos2unix checkfile.sh sopo.sh
dos2unix: converting file checkfile.sh to UNIX format ...
dos2unix: converting file sopo.sh to UNIX format ...
[kl-22] /home/keksopo > chmod 755 checkfile.sh sopo.sh
[kl-22] /home/keksopo >
checkfile.sh는 outbox에 화일이 있는지 감지하여 sopo를 실행하는 프로그램이고 sopo.sh는 화일을 전송하는 프로그램이다.

5. SOPO 화일 설정 ( Configure SOPO file)

sopo.sh화일 내용을 보면 변수값을 고쳐 자신환경에 맞게 적용할 수 있다.
보내는서버주소, 받는서버주소 외엔 굳이 고칠것은 없다.

#
# You can edit this variables.
#

sendsite="tachyon2.ksc.re.kr"                                   : 보내는서버 주소이다.
receivesite="gate.sscc.uos.ac.kr"                               : 받는서버 주소이다. 소포를 실행하는 서버에서 받으려면 localhost 라고 적는다.
sendsitehome=`ssh $sendsite 'echo $HOME'`                  : 보내는서버의 홈폴더이다.
receivesitehome=`ssh $receivesite 'echo $HOME'`           : 받는서버의 홈폴더이다.
sendsitesplitfolder="$sendsitehome/outtemp"                  : 보내는서버에서 화일분산해서 보낼때 쓰는 폴더이다.
sendsitesendfolder="$sendsitehome/outbox"                   : 보내는서버에서 화일을 보낼때 이 폴더에 화일을 복사해 넣는다.
receivesitemergefolder="$receivesitehome/intemp"          : 받는서버에서 분산된 파일을 받는 폴더이다.
receivesitereceivefolder="$receivesitehome/inbox"           : 받는서버에서 분산전송온 화일이 합쳐져 이 폴더에 저장된다.
splitnumber=10                                                   : 화일을 쪼개는 수이다. 기본설정 10개로 쪼갠다.
splitstartbyte=104857600                                     : 이 크기 이상이면 화일을 쪼개서 전송한다. 기본설정 100MB 이다.

6. 작동시험 (Testing)

outbox에 전송시험할 화일을 복사해넣고

[dd] /home/cernsopo > ./checkfile.sh
을 실행하여 정상작동되는지 확인한다.

7. cron에 등록 (Register a cron)

2분간 체크하며 전송하도록 아래와같이 cron에 등록한다.(checktime is 2 minutes)

[dd] /home/cernsopo > crontab -e
하여 아래와 같이 입력한다.
(in crontab edit file)

0-59/2 * * * * ./checkfile.sh
[dd] /home/cernsopo > crontab -l
하여 등록내용을 확인한다.

-- YusangKim - 10 Aug 2008

-- YusangKim - 04 Nov 2011

Topic attachments
I Attachment Action Size Date Who Comment
shsh checkfile.sh manage 0.5 K 13 Aug 2008 - 15:14 YusangKim SOPO filecheck program
shsh sopo.sh manage 2.4 K 03 Nov 2011 - 14:33 YusangKim SOPO filesend program 2nd Ver.
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r11 < r10 < r9 < r8 < r7 | More topic actions
UOS.SopoSystem moved from UOS.SopoSystem on 22 Dec 2011 - 06:55 by GunmoRyu - put it back
 
KOREA-CMS
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding KoreaCmsWiki? Send feedback