CB-Tumblebug (Multi-Cloud Infra Service Management)
Proof of Concepts for the Cloud-Barista Multi-Cloud Project.
[목차]
- 실행 환경
- 실행 방법
- 소스 기반 설치 & 실행 상세 정보
[실행 환경]
- Linux (검증시험: Ubuntu 18.04)
[실행 방법]
(1) 컨테이너 기반 실행
# docker run -p 1323:1323 \
-v /root/go/src/github.com/cloud-barista/cb-tumblebug/meta_db:/app/meta_db \
--name cb-tumblebug \
cloudbaristaorg/cb-tumblebug:v0.1-yyyymmdd
(2) 소스 기반 실행
- Go 설치 & Git 설치
- 환경 변수 설정
- CB-Tumblebug 소스 다운로드 (Git clone CB-Tumblebug)
- 의존 라이브러리 다운로드
- Cloud-Barista alliance 설치 (CB-Store, CB-Log, CB-Spider)
- 기타 라이브러리
- CB-Tumblebug 빌드 (make)
- CB-Tumblebug 실행 (make run)
(3) Cloud-Barista 시스템 통합 실행 참고 (Docker-Compose 기반)
# git clone https://github.com/jihoon-seo/cb-deployer.git
# cd cb-deployer
# docker-compose up
[소스 기반 설치 & 실행 상세 정보]
-
Git 설치
# apt update
# apt install git
-
Go 설치
- https://golang.org/doc/install (2019년 11월 현재
apt install golang
으로 설치하면 1.10 설치됨. 이 링크에서 1.12 이상 버전으로 설치할 것)
wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.13.4.linux-amd64.tar.gz
.bashrc
파일 하단에 다음을 추가:
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
-
.bashrc
에 기재한 내용을 적용하기 위해, 다음 중 하나를 수행
- bash 재기동
source ~/.bashrc
. ~/.bashrc
-
CB-Tumblebug 소스 다운로드
# go get -u -v github.com/cloud-barista/cb-tumblebug
-
의존 라이브러리 다운로드
# apt install etcd-server
# etcd --version
# ETCD_IP=<ETCD-Host-IPAddress>
# etcd --name etcd-01 --initial-advertise-peer-urls http://$ETCD_IP:2380 --listen-peer-urls http://$ETCD_IP:2380 --listen-client-urls http://$ETCD_IP:2379,http://127.0.0.1:2379 --advertise-client-urls http://$ETCD_IP:2379 --initial-cluster-token "etcd-cluster-1" --initial-cluster etcd-01=http://$ETCD_IP:2380 --initial-cluster-state new &
-
Cloud-Barista alliance 설치 (CB-Log)
-
Cloud-Barista alliance 설치 (CB-Store)
-
Cloud-Barista alliance 설치 (CB-Spider)
-
CB-Tumblebug 실행에 필요한 환경변수 설정
source setup.env
(cb-tumblebug/conf 에 setup.env)
- cb-tumblebug/conf 에 store_conf.yaml 내용 확인 및 설정 (CB-Store 설정)
- storetype 지정 (NUTSDB 또는 ETCD 지정)
- NUTSDB(local DB) 설정시 DB 데이터가 포함된 주소 지정이 필요 (기본은 cb-tumblebug/meta_db/dat 에 파일로 추가됨)
- cb-tumblebug/conf 에 log_conf.yaml 내용 확인 및 설정 (CB-Log 설정)
CB-Tumblebug 빌드
# cd ~/go/src/github.com/cloud-barista/cb-tumblebug/src
# ./make
- 패키지 관련 오류 발생 시,
go get
명령을 통해 부족한 패키지를 추가
CB-Tumblebug 실행
- 만약 AWS 관련 작업 시 에러가 발생하면 다음을 실행
# sudo apt-get --yes install ntpdate
# sudo ntpdate 0.amazon.pool.ntp.org
- 만약
“panic: /debug/requests is already registered. You may have two independent copies of golang.org/x/net/trace in your binary, trying to maintain separate state. This may involve a vendored copy of golang.org/x/net/trace.”
에러가 발생하면 다음을 실행 (CB-Tumblebug rebuild 가 필요할 수도 있음)
# rm -rf $GOPATH/src/go.etcd.io/etcd/vendor/golang.org/x/net/trace
# ./make run
(또는 # go run mcism.go
)
- CB-Tumblebug API server가 실행됨
CB-Tumblebug 테스트 방법
- CB-Tumblebug 의 REST API를 사용하여 테스트