OpenStack Grizzly 多节点部署在 Ubuntu 12.04(2)

安装 Glance

apt-get install glance

创建一个 glance 数据库并授权:

mysql -uroot -p create database glance; grant all on glance.* to 'glance'@'%' identified by 'glance';

更新 /etc/glance/glance-api.conf 文件:

verbose = True debug = True sql_connection = mysql://glance:glance@172.16.0.51/glance workers = 4 registry_host = 172.16.0.51 notifier_strategy = rabbit rabbit_host = 172.16.0.51 rabbit_userid = guest rabbit_password = guest [keystone_authtoken] auth_host = 172.16.0.51 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = glance admin_password = password [paste_deploy] config_file = /etc/glance/glance-api-paste.ini flavor = keystone

更新 /etc/glance/glance-registry.conf 文件:

verbose = True debug = True sql_connection = mysql://glance:glance@172.16.0.51/glance [keystone_authtoken] auth_host = 172.16.0.51 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = glance admin_password = password [paste_deploy] config_file = /etc/glance/glance-registry-paste.ini flavor = keystone

启动 glance-api 和 glance-registry 服务并同步到数据库:

/etc/init.d/glance-api restart /etc/init.d/glance-registry restart glance-manage version_control 0 glance-manage db_sync

测试 glance 的安装,上传一个镜像。下载 Cirros 镜像并上传:

wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img glance image-create --name='cirros' --public --container-format=ovf --disk-format=qcow2 < ./cirros-0.3.0-x86_64-disk.img

查看上传的镜像:

glance image-list Cinder

安装 Cinder 需要的包:

apt-get install cinder-api cinder-common cinder-scheduler cinder-volume Python-cinderclient iscsitarget open-iscsi iscsitarget-dkms

配置 iscsi 并启动服务:

sed -i 's/false/true/g' /etc/default/iscsitarget /etc/init.d/iscsitarget restart /etc/init.d/open-iscsi restart

创建 cinder 数据库并授权用户访问:

mysql -uroot -p create database cinder; grant all on cinder.* to 'cinder'@'%' identified by 'cinder'; quit;

修改 /etc/cinder/cinder.conf:

cat /etc/cinder/cinder.conf [DEFAULT] # LOG/STATE verbose = True debug = False iscsi_helper = ietadm auth_strategy = keystone volume_group = cinder-volumes volume_name_template = volume-%s state_path = /var/lib/cinder volumes_dir = /var/lib/cinder/volumes rootwrap_config = /etc/cinder/rootwrap.conf api_paste_config = /etc/cinder/api-paste.ini # RPC rabbit_host = 172.16.0.51 rabbit_password = guest rpc_backend = cinder.openstack.common.rpc.impl_kombu # DATABASE sql_connection = mysql://cinder:cinder@172.16.0.51/cinder # API osapi_volume_extension = cinder.api.contrib.standard_extensions

修改 /etc/cinder/api-paste.ini 文件末尾 [filter:authtoken] 字段 :

[filter:authtoken] paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory service_protocol = http service_host = 172.16.0.51 service_port = 5000 auth_host = 172.16.0.51 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = cinder admin_password = password signing_dir = /var/lib/cinder

创建一个卷组,命名为 cinder-volumes:

这里用文件模拟分区。

dd if=/dev/zero of=/opt/cinder-volumes bs=1 count=0 seek=5G losetup /dev/loop2 /opt/cinder-volumes fdisk /dev/loop2 #Type in the followings: n p 1 ENTER ENTER t 8e w

分区现在有了,创建物理卷和卷组:

pvcreate /dev/loop2 vgcreate cinder-volumes /dev/loop2

这个卷组在系统重启会失效,把它写到 rc.local 中:

echo 'losetup /dev/loop2 /opt/cinder-volumes' >> /etc/rc.local

同步数据库并重启服务:

cinder-manage db sync /etc/init.d/cinder-api restart /etc/init.d/cinder-schduler restart /etc/init.d/cinder-volume restart Quantum

安装 Quantum server 和 OpenVSwitch 包:

apt-get install quantum-server quantum-plugin-openvswitch

创建 quantum 数据库并授权用户访问:

mysql -uroot -p create database quantum; grant all on quantum.* to 'quantum'@'%' identified by 'quantum'; quit;

编辑 OVS 插件配置文件 /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini:

[DATABASE] sql_connection = mysql://quantum:quantum@172.16.0.51/quantum reconnect_interval = 2 [OVS] tenant_network_type = gre enable_tunneling = True tunnel_id_ranges = 1:1000 [AGENT] polling_interval = 2 [SECURITYGROUP]

编辑 /etc/quantum/quanqum.conf 文件:

[DEFAULT] debug = True verbose = True state_path = /var/lib/quantum bind_host = 0.0.0.0 bind_port = 9696 core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2 api_paste_config = /etc/quantum/api-paste.ini control_exchange = quantum rabbit_host = 172.16.0.51 rabbit_password = guest rabbit_port = 5672 rabbit_userid = guest notification_driver = quantum.openstack.common.notifier.rpc_notifier default_notification_level = INFO notification_topics = notifications [QUOTAS] [DEFAULT_SERVICETYPE] [SECURITYGROUP] [AGENT] root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf [keystone_authtoken] auth_host = 172.16.0.51 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = quantum admin_password = password signing_dir = /var/lib/quantum/keystone-signing

启动 quantum 服务:

/etc/init.d/quantum-server restart

linux

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

转载注明出处:http://www.heiqu.com/681e19a446a81ba3320db8cbdfadf061.html