码迷,mamicode.com
首页 > 其他好文 > 详细

Centos7 install Openstack - (第四节)添加计算服务(Nova)

时间:2015-11-08 17:52:39      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:

Centos7 install Openstack - (第四节)添加计算服务(Nova)

 

我的blog地址:http://www.cnblogs.com/caoguo

该文根据openstack官方文档配置

官方文档地址: http://docs.openstack.org/juno/install-guide/install/yum/content/#

 

0x01. Install and configure controller node (在控制节点安装配置一下内容)


一) 配置基本环境
1. 首先创建数据

[root@controller ~]# mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE nova;

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO nova@localhost -> IDENTIFIED BY NOVA_DBPASS;

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO nova@% -> IDENTIFIED BY NOVA_DBPASS;

 

2. 加载环境变量:

[root@controller ~]# source admin-openrc.sh

 



3. 创建服务认证帐户:

[root@controller ~]# keystone user-create --name nova --pass NOVA_PASS


技术分享

 

[root@controller ~]# keystone service-create --name nova --type compute -description "OpenStack Compute"

技术分享


4. 创建一个供计算节点访问的api:

[root@controller ~]# 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 \
--region regionOne


技术分享

 

 

二) 在控制节点安装配置计算组件


1. 安装所需软件包:

[root@controller ~]# yum install -y openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient

 


2. 编辑 /etc/nova/nova.conf 文件

[root@controller ~]# cp /etc/nova/nova.conf /etc/nova/nova.conf.old
[root@controller ~]# vi /etc/nova/nova.conf

[database]
connection = mysql://nova:NOVA_DBPASS@controller/nova

[DEFAULT]
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASS
auth_strategy = keystone
my_ip = 192.168.88.133
vncserver_listen = 192.168.88.133
vncserver_proxyclient_address = 192.168.88.133
verbose = True

[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASS

[glance]
host = controller
3. Populate the Compute database:
[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova

 



三) 启动服务,完成以控制节点安装

[root@controller ~]# systemctl enable openstack-nova-api.service openstack-nova-cert.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

[root@controller ~]# systemctl start openstack-nova-api.service openstack-nova-cert.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

 


0x02.安装配置计算节点


一) 安装配置计算节点管理组件
1. 安装所需软件包:

[root@compute1 ~]# yum install -y openstack-nova-compute sysfsutils


2. 编辑 /etc/nova/nova.conf 文件,添加以下内容

[root@compute1 ~]# cp /etc/nova/nova.conf /etc/nova/nova.conf.old
[root@compute1 ~]# vi /etc/nova/nova.conf
[DEFAULT]
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASS
auth_strategy = keystone
my_ip = 192.168.88.135
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 192.168.88.135
novncproxy_base_url = http://controller:6080/vnc_auto.html
verbose = True

[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASS

[glance]
host = controller

 


二) 安装完成并启动服务

[root@compute1 ~]# egrep -c (vmx|svm) /proc/cpuinfo

[root@compute1 ~]# vi /etc/nova/nova.conf
[libvirt]
virt_type = qemu

[root@compute1 ~]# systemctl enable libvirtd.service openstack-nova-compute.service
[root@compute1 ~]# systemctl start libvirtd.service openstack-nova-compute.service

##### 这里查看状态时报错 #####
[root@compute1 ~]# systemctl status libvirtd.service openstack-nova-compute.service
# error:Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
# 通过以下安装可以解决
[root@compute1 ~]# yum update -y device-mapper

 

 


0x03.确认以上操作
1. 在控制节点执行,加载环境变量:

[root@controller ~]# source admin-openrc.sh

 

2. 显示组建注册是否成功:

[root@controller ~]# nova service-list

技术分享


3. 列出上传的镜像与状态:

[root@controller ~]# nova image-list

技术分享



 

Centos7 install Openstack - (第四节)添加计算服务(Nova)

标签:

原文地址:http://www.cnblogs.com/caoguo/p/4947682.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!