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. 首先创建数据
[[email protected] ~]# 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. 加载环境变量:
[[email protected] ~]# source admin-openrc.sh
3. 创建服务认证帐户:
[[email protected] ~]# keystone user-create --name nova --pass NOVA_PASS
[[email protected] ~]# keystone service-create --name nova --type compute -description "OpenStack Compute"
4. 创建一个供计算节点访问的api:
[[email protected] ~]# 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. 安装所需软件包:
[[email protected] ~]# 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 文件
[[email protected] ~]# cp /etc/nova/nova.conf /etc/nova/nova.conf.old [[email protected] ~]# vi /etc/nova/nova.conf [database] connection = mysql://nova:[email protected]/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: [[email protected] ~]# su -s /bin/sh -c "nova-manage db sync" nova
三) 启动服务,完成以控制节点安装
[[email protected] ~]# 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 [[email protected] ~]# 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. 安装所需软件包:
[[email protected] ~]# yum install -y openstack-nova-compute sysfsutils
2. 编辑 /etc/nova/nova.conf 文件,添加以下内容
[[email protected] ~]# cp /etc/nova/nova.conf /etc/nova/nova.conf.old [[email protected] ~]# 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
二) 安装完成并启动服务
[[email protected] ~]# egrep -c ‘(vmx|svm)‘ /proc/cpuinfo [[email protected] ~]# vi /etc/nova/nova.conf [libvirt] virt_type = qemu [[email protected] ~]# systemctl enable libvirtd.service openstack-nova-compute.service [[email protected] ~]# systemctl start libvirtd.service openstack-nova-compute.service
##### 这里查看状态时报错 #####
[[email protected] ~]# systemctl status libvirtd.service openstack-nova-compute.service
# error:Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
# 通过以下安装可以解决
[[email protected] ~]# yum update -y device-mapper
0x03.确认以上操作
1. 在控制节点执行,加载环境变量:
[[email protected] ~]# source admin-openrc.sh
2. 显示组建注册是否成功:
[[email protected] ~]# nova service-list
3. 列出上传的镜像与状态:
[[email protected] ~]# nova image-list