OpenStack G版本 Ubuntu 13.04三节点实验记录

Openstack G版本 Ubuntu13.04三节点实验记录

1.准备阶段

特别提醒:
本篇文档参考了官网文档(),github(https://github.com/mseknibilel/OpenStack-Grizzly-Install-Guide/blob/OVS_MultiNode/OpenStack_Grizzly_Install_Guide.rst),longgeek配置文档(  ),还有请教了openstack群不少大侠,再此一一谢过! 

所需设备:

物理机一台8G内存,windows2003sp2操作系统,workstation9ubuntu13.0464位)镜像

网络设置:

Control node:eth0(10.10.10.51),eth1(172.16.10.200)

Network node:eth0(10.10.10.52),eth1(10.20.20.52),eth2(172.16.10.201)

Computenode:eth0(10.10.10.55),eth1(10.10.20.55)

外部网络:172.16.10.0/24(上网业务技外界登陆openstack

管理网络:10.10.10.0/24(三节点之间通信比如:keystone)认证,rabbitmq消息队列

业务网络:10.20.20.0/24(网络节点和计算节点中虚拟机数据通信比如:dpcp,l2,l3

拓扑图:

Openstack G版本 Ubuntu 13.04三节点实验记录

注意:由于用虚拟机测试,每个虚拟机2G内存,我的外部网络用桥接网段,管理和业务网络分别用vmnet2vmnet3,另外由于计算节点没有外部地址不能下载软件包,可以增加一个nat网络,安装完毕后可删除,还有其他办法比如官网文档把计算节点的网关设置成网络节点的ip,网络节点nat代理计算节点上网,这些都不影响实验结果。

安装步骤:

2Control node

2.1 准备ubuntu

添加grizzly

apt-get install -y ubuntu-cloud-keyring

echo deb precise-updates/grizzly main>> /etc/apt/sources.list.d/grizzly.list

更新系统

apt-get update -y

apt-get upgrade -y

apt-get dist-upgrade –y

2.2网络配置

#cat /etc/network/interfaces

auto eth0

iface eth0 inet static

address 10.10.10.51

netmask 255.255.255.0

Restart the networking service:

auto eth1

iface eth1 inet static

address 172.16.10.200

netmask 255.255.255.0

gateway 172.16.10.254

dns-nameservers 172.16.10.5

重启网络服务

service networking restart

2.3安装 MySQL

安装 MySQL:

apt-get install -y mysql-serverPython-mysqldb

配置myasl接受所有请求

sed -i 's/127.0.0.1/0.0.0.0/g'/etc/mysql/my.cnf

service mysql restart

创建数据库

mysql -u root -p

#Keystone

CREATE DATABASE keystone;

GRANT ALL ON keystone.* TO 'keystone'@'%'IDENTIFIED BY 'keystone';

#Glance

CREATE DATABASE glance;

GRANT ALL ON glance.* TO 'glance'@'%'IDENTIFIED BY 'glance';

#Quantum

CREATE DATABASE quantum;

GRANT ALL ON quantum.* TO 'quantum'@'%'IDENTIFIED BY 'quantum';

#Nova

CREATE DATABASE nova;

GRANT ALL ON nova.* TO 'nova'@'%'IDENTIFIED BY 'nova';

#Cinder

CREATE DATABASE cinder;

GRANT ALL ON cinder.* TO 'cinder'@'%'IDENTIFIED BY 'cinder';

quit;

2.4 RabbitMQ

Install RabbitMQ:

apt-get install -y rabbitmq-server

Install NTP service:

apt-get install -y ntp

2.5. Others

Install other services:

apt-get install -y vlan bridge-utils

Enable IP_Forwarding:

sed -i's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf

# To save you from rebooting, perform thefollowing

sysctl net.ipv4.ip_forward=1

#sysct l –p使其立即生效

2.6 Keystone

安装keystone

#apt-get install –y keystone

修改 /etc/keystone/keystone.conf 数据库配置

connection =mysql://keystoneUser:keystone@10.10.10.51/keystone

重启keystone服务器,同步数据库

service keystone restart

keystone-manage db_sync

用脚本填充数据库,可以从网上下载,根据自己的情况需要改IP地址Password,脚本的作用是新建租户,用户,服务侦听端口等,下载地址如下:

wget https://raw.github.com/mseknibilel/OpenStack-Grizzly-Install-Guide/OVS_MultiNode/KeystoneScripts/keystone_basic.sh

wget https://raw.github.com/mseknibilel/OpenStack-Grizzly-Install-Guide/OVS_MultiNode/KeystoneScripts/keystone_endpoints_basic.sh

脚本内容如下:

root@control:~# catkeystone_endpoints_basic.sh

#!/bin/sh

#

# Keystone basic Endpoints

# Mainly inspired byhttps://github.com/openstack/keystone/blob/master/tools/sample_data.sh

# Modified by Bilel Msekni / InstitutTelecom

#

# Support: openstack@lists.launchpad.net

# License: Apache Software License (ASL)2.0

#

# Host address

HOST_IP=10.10.10.51

EXT_HOST_IP=172.16.10.200

# MySQL definitions

MYSQL_USER=keystone

MYSQL_DATABASE=keystone

MYSQL_HOST=$HOST_IP

MYSQL_PASSWORD=keystone

# Keystone definitions

KEYSTONE_REGION=RegionOne

export SERVICE_TOKEN=ADMIN

export SERVICE_ENDPOINT="http://${HOST_IP}:35357/v2.0"

while getopts"u:D:p:m:K:R:E:T:vh" opt; do

case $opt in

u)

MYSQL_USER=$OPTARG

;;

D)

MYSQL_DATABASE=$OPTARG

;;

p)

MYSQL_PASSWORD=$OPTARG

;;

m)

MYSQL_HOST=$OPTARG

;;

K)

MASTER=$OPTARG

;;

R)

KEYSTONE_REGION=$OPTARG

;;

E)

export SERVICE_ENDPOINT=$OPTARG

;;

T)

export SERVICE_TOKEN=$OPTARG

;;

v)

set -x

;;

h)

cat <<EOF

Usage: $0 [-m mysql_hostname] [-umysql_username] [-D mysql_database] [-p mysql_password]

[-K keystone_master ] [ -R keystone_region ] [ -E keystone_endpoint_url]

[ -T keystone_token ]

Add -v for verbose mode, -h to display thismessage.

EOF

exit 0

;;

\?)

echo "Unknown option -$OPTARG" >&2

exit 1

;;

:)

echo "Option -$OPTARG requires an argument" >&2

exit 1

;;

esac

done

if [ -z "$KEYSTONE_REGION" ];then

echo "Keystone region not set. Please set with -R option or setKEYSTONE_REGION variable." >&2

missing_args="true"

fi

if [ -z "$SERVICE_TOKEN" ]; then

echo "Keystone service token not set. Please set with -T option orset SERVICE_TOKEN variable." >&2

missing_args="true"

fi

if [ -z "$SERVICE_ENDPOINT" ];then

echo "Keystone service endpoint not set. Please set with -E optionor set SERVICE_ENDPOINT variable." >&2

missing_args="true"

fi

if [ -z "$MYSQL_PASSWORD" ]; then

echo "MySQL password not set. Please set with -p option or setMYSQL_PASSWORD variable." >&2

missing_args="true"

fi

if [ -n "$missing_args" ]; then

exit 1

fi

keystone service-create --name nova --typecompute --description 'OpenStack Compute Service'

keystone service-create --name cinder--type volume --description 'OpenStack Volume Service'

keystone service-create --name glance--type image --description 'OpenStack Image Service'

keystone service-create --name keystone--type identity --description 'OpenStack Identity'

keystone service-create --name ec2 --typeec2 --description 'OpenStack EC2 service'

keystone service-create --name quantum--type network --description 'OpenStack Networking service'

create_endpoint () {

case $1 in

compute)

keystone endpoint-create --region$KEYSTONE_REGION --service-id $2 --publicurl'http://'"$EXT_HOST_IP"':8774/v2/$(tenant_id)s' --adminurl'http://'"$HOST_IP"':8774/v2/$(tenant_id)s' --internalurl'http://'"$HOST_IP"':8774/v2/$(tenant_id)s'

;;

volume)

keystone endpoint-create --region $KEYSTONE_REGION --service-id $2--publicurl 'http://'"$EXT_HOST_IP"':8776/v1/$(tenant_id)s'--adminurl 'http://'"$HOST_IP"':8776/v1/$(tenant_id)s' --internalurl'http://'"$HOST_IP"':8776/v1/$(tenant_id)s'

;;

image)

keystone endpoint-create --region $KEYSTONE_REGION --service-id $2--publicurl 'http://'"$EXT_HOST_IP"':9292/' --adminurl'http://'"$HOST_IP"':9292/' --internalurl 'http://'"$HOST_IP"':9292/'

;;

identity)

keystone endpoint-create --region $KEYSTONE_REGION --service-id $2--publicurl 'http://'"$EXT_HOST_IP"':5000/v2.0' --adminurl'http://'"$HOST_IP"':35357/v2.0' --internalurl'http://'"$HOST_IP"':5000/v2.0'

;;

ec2)

keystone endpoint-create --region $KEYSTONE_REGION --service-id $2--publicurl 'http://'"$EXT_HOST_IP"':8773/services/Cloud' --adminurl'http://'"$HOST_IP"':8773/services/Admin' --internalurl'http://'"$HOST_IP"':8773/services/Cloud'

;;

network)

keystone endpoint-create --region $KEYSTONE_REGION --service-id $2--publicurl 'http://'"$EXT_HOST_IP"':9696/' --adminurl'http://'"$HOST_IP"':9696/' --internalurl'http://'"$HOST_IP"':9696/'

;;

esac

}

for i in compute volume image object-storeidentity ec2 network; do

id=`mysql -h "$MYSQL_HOST" -u "$MYSQL_USER"-p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -ss -e "SELECTid FROM service WHERE type='"$i"';"` || exit 1

create_endpoint $i $id

done

更多精彩内容请看下一页

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/0d9e3283bf556c4845b2c085ae8384db.html