keystone,nova,cinder,glance,neutron,horizon
节点:1个,virtualBox虚拟机:Linux version 3.16.0-23-generic,Ubuntu 14.10
网络:1个,一般的环境都有一个外部网络,一个内网,或者是管理网和存储网
参考:https://www.lylinux.org/ubuntu-12-04%E4%B8%AD%E5%8D%95%E7%BD%91%E5%8D%A1%E9%83%A8%E7%BD%B2openstack.html
apt-get
install
bridge-utils
备注:网桥是一种软件配置,用于连结两个或更多个不同网段。bridge-utils 软件包里面的 brctl 工具管理网桥. brctl show 可以看到所有的网桥和连接到网桥的接口。
apt-get install ntp
编辑 /etc/ntp.conf 在末尾添加下面3行,一个节点应该不需要安装ntp吧?
server ntp.ubuntu.com iburst
server 127.127.1.0 # 預設的一個內部時鐘資料,用在沒有外部 NTP 伺服器時
fudge 127.127.1.0 stratum 10
/etc/init.d/ntp restart
apt-get install tgt
/etc/init.d/tgt start
apt-get install rabbitmq-server memcached python-memcache
apt-get install kvm libvirt-bin
apt-get install -y mysql-server python-mysqldb
mysql -uroot -p
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'novadbadmin'@'%' IDENTIFIED BY 'dieD9Mie';
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glancedbadmin'@'%' IDENTIFIED BY 'ohC3teiv';
create database keystone;
grant all on keystone.* to 'keystone'@'%' identified by 'openstack';
quit
admin_token = ADMIN # 这个值可以不改,不过要记住
[sql]
connection = mysql://keystone:openstack@localhost/keystone # 根据自己的环境修改
重启服务 service keystone restart
keystone-manage db_sync 数据库迁移
导入数据:
wget http://www.chenshake.com/wp-content/uploads/2012/07/keystone_data.sh_.txt
mv keystone_data.sh_.txt keystone_data.sh
chmod +x keystone_data.sh # 修改service_token 和service_endpoint
./keystone_data.sh
keystone的api需要token认证,我们制作一个文件 vi /root/keystone_admin
export SERVICE_TOKEN="hastexo" # 我进行了修改
export SERVICE_ENDPOINT="http://localhost:35357/v2.0"
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=admin123
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://localhost:35357/v2.0
admin_tenant_name = %SERVICE_TENANT_NAME% service
admin_user = %SERVICE_USER% glance
admin_password = %SERVICE_PASSWORD% admin
[paste_deploy]
flavor = keystone
配置/etc/glance/glance-registry.conf
admin_tenant_name = %SERVICE_TENANT_NAME%
admin_user = %SERVICE_USER%
admin_password = %SERVICE_PASSWORD%
[paste_deploy]
flavor = keystone
[database]
connection = mysql://glancedbadmin:ohC3teiv@localhost/glance
向keystone注册服务和endpoint
keystone service-create --name=glance --type=image --description="Glance Image Service"
keystone endpoint-create --service_id 2e1db83bf3c34bfe912547c68f282e3f --region RegionOne --publicurl http://localhost:9292/v1 --adminurl http://localhost:9292/v1 --internalurl http://localhost:9292/v1
测试
glance image-create --name "cirros-0.3.5" --file /data/images/cirros-0.3.5-i386-disk.img \ --disk-format qcow2 --container-format bare --is-public True --progress
[DEFAULT]
# AUTHENTICATION
auth_strategy=keystone
rpc_backend=rabbit
rabbit_host=localhost
rabbit_userid=guest
rabbit_password=rabbit
my_ip=127.0.0.1
api_paste_config=/etc/nova/api-paste.ini
# DATABASE
sql_connection=mysql://novadbadmin:dieD9Mie@localhost/nova
#NETWORK
network_manager=nova.network.manager.FlatDHCPManager
force_dhcp_release=True
# Location of flagfiles for dhcpbridge (multi valued)
dhcpbridge_flagfile=/etc/nova/nova.conf
# Interface for public IP addresses (string value)
public_interface=eth1
# Location of nova-dhcpbridae (string value)
dhcpbridge=/usr/bin/nova-dhcpbridge
# Bridge for simple network instances (string value)
flat_network_bridge=br100
# FlatDhcp will bridge into this interface if set (string value)
flat_interface=eth0
# Firewall driver (defaults to hypervisor specific iptables driver)(string value)
firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
keys_path=/var/lib/nova/keys
lock_path=/var/lib/nova/tmp
images_path=/var/lib/nova/images
buckets_path=/var/lib/nova/buckets
instances_path=/var/lib/nova/instances
networks_path=/var/lib/nova/networks
[glance]
glance_api_servers=127.0.0.1:9292
[keystone_authtoken]
identity_uri=http://localhost:35357
admin_user=nova
admin_password=admin
admin_tenant_name=service
如果是在虚拟机上部署,nova-compute.conf 中virt_type=qemu
keystone service-create --name=nova --type=compute --description="Compute Service"
keystone endpoint-create --service_id 6705be2bbe3a4d2195e63c4e813c76e9 --region RegionOne --publicurl http://localhost:8774/v2/%\(tenant_id\)s \
--adminurl http://localhost:8774/v2/%\(tenant_id\)s --internalurl http://localhost:8774/v2/%\(tenant_id\)s
nova-manage floating create --ip_range=10.172.7.0/24