2013年(28)
分类: 云计算
2013-03-04 16:10:18
控制器节点将提供:
? 数据库(包括MySQL)
? 队列(包括RabbitMQ)
? KeyStone
? Glance
? Nova(不包括nova-compute)
? Cinder
? Quantum服务器(包括Open-vSwitch插件)
? Dashboard(包括Horizon)
1. 安装Ubuntu,安装时设置如下参数:
? 时区:UTC
? 主机名:contoller
? 软件包:OpenSSH-Server
操作系统安装完成后,重启服务器。
2. 由于Ubuntu 12.04 LTS默认包含OpenStack Essex,我们将使用Ubuntu Cloud Archive获取Folsom:
apt-get install ubuntu-cloud-keyring |
编辑/etc/apt/sources.list.d/cloud-archive.list:
deb precise-updates/folsom main
|
升级系统(需要的话重启):
apt-get update && apt-get upgrade
|
3. 配置网络:
? 编辑/etc/network/interfaces文件:
# Management Network
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
# API + Public Network
auto eth1
iface eth1 inet static
address 7.7.7.7
netmask 255.255.255.0
gateway 7.7.7.1
dns-nameservers 8.8.8.8
|
? 编辑/etc/sysctl.conf
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
|
然后重启网络服务:
service networking restart
|
? 编辑/etc/hosts文件,添加主机名controller, network和compute1及相应IP。
127.0.0.1 localhost
127.0.1.1 controller
192.168.0.1 controller
192.168.0.2 network
192.168.0.3 compute
|
4. 安装配置NTP
? 安装软件包:
apt-get install -y ntp
|
? 配置/etc/ntp.conf文件:
server ntp.ubuntu.com iburst
server 127.127.1.0
fudge 127.127.1.0 stratum 10
|
? 重启服务:
service ntp restart
|
1. 安装软件包:
apt-get install mysql-server python-mysqldb
|
2. 允许从网络连接数据库:
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
|
3. 重启服务:
service mysql restart
|
4. 创建数据库,用户和权限:
mysql -u root -ppassword <
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'192.168.0.1' \
IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'192.168.0.2' \
IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'192.168.0.3' \
IDENTIFIED BY 'password';
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
IDENTIFIED BY 'password';
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'password';
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
IDENTIFIED BY 'password';
CREATE DATABASE quantum;
GRANT ALL PRIVILEGES ON quantum.* TO 'quantum'@'localhost' \
IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON quantum.* TO 'quantum'@'192.168.0.2' \
IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON quantum.* TO 'quantum'@'192.168.0.3' \
IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EOF
|
1. 安装软件包:
apt-get install rabbitmq-server
|
2. 修改默认口令:
rabbitmqctl change_password guest password
|
1. 安装软件包:
apt-get install keystone python-keystone python-keystoneclient
|
2. 编辑/etc/keystone/keystone.conf:
[DEFAULT]
admin_token = password
bind_host = 0.0.0.0
public_port = 5000
admin_port = 35357
compute_port = 8774
verbose = True
debug = True
log_file = keystone.log
log_dir = /var/log/keystone
log_config = /etc/keystone/logging.conf
[sql]
connection = mysql://keystone:password@localhost:3306/keystone
idle_timeout = 200
[identity]
driver = keystone.identity.backends.sql.Identity
[catalog]
driver = keystone.catalog.backends.sql.Catalog
(...)
|
3. 重启Keystone并在数据库创建表:
service keystone restart
keystone-manage db_sync
|
4. 加载环境变量:
? 创建novarc文件:
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_AUTH_URL=""
export SERVICE_ENDPOINT=""
export SERVICE_TOKEN=password
|
? 导出环境变量:
source novarc
echo "source novarc">>.bashrc
|
5. 下载数据脚本,并用数据(用户、租户、服务)填充Keystone数据库:
./keystone-data.sh
|
6. 下载endpoint脚本,并创建endpoints(为项目):
./keystone-endpoints.sh
|
如果管理器节点上的管理网络的IP地址与此例不同,请使用如下命令:
./keystone-endpoints.sh -K
|