2015년 3월 19일 목요일

How to install Trove(Juno) using devstack and redstack

1. Install Trove Juno version using devstack and redstack
 : overall install using devstack and use redstack to build and register guest image for trove

2. Ubuntu upgrade
2.1 change package repository
if needed, change as follows

$ sudo sed -i s/kr.archive.ubuntu.com/ftp.jaist.ac.jp/g /etc/apt/sources.list

2.2 Ubuntu upgrade
rebooting may be needed

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo shutdown -ry 0

3. proxy 환경 설정
3. configuration for proxy
If you are using proxy server,
download your proxy certificate and copy it to following directory

/usr/share/ca-certificates/extra/xxx.crt

after copying and register the certificate as follows:

$ sudo dpkg-reconfigure ca-certificates (yes, select xxx.crt)

Edit /etc/environment as follows for using proxy

$ sudo vi /etc/environment
...
http_proxy="http://a.b.c.d:8080/"
https_proxy="https://a.b.c.d:8080/"
no_proxy="localhost,127.0.0.1,127.0.0.0/8,127.0.1.1,10.0.0.0/8"

4. Install devstack
* If you have ever installed devstack, it would be better to cleanup devstack related files.

$ ./unstack.sh
$ ./clean.sh
$ sudo rm -rf /opt/stack

4.1 git, pip install/config

$ sudo apt-get install git python-pip
$ sudo vi ~/.pip/pip.conf

[global]
cert = /usr/share/ca-certificates/extra/xxx.crt

4.2 devstack download

$ git clone http://github.com/openstack-dev/devstack
$ cd ~/devstack
$ git checkout stable/juno

4.3 Edit local.conf 

[[local|localrc]]

# Credentials
DATABASE_PASSWORD=openstack
ADMIN_PASSWORD=openstack
SERVICE_PASSWORD=openstack
SERVICE_TOKEN=openstack
RABBIT_PASSWORD=openstack

# Services
ENABLED_SERVICES=rabbit,mysql,key
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
ENABLED_SERVICES+=,n-net
#ENABLED_SERVICES+=,neutron,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
#ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
ENABLED_SERVICES+=,g-api,g-reg
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
ENABLED_SERVICES+=,horizon

# Images
# Use this image when creating test instances
#IMAGE_URLS+=",http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img"
# Use this image when working with Orchestration (Heat)
#IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2"
#IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2"

# Branches
KEYSTONE_BRANCH=stable/juno
NOVA_BRANCH=stable/juno
NEUTRON_BRANCH=stable/juno
SWIFT_BRANCH=stable/juno
GLANCE_BRANCH=stable/juno
CINDER_BRANCH=stable/juno
HEAT_BRANCH=stable/juno
TROVE_BRANCH=stable/juno
HORIZON_BRANCH=stable/juno

# Swift Configuration
SWIFT_REPLICAS=1
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5

#[[post-config|$GLANCE_API_CONF]]
#[DEFAULT]
#default_store=file

# Enable Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs

4.4 Run stack.sh
$ ./stack.sh

Check whether each service is running properly using "screen -x stack"
You can access Horizon through web browser and test openstack

5. Install redstack
5.1 clone trove-integration

$ git clone https://github.com/openstack/trove-integration.git
$ cd trove-integration/scripts/

change strange passwords to "openstack" in "redstack.rc"
confirm that passwords in ~/devstck/local.conf are already same
(Do NOT run "redstack install")
$./redstack kick-start mysql

or
./redstack test-init
./redstack build-image mysql
./redstack kick-start mysql

5.2 Using postgresql
./redstack kick-start postgresql
or

./redstack build-image postgresql
./redstack kick-start postgresql

6. Trove test
Try to create DB instance using horizon or console


* Troubleshooting

1) Error occurred when redstack build-image mysql

+ mkdir -p /home/ubuntu/.gnupg
+ apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.mcS9MWYPD8 --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
gpg: requesting key CD2EFD2A from hkp server keys.gnupg.net
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error
++ check_break after-error run_in_target bash
++ echo ''
++ egrep -e '(,|^)after-error(,|$)' -q
+ trap_cleanup
+ exitval=2
+ cleanup
+ unmount_image
+ sync
+ unmount_dir /tmp/image.37GDumKD/mnt
+ local pattern=/tmp/image.37GDumKD/mnt mnts=
+ '[' -n /tmp/image.37GDumKD/mnt ']'
++ awk '{print $2}'
++ sort -r
++ grep '^/tmp/image.37GDumKD/mnt'
+ mnts='/tmp/image.37GDumKD/mnt/var/cache/apt/archives
/tmp/image.37GDumKD/mnt/tmp/in_target.d
/tmp/image.37GDumKD/mnt/tmp/ccache
/tmp/image.37GDumKD/mnt/sys
/tmp/image.37GDumKD/mnt/proc
/tmp/image.37GDumKD/mnt/dev/pts
/tmp/image.37GDumKD/mnt/dev'
+ '[' -n '/tmp/image.37GDumKD/mnt/var/cache/apt/archives
/tmp/image.37GDumKD/mnt/tmp/in_target.d
/tmp/image.37GDumKD/mnt/tmp/ccache
/tmp/image.37GDumKD/mnt/sys
/tmp/image.37GDumKD/mnt/proc
/tmp/image.37GDumKD/mnt/dev/pts
/tmp/image.37GDumKD/mnt/dev' ']'
+ sudo umount -fl /tmp/image.37GDumKD/mnt/var/cache/apt/archives /tmp/image.37GDumKD/mnt/tmp/in_target.d /tmp/image.37GDumKD/mnt/tmp/ccache /tmp/image.37GDumKD/mnt/sys /tmp/image.37GDumKD/mnt/proc /tmp/image.37GDumKD/mnt/dev/pts /tmp/image.37GDumKD/mnt/dev
+ '[' -n '' ']'
+ cleanup_dirs
+ sudo rm -rf /tmp/image.37GDumKD/built
+ sudo rm -rf /tmp/image.37GDumKD/mnt
+ sudo umount -f /tmp/image.37GDumKD /tmp/image.N9h32DDz
+ rm -rf --one-file-system /tmp/image.37GDumKD /tmp/image.N9h32DDz
+ exit 2

-> refer to following link
http://unix.stackexchange.com/questions/138517/debian-gpg-cannot-fetch-linux-kernel-key
-> It seems that hkp port 11371 is blocked.
-> Due to googling, it could be resolved using 80 port.
-> grep -R "keys.gnupg.net" ~/trove-integration/scripts and in the result files, specify 80 port
-> When retrying, following error maybe occurs, but continue to retry, finally resolved.
+ apt-key adv --keyserver hkp://keys.gnupg.net:80 --recv-keys 1C4CBDCDCD2EFD2A
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.nMgJNOMIVX --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 1C4CBDCDCD2EFD2A
gpg: requesting key CD2EFD2A from hkp server keys.gnupg.net
gpgkeys: key 1C4CBDCDCD2EFD2A not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

2) Error occurred when creating DB instance
ERROR trove.instance.models [-] An error occurred communicating with the guest: Timeout while waiting on RPC response - topic: "guestagent.8024bcd5-3192-40eb-8d60-249767338375", RPC method: "get_filesystem_stats" info: "<unknown>".

-> DB 인스턴스가 생성되는 VM 에 trove-guestagent 데몬에 에러가 발생한 경우이므로, 직접 VM 에 접속해서 아래 명령어를 실행해서 소스 레벨에서 원인 파악한다.

/usr/bin/python /home/ubuntu/trove/contrib/trove-guestagent --config-file=/etc/guest_info --config-file=/etc/trove/trove-guestagent.conf

댓글 없음:

댓글 쓰기