MoreLean

brew 를 사용하여 특정 버전을 설치하기 본문

TIP

brew 를 사용하여 특정 버전을 설치하기

judeKim' 2013. 11. 13. 22:15
반응형

카산드라의 경우 minor 버전별로 많은 차이가 있다. 


그래서 특정한 경우 버전을 골라서 선택해야 하는 경우가 발생한다


mac에서 brew를 써서 보통 설치를 하게 되는데 나같은 경우도 패스등 여러가지 설정 문제 때문에 brew와 같은 프로그램을 애용한다. 


( centos 에서는 yum, ubuntu 에서는 apt-get 을 사용하여 설정한다.. )


여기서는 카산드라 1.1.x 버전을 설치한번 해보겠다. 


1. 일단 먼저 cassandra의 패키지명을 살펴본다. 

$> brew search cassandra

cassandra

homebrew/versions/cassandra-0.6    /homebrew/versions/cassandra12


2. brew 의 formula ( /usr/local/Library/Formula ) 위치로 이동한다. 

brew는 내부적으로 git을 통해 관리하고 있다. 

$> cd /usr/local/Library/Formula


3. 이제 사용가능한 버전을 살펴본다. 

$> brew versions cassandra

require 'formula'

2.0.1    git checkout 5727297 /usr/local/Library/Formula/cassandra.rb

2.0.0    git checkout d519917 /usr/local/Library/Formula/cassandra.rb

1.2.9    git checkout 0bb5530 /usr/local/Library/Formula/cassandra.rb

1.2.8    git checkout 4effe94 /usr/local/Library/Formula/cassandra.rb

1.2.6    git checkout 0265d6d /usr/local/Library/Formula/cassandra.rb

1.2.5    git checkout 7615913 /usr/local/Library/Formula/cassandra.rb

1.2.4    git checkout 638f0e9 /usr/local/Library/Formula/cassandra.rb

1.2.3    git checkout fc0294a /usr/local/Library/Formula/cassandra.rb

1.2.2    git checkout ce8dee9 /usr/local/Library/Formula/cassandra.rb

1.2.1    git checkout f6309ce /usr/local/Library/Formula/cassandra.rb

1.2.0    git checkout 111971b /usr/local/Library/Formula/cassandra.rb

1.1.8    git checkout a95d344 /usr/local/Library/Formula/cassandra.rb

1.1.7    git checkout a69d30d /usr/local/Library/Formula/cassandra.rb

1.1.6    git checkout 5825f62 /usr/local/Library/Formula/cassandra.rb

1.1.5    git checkout 5f67e48 /usr/local/Library/Formula/cassandra.rb

4. 목록이 나왔으니 이제 선택하면 된다. 

버전옆에 나와 있는 명령어를 그냥 복사해서 실행하면 된다. 1.1.8을 선택해보자. 

$> git checkout a95d344 /usr/local/Library/Formula/cassandra.rb


5. 이제 설치해보자

$> brew install cassandra

==> Downloading http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.1.8/apache-cassandra-1.1.8-bin.tar.gz

==> Best Mirror http://apache.tt.co.kr/cassandra/1.1.8/apache-cassandra-1.1.8-bin.tar.gz


curl: (22) The requested URL returned error: 404 Not Found

Error: Download failed: http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.1.8/apache-cassandra-1.1.8-bin.tar.gz

흠.. -_-;; 이걸 원한건 아닌데 네트워크가 문제가 있나 싶어 체크해봤으나 이상무. 

그럼 일단 다른 버전 1.1.7 을 선택해보자. 

$> git checkout a69d30d /usr/local/Library/Formula/cassandra.rb

==> Downloading http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.1.7/apache-cassandra-1.1.7-bin.tar.gz

==> Best Mirror http://apache.mirror.cdnetworks.com/cassandra/1.1.7/apache-cassandra-1.1.7-bin.tar.gz


curl: (22) The requested URL returned error: 404 Not Found

Error: Download failed: http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.1.7/apache-cassandra-1.1.7-bin.tar.gz


-_-;; 뭐지? 분명 설치가 가능했었던 버전임은 분명한데, 치명적인 버그가 있어 치워버렸나?


그래서 Download 주소에서 미러를 찾는 듯 해서 해당 주소로 이동했더니, apache의 fast mirror를 찾아주는 페이지였다. 


동적인 페이지인지라 동일하게 파일은 없었다는.. 


그래서 역으로 그럼 뭐가 있는지 찾아보았다. 


보통 미러사이트는 index 페이지를 제공한다. ( 버전을 뺀 디렉토리로 접근 )


http://apache.tt.co.kr/cassandra/


리눅스를 사용한다면 자주 볼수 있던 화면이다. 


-_-;; 저것만 지원하면서 다 있는척 구라를 친것이다. ( 물론 사연이 있을 것이다. )


대충 눈치로 그럼 저 페이지를 접근해서 다운로드 받는건 아까 rb로 끝나는 파일이 처리하겠지?


라고 해서 내용을 보니 


$> vi /usr/local/Library/Formula/cassandra.rb



찾았다 요놈. 


fast mirror 를 찾기 전의 원본 주소에 버전을 1.1.12로 바꿔치기 했다. 


devel이 있지만 뭐 버전이 아예 달랐으니 체크하지 않을꺼라 예상하고, 


sha1이 있는것보니 원본파일과 다르면 문제시 삼겠군 예상했지만 뭐 일단 그냥 진행. ( 난 성격이 느리지 않다. )



엇 받아진다 했는데.. 역시 예상대로 fail


하지만 친절하게도 단순영어로 sha1 예상값을 출력해주신다. 


Expected를 Actual과 맞으면 통과 할테니 잘 복사해서 붙여 넣고



브라보~ 성공!!

잘 했으니 맥주먹으라고 친절히 맥주아이콘도.. ㅋㅋ


이상 끝. 


반응형