갑자기 rsync로 파일 갯수에 따른 전송 시간이 궁금해졌다.


물론 파일이 많으면 눈에 띄겠지만... 궁금하다. 

(덮어씌기는 안하고 무조건 새파일로만)


테스트 1. 1GB 짜리 1개 파일 전송

receiving incremental file list

1G


sent 30 bytes  received 1073872969 bytes  102273618.95 bytes/sec

total size is 1073741824  speedup is 1.00


real    0m9.587s

user    0m7.625s

sys     0m3.158s


테스트 2. 1GB 짜리 5개 파일 전송

receiving incremental file list

1G

1G_1

1G_2

1G_3

1G_4


sent 106 bytes  received 5369364746 bytes  115470211.87 bytes/sec

total size is 5368709120  speedup is 1.00


real    0m46.234s

user    0m38.213s

sys     0m16.360s


테스트 3. 10GB 짜리 1개 파일 전송

receiving incremental file list

10G


sent 30 bytes  received 10738729034 bytes  114852717.26 bytes/sec

total size is 10737418240  speedup is 1.00


real    1m32.456s

user    1m15.784s

sys     0m32.694s


테스트 4. 1M 짜리 1024개 파일 전송

1M_999


sent 19467 bytes  received 1073920415 bytes  102279988.76 bytes/sec

total size is 1073741824  speedup is 1.00


real    0m10.040s

user    0m7.644s

sys     0m3.206s


테스트 5. 1M 짜리 10240개 파일 전송

1M_9999


sent 194571 bytes  received 10739207487 bytes  112454471.81 bytes/sec

total size is 10737418240  speedup is 1.00


real    1m34.970s

user    1m16.561s

sys     0m32.577s


하다 말았음 






smartctl -a /dev/sda

smartctl 5.43 2016-09-28 r4347 [x86_64-linux-2.6.32-754.6.3.el6.x86_64] (local build)

Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net


Vendor:               HPE     

Product:              LOGICAL VOLUME  


dmidecode | grep -A2 '^System Information' 

System Information

        Manufacturer: HPE

        Product Name: ProLiant DL380 Gen10


서버 스펙은 위와같다.




아래와같이 명령어 입력시 에러가 발생한다.

hpssacli ctrl all show config


Error: No controllers detected. Possible causes:

        - The driver for the installed controller(s) is not loaded.

        - On LINUX, the scsi_generic (sg) driver module is not loaded.

        See the README file for more details.



드라이버가 제대로 안올라가있나 ? 뭘 받아야하지..


일단 구글링결과


hp 공식 사이트에서는 

#modprobe sg

#modprobe hpsa hpsa_allow_any = 1

위에껄 하랜다.


hpssa 는 sg 라는 드라이버를 사용해서 설치된 컨트롤러 정보를 수집한다고 한다. 기본적으로 레드햇 7.0 은 sg드라이버를 로드하지만 7.1은 로드가 안된된다. 잉 근데 이서버는 6.9 인데 ?? 

일단 위에 명령어대로 했는데 안된다 역시 . 음.. 드라이버 설치가 안된건가.. 뭐지 ? hp 업체에 문의했다. 


hpssacli 를 hp repo 올려가지고 yum 으로 설치했는데 버전이 너무 낮다고 한다. 서버는 gen10인데 해당 서버에서는 안된다고한다.

설치돼있떤 hpssacli 버전은

rpm -qa | grep hpssacli

hpssacli-2.40-13.0.x86_64

이다.


https://support.hpe.com/hpsc/swd/public/detail?sp4ts.oid=null&swItemId=MTX_d5125e2bff7d4e92a1b0fcebc6&swEnvOid=4184

이거 받아가지고 설치하면 잘된다.

설치한 버전은

ssacli-3.30-14.0.x86_64.rpm

잘 된다.


ps.

gen10 부터는 hpssacli가 안먹는다함


tomcat 으로만 구동중인(톰캣만 가지고 80포트로 운영중인)서버에 ssl 인증서 적용하기

(인증서는 코모도같은 인증서발급업체에서 사가지고 csr,key파일까지 발급받은상태임)


구글링 해보면 많은곳에서 keytool 명령어를 이용하여 톰캣에 ssl인증서 적용하는방법을 많이 알려준다.

keytool이란 

Java provides a relatively simple command-line tool, called keytool, which can easily create a "self-signed" Certificate. Self-signed Certificates are simply user generated Certificates which have not been signed by a well-known CA and are, therefore, not really guaranteed to be authentic at all. While self-signed certificates can be useful for some testing scenarios, they are not suitable for any form of production use.


Java는 키툴이라고 하는 비교적 간단한 명령줄 도구를 제공하여 "자체 서명" 인증서를 쉽게 만들 수 있습니다. 자체 서명된 인증서는 단순히 사용자가 생성한 인증서이며, 잘 알려진 CA에서 서명한 것이 아니므로, 실제로 인증되지 않습니다. 자체 서명된 인증서는 일부 테스트 시나리오에 유용할 수 있지만 어떤 형태의 운영 사용에도 적합하지 않습니다.


톰캣 공홈에서 퍼옴  https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html


설명만 가지고는 comodo나 rapid 같은 신뢰할 수 있는 인증기관에서 발급해준게 아닌 개인이 생성한 인증서에 대해서만이라고 설명돼있는데 공홈 설명보면 그 뒤로 

Importing the Certificate

Now that you have your Certificate you can import it into you local keystore. First of all you have to import a so called Chain Certificate or Root Certificate into your keystore. After that you can proceed with importing your Certificate.


Download a Chain Certificate from the Certificate Authority you obtained the Certificate from.

For Verisign.com commercial certificates go to: http://www.verisign.com/support/install/intermediate.html

For Verisign.com trial certificates go to: http://www.verisign.com/support/verisign-intermediate-ca/Trial_Secure_Server_Root/index.html

For Trustcenter.de go to: http://www.trustcenter.de/certservices/cacerts/en/en.htm#server

For Thawte.com go to: http://www.thawte.com/certs/trustmap.html

Import the Chain Certificate into your keystore

keytool -import -alias root -keystore <your_keystore_filename>

    -trustcacerts -file <filename_of_the_chain_certificate>

And finally import your new Certificate

keytool -import -alias tomcat -keystore <your_keystore_filename>

    -file <your_certificate_filename>


위와같은 내용이 있는데 즉 keytool 을 이용해서도 인증기관에서 발급된 인증서로 적용할 수 있다는 내용이다. 실제로도 정말많이. 뭐 톰캣은 거의 대부분 keytool로 하고 있다.


keytool을 이용한 인증서 적용은 구글링에서 많이 나오니까 패쓰하고.


여기서는 ssl.key , ssl.crt, 와 인증업체에서 제공하는 체인인증서만 가지고(즉 keytool을 이용하지 않고) 아파치에 적용하는것처럼 톰캣에 적용할꺼다.


그럴려면 tomcat 에 apr라이브러리가 들어가있어야 하낟. 


apr이란 .... 잘 모르겠다 그냥 많은 기능이 포함된 라이브러리(https://kenu.github.io/tomcat70/docs/apr.html 여기보면 아파치 2점대 핵심 라이브러리라는데 근데 왜 아파치 컴파일할 때 apr을 추가로 컴파일해야하지?)이고 이 라이브러리가 톰캣에도 들어가 있으니까 아파치에 인증서 설정하는것마냥 톰캣에도 할 수 있다라고 이해할란다.


하 그냥 이러지말고 애초부터 keytool로 할껄 그랬다.


여튼 다시 정리하자면..


jsse 환경에서는 keytool을 이용하여 인증서를 적용

apr 환경에서는 기존 아파치에 적용하는것마냥 인증서를 적용 인데(톰캣에 apr 라이브러리를 사용한 환경이냐는거지 apr 환경이라는게 아파치-톰캣이 연동된 환경을 말하는게 아니다.)


톰캣에 apr 라이브러리 들어가있으니 위에 말한것처럼 나는 keytool 을 이용하지 않고 아파치에 설정하듯이 하겠다.


엄청 쉽다.

    <Connector  

        port="443" SSLEnabled="true" 

        scheme="https" secure="true" sslProtocol="TLS" SSLEngine="on"

        SSLPassword="비밀번호" 

        SSLCertificateKeyFile="conf/ssl/ssl.key"

        SSLCertificateFile="conf/ssl/ssl.crt"

        SSLCertificateChainFile="conf/ssl/chain_ssl.crt"

        SSLCACertificateFile="conf/ssl/chain_all_ssl.crt"

    />


적당한곳에다가 위내용 넣고 재시작하면된다고 한다.

근데 안된다. 그래서 결국 keytool로 했다. 하 진작에 keytool로 할껄 2시간 버렸네 




ps.

트래픽이 많이나오는 무거운 웹서버에서는 keytool 이용한 jsse 방식보다는 apr 방식에다가 인증서를 적용하는게 퍼포먼스와 안정성이 더 좋다라는 내용(이건 구글링)이 있는데

내 결론은 

그냥 편한거 하는게 좋은거같다. 안정성이나 뭐 퍼포먼스가 더 좋다는데...옛날에야 하드웨어가 안좋으니 뭐 커널튜닝이니 뭐니 퍼포먼스에 신경썼겠지만 요새는 하드웨어가 워낙 짱짱한데.. 인증서 적용하는데 그런거까지 신경쓸필요있을까 ? 



+ Recent posts