继安装部署OpenStack三
五、配置compute(计算)服务
compute服务简介
compute 服务是云计算的控制结构,它是Iaas(基础架构即服务)的主要部分,他通过下载image运行虚拟机实例
compute由以下组件组成
API
nova-api 接受和相应用户的API调用
nova-api-metadata 接受虚拟机实例的源数据
Compute core
nova-compute 通过hypervisor API创建和销毁虚拟机实例的进程
nova-scheduler 从消息队列接受信息,从后面的compute中选择主机运行虚拟机实例
nova-conductor nova-computer和数据库交互的中间模块
Networking for VMs
nova-network 从消息队列中接受任务,执行网络维护的进程
nova-dhcpbridge 在数据库中追踪ip地址的释放和记录的一个脚本
Console interface
nova-consoleauth 用户通过console登陆的时候验证用户令牌
nova-novncproxy 通过vnc连接虚拟机实例的进程
nova-xvpnvncproxy 通过vnc连接虚拟机实例的进程
nova-cert 管理X509证书的进程
Image management (EC2 scenario)
nova-objectstore 为image服务提供S3接口注册镜像的进程
euca2ools client 一个管理云资源的命令行解释器
Other components
The queue 在进程间传递信息
SQLdatabase 存储一个云架构在运行时的状态数据
安装compute controller 服务(控制节点)
yum install openstack-nova-api openstack-nova-cert openstack-nova- conductor openstack-nova-console openstack-nova-novncproxy openstack-nova- scheduler python-novaclient
设置compute配置文件的数据库连接,记得替换你的密码
# openstack-config --set /etc/nova/nova.conf database connection mysql://nova:NOVA_DBPASS@controller/nova
设置compute配置文件使用qpid队列
# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend qpid # openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controller
设置ip,VNC监听ip和端口
# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.11 # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 10.0.0.11 # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.0.0.11
使用root登陆mysql创建数据库并赋予nova权限
$ mysql -u root -p mysql> CREATE DATABASE nova; mysql> GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘localhost‘ IDENTIFIED BY ‘NOVA_DBPASS‘; mysql> GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘%‘ IDENTIFIED BY ‘NOVA_DBPASS‘;
创建相关表
su -s /bin/sh -c "nova-manage db sync" nova
创建nova用户,赋予service容器、admin角色
$ keystone user-create --name=nova --pass=NOVA_PASS --email=nova@example.com $ keystone user-role-add --user=nova --tenant=service --role=admin
设置配置文件使用keystone验证
# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host controller # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357 # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password NOVA_PASS
向keystone注册服务和端点
$ keystone service-create --name=nova --type=compute --description="OpenStack Compute" $ keystone endpoint-create --service-id=$(keystone service-list | awk ‘/ compute / {print $2}‘) --publicurl=http://controller:8774/v2/%\(tenant_id\)s --internalurl=http://controller:8774/v2/%\(tenant_id\)s --adminurl= http://controller:8774/v2/%\(tenant_id\)s
启动相关服务并加入启动列表
# service openstack-nova-api start # service openstack-nova-cert start # service openstack-nova-consoleauth start # service openstack-nova-scheduler start # service openstack-nova-conductor start # service openstack-nova-novncproxy start # chkconfig openstack-nova-api on # chkconfig openstack-nova-cert on # chkconfig openstack-nova-consoleauth on # chkconfig openstack-nova-scheduler on # chkconfig openstack-nova-conductor on # chkconfig openstack-nova-novncproxy on
验证配置
$ nova image-list +--------------------------------------+---------------------+-------- +--------+ | ID | Name | Status | Server | +--------------------------------------+---------------------+-------- +--------+ | acafc7c0-40aa-4026-9673-b879898e1fc2 | cirros-0.3.2-x86_64 | ACTIVE | | +--------------------------------------+---------------------+-------- +--------+
配置一个compute节点(compute节点)
# yum install openstack-nova-compute
编辑/etc/nova/nova.conf文件
# openstack-config --set /etc/nova/nova.conf database connection mysql:// nova:NOVA_DBPASS@controller/nova # openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000 # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host controller # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357 # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password NOVA_PASS
设置配置文件使用qpid队列
# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend qpid # openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controller
设置提供远程vnc访问虚拟机实例
# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.31 # openstack-config --set /etc/nova/nova.conf DEFAULT vnc_enabled True # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0 # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.0.0.31 # openstack-config --set /etc/nova/nova.conf DEFAULT novncproxy_base_url http://controller:6080/vnc_auto.html
指定运行image服务的主机地址
# openstack-config --set /etc/nova/nova.conf DEFAULT glance_host controller
启动相关服务并加入启动列表
# service libvirtd start # service messagebus start # service openstack-nova-compute start # chkconfig libvirtd on # chkconfig messagebus on # chkconfig openstack-nova-compute on
本文出自 “Linux is belong to you” 博客,请务必保留此出处http://jwh5566.blog.51cto.com/7394620/1669932
一步一步跟着官方文档安装部署Openstack(icehouse)四
原文地址:http://jwh5566.blog.51cto.com/7394620/1669932