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

2022-06-12 09:46:31 浏览数 (1)

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

1.准备阶段

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

所需设备:

物理机一台8G内存,windows2003sp2操作系统,workstation9,ubuntu13.04(64位)镜像

网络设置:

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)

拓扑图:

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

安装步骤:

2.Control node

2.1 准备ubuntu

添加grizzly源

apt-get install -y ubuntu-cloud-keyring

echo debhttp://ubuntu-cloud.archive.canonical.com/ubuntu 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

;;

0 人点赞