devstack trove

介绍

快速搭建一个trove的环境,按照trove wiki来,http://docs.openstack.org/developer/trove/dev/install.html

源代码 https://github.com/openstack/trove-integration

trove-integration使用了devstack来搭建openstack环境,另外对trove进行配置,包含trove image制作工具。

安装

系统ubuntu 14.04

简单的几步

配置网络、配置apt源;

1
2
3
vim /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin yes
1
2
3
4
5
6
7
8
vim /etc/network/interfaces
# The primary network interface
auto enp0s3
iface enp0s3 inet static
address 192.168.31.150
netmask 255.255.255.0
gateway 192.168.31.1
dns-nameserver 114.114.114.114
1
2
3
4
5
6
7
8
9
10
11
12
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo > /etc/apt/sources.list
vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

配置pip源

~/.pip/pip.conf

1
2
3
4
5
[global]
index-url = http://mirrors.aliyun.com/pypi/simple
#index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = mirrors.aliyun.com

1
2
# apt-get update
# apt-get install git-core -y
1
2
# adduser ubuntu
# visudo

添加

1
ubuntu ALL=(ALL) NOPASSWD: ALL

关于 Manila 参考https://wiki.openstack.org/wiki/Manila/ManilaDevstack
<!– cd /home git clone http://git.trystack.cn/openstack-dev/devstack.git cd devstack/tools/ ./create-stack-user.sh chown -R stack:stack /home/devstack chmod 777 /dev/pts/0 su stack cd /home/devstack vim local.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[[local|localrc]]
# Define images to be automatically downloaded during the DevStack built process.
DOWNLOAD_DEFAULT_IMAGES=False
IMAGE_URLS=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"

#change github to trystack
GIT_BASE=${GIT_BASE:-http://git.trystack.cn}
NOVNC_REPO=${NOVNC_REPO:-http://git.trystack.cn/kanaka/noVNC.git}


# Credentials
DATABASE_PASSWORD=125390
ADMIN_PASSWORD=admin
SERVICE_PASSWORD=125390
SERVICE_TOKEN=125390
RABBIT_PASSWORD=125390

#PUBLIC_INTERFACE=enp0s3

SERVICE_IP_VERSION=4

enable_plugin manila http://git.trystack.cn/openstack/manila

拷贝cirros-0.3.4-x86_64-disk.img manila-service-image-master.qcow2 get-pip.py到files下
–>
使用ubuntu用户来进行安装

1
2
3
4
# git clone http://git.trystack.cn/openstack/trove-integration
# http://git.trystack.cn/openstack-dev/devstack
$ git clone https://github.com/openstack/trove-integration.git
$ cd trove-integration/scripts/

编辑redstack.rc可以进行一些配置

打开neutron

1
2
NEUTRON_DEFAULT=true
# NEUTRON_DEFAULT=false

改改admin的密码

1
ADMIN_PASSWORD=admin

git.openstack 慢可以改成国内的

1
2
# GIT_BASE=${GIT_BASE:-git://git.openstack.org}
GIT_BASE=${GIT_BASE:-http://git.trystack.cn}

编辑localrc.rc

1
2
GIT_BASE=${GIT_BASE:-http://git.trystack.cn}
NOVNC_REPO=${NOVNC_REPO:-http://git.trystack.cn/kanaka/noVNC.git}

安装

1
$ ./redstack install

可以设置变量DEVSTACK_BRANCH来指定安装分支,stable/kilo,默认master,接下来坐等安装完成

创建一个trove mysql image

1
$ ./redstack kick-start mysql

若上传镜像失败,可以手动上传,镜像路径在~/images,参考http://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/trove-verify.html

参考

http://docs.openstack.org/developer/trove/dev/install.html
http://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/trove-verify.html
–>