2015년 5월 29일 금요일

Spark(1.2.1 -> 1.3.1) 을 위한 Mesos(0.18 -> 0.22.rc) - Upgrade

Spark 1.3.1 is designed for use with Mesos 0.21.0 and does not require any special patches of Mesos.
위 문구처럼 Spark 1.3.1 은 mesos0.21.0 에 최적화 되어 개발되어 있다.

그러나, 현 시점 mesos 0.21.0 은 bootstrap  수행시 m4 디렉토리를 인식하지 못한다는 메시지의 에러가 발생한다.

autoreconf: configure.ac: adding subdirectory 3rdparty/stout to autoreconf
autoreconf: Entering directory `3rdparty/stout'
aclocal: couldn't open directory `m4': No such file or directory
autoreconf: aclocal failed with exit status: 1

그리고, bootstrap 관련 스크립트의 에러 발생 부분 위치를 찾아 어거지로 해당 디렉토리를 인식하도록 fix  하고 수행을 한다 손 치더라도, 뒤이어 configure 를 돌릴때, gcc 버전을 아래처럼 더 올려서 수행하라는 메시지를 만나게 된다.

checking dependency style of gcc... (cached) gcc3
checking if compiling with clang... no
configure: GCC version: 4.4.7
configure: error: GCC 4.8 or higher is required for compiling Mesos

관련한 에러 메시지는 0.22.0 최신 버전을 수행하여도 동일하게 발생한다. 좀 이상한 것은 정상 설치 되던 0.18.0을 과거 설치하기 위해 다운받은 버전으로 다시 설치해도 예전에는 에러가 발생않던게 이번에는 에러가 난다는 점.

여기서 0.22.0을 설치하기 위해 yum 으로 dependency 모듈을 다운 받고 일부 dependency 걸린 모듈을 upgrade 하였는데, 그 dependency 로 인한 에러일것 같다는 유추가 가능하다. (더구나, 에러가 bootstrap 쪽인지라)

최근 버그 리포트와 빌드 노트를 확인해 보았더니, 최근에 패치가 된 bootstrap  파일 자체와 configure.ac 파일에서 gcc 관련 버그로 인한 패치가 있었는데, 본 에러와 관련된 패치 인것으로 여겨 진다. 여하튼 그 에러 때문에, 0.21.0 stable 버전을 포기하고, 최근 패치가 반영된 0.22.1-rc 버전을 다운받아 설치 하였다. 아울러 위 GCC 버전오류 때문에 GCC 도 업그레이드 해주었다.
  1. Mesos 0.22.1-rc 다운로드 및 기본 설치
    1. git clone https://github.com/apache/mesos.git
    2. cd mesos
    3. root 계정으로 vi /etc/yum.repos.d/wandisco-svn.repo
    4. [WandiscoSVN] name=Wandisco SVN Repo baseurl=http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/$basearch/ enabled=1 gpgcheck=0
    5. yum groupinstall -y "Development Tools"
    6. yum install -y python-devel zlib-devel libcrul-devel openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-util-devel
    7. maven 설치 ( 설치 안된 경우 만...)
    8. wget http://mirror.nexcess.net/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
      tar -xvzf apache-maven-3.0.5-bin.tar.gz
      sudo ln -s /data01/maven/apache-maven-3.0.5/bin/mvn /usr/bin/mvn
  2. GCC 버전 업
    1. wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
    2. yum remove gcc
    3. yum --enablerepo=testing-devtools-2-centos-6 install -y devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-gfortran gcc gcc-c++
    4. scl enable devtoolset-2 bash
    5. gcc -v  버전이 바뀌었는지 확인.
    6. g++ -v 버전이 바뀌었는지 확인. ( 보통 요거는 안바뀌어 있음. )
    7. yum whatprovides "*/g++"    => 지울목록과 설치할 목록 확인
      yum remove gcc-c++-4.4.7-11.el6.x86_64
      yum install devtoolset-2-gcc-c++-4.8.2-15.el6.x86_64
      yum whatprovides "*/g++"    =>  설치 여부 확인
      cd /usr/bin/
      ln -s /opt/rh/devtoolset-2/root/usr/bin/g++ g++
    8. g++ -v 버전이 바뀌었는지 확인. ( 이제 요거도 바뀜. )
  3. Host 정보 수정
    1. 처음 설치된 깨끗한 장비인 경우 만 해당.
    2. 요작업을 해주지 않으면 make check 과정에서 에러 중단 됨.
    3. vi /etc/hosts vi /etc/sysconfig/network hostname 호스트명
  4. Mesos 빌드
    1. cd /data01/mesos/mesos-0.22.1-rc/
    2. ./bootstrap
    3. mkdir build cd build ../configure
    4. make -j 16 ( <- core 갯수를 써주면, core 갯수만큼 병렬 수행한다... )
    5. make check ( <- 이 과정에 약간 에러가 보이는데, 소스를 까보면 Test Script 상의 문제이다. 아직 Nightly Build 버전인지라 make Check 용 스크립트가 최신 버전으로 마이그레이션이 덜 된 것으로 보인다.) 
    6. make install
여기 까지 하면 우선 Spark 1.3.1을 위한 Mesos 업그레이드는 마무리 된다.