云计算之openstack-newton版搭建(五)

本章讲解以下计算服务(nova)的安装及配置。

一、安装和配置控制器节点

1.配置数据库

# mysql -u root -p123456
mysql> CREATE DATABASE nova_api;
mysql> CREATE DATABASE nova;
mysql> GRANT ALL PRIVILEGES ON nova_api.* TO ‘nova‘@‘localhost‘   IDENTIFIED BY ‘NOVA_DBPASS‘;
mysql> GRANT ALL PRIVILEGES ON nova_api.* TO ‘nova‘@‘%‘   IDENTIFIED BY ‘NOVA_DBPASS‘;
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‘;

2.获取admin权限

# . admin-openrc

3.创建服务

创建nova用户

# openstack user create --domain default   --password-prompt nova
[[email protected] ~]# openstack user create --domain default >   --password-prompt nova
User Password:123456
Repeat User Password:123456
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 95fafc9a5ef04d4b8a479ff14e03434e |
| name                | nova                             |
| password_expires_at | None                             |
+---------------------+----------------------------------+

将admin角色添加到nova用户

# openstack role add --project service --user nova admin
[[email protected] ~]# openstack role add --project service --user nova admin
此命令没有输出

创建nova服务实体

# openstack service create --name nova   --description "OpenStack Compute" compute
[[email protected] ~]# openstack service create --name nova >   --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | 86d7334a360b49d2a02d50f17e38dd96 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

4.创建API

# openstack endpoint create --region RegionOne \ 
 compute public http://controller:8774/v2.1/%\(tenant_id\)s
# openstack endpoint create --region RegionOne   compute public http://controller:8774/v2.1/%\(tenant_id\)s
[[email protected] ~]# openstack endpoint create --region RegionOne >   compute public http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 0e70c90b242e40758adb76e92c6154f4          |
| interface    | public                                    |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 86d7334a360b49d2a02d50f17e38dd96          |
| service_name | nova                                      |
| service_type | compute                                   |
| url          | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+
# openstack endpoint create --region RegionOne   compute internal http://controller:8774/v2.1/%\(tenant_id\)s
[[email protected] ~]# openstack endpoint create --region RegionOne >   compute internal http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 04c55a4055754c19855235b8e6f3fab3          |
| interface    | internal                                  |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 86d7334a360b49d2a02d50f17e38dd96          |
| service_name | nova                                      |
| service_type | compute                                   |
| url          | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+
# openstack endpoint create --region RegionOne   compute admin http://controller:8774/v2.1/%\(tenant_id\)s
[[email protected] ~]# openstack endpoint create --region RegionOne >   compute admin http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 3f289ddab3d540dc8be4e6b918f605f1          |
| interface    | admin                                     |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 86d7334a360b49d2a02d50f17e38dd96          |
| service_name | nova                                      |
| service_type | compute                                   |
| url          | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+

5.安装软件包

# yum install openstack-nova-api openstack-nova-conductor   openstack-nova-console openstack-nova-novncproxy   openstack-nova-scheduler -y

6.编辑/etc/nova/nova.conf

[[email protected] ~]# cd /etc/nova/
[[email protected] nova]# cp nova.conf nova.conf.bak
[[email protected] nova]# egrep -v "^$|^#" nova.conf.bak > nova.conf
[[email protected] nova]# vim nova.conf
添加如下内容
[DEFAULT]
...
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:[email protected]
auth_strategy = keystone
my_ip = 192.168.23.98
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
...
connection = mysql+pymysql://nova:[email protected]/nova_api

[database]
...
connection = mysql+pymysql://nova:NO[email protected]/nova
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = 123456
[vnc]
...
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[glance]
...
api_servers = http://controller:9292
[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

7.导入数据库

# su -s /bin/sh -c "nova-manage api_db sync" nova
# su -s /bin/sh -c "nova-manage db sync" nova
忽略此输出的任何弃用消息

8.开启服务

# systemctl enable openstack-nova-api.service   openstack-nova-consoleauth.service openstack-nova-scheduler.service \  
  openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service   openstack-nova-consoleauth.service openstack-nova-scheduler.service \  
  openstack-nova-conductor.service openstack-nova-novncproxy.service

8.验证

[[email protected] ~]# nova service-list
+----+------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host                 | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller.novalocal | internal | enabled | up    | 2017-01-12T02:41:48.000000 | -               |
| 2  | nova-consoleauth | controller.novalocal | internal | enabled | up    | 2017-01-12T02:41:48.000000 | -               |
| 3  | nova-scheduler   | controller.novalocal | internal | enabled | up    | 2017-01-12T02:41:48.000000 | -               |
+----+------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
[[email protected] ~]#
时间: 2024-11-08 20:10:34

云计算之openstack-newton版搭建(五)的相关文章

openstack i版搭建教程

第一部分云计算平台Openstack介绍 一.   什么是云计算 云计算(cloud computing)是基于互联网的相关服务的增加.使用和交付模式,通常涉及通过互联网来提供动态易扩展且经常是虚拟化的资源.云是网络.互联网的一种比喻说法.过去在图中往往用云来表示电信网,后来也用来表示互联网和底层基础设施的抽象.因此,云计算甚至可以让你体验每秒10万亿次的运算能力,拥有这么强大的计算能力可以模拟核爆炸.预测气候变化和市场发展趋势.用户通过电脑.笔记本.手机等方式接入数据中心,按自己的需求进行运算

基于Ubuntu12.04-server版的openstack F版搭建步骤

本文为双节点搭建,分为计算(IP1)和控制节点(IP2) 说明: 计算节点组件: 1.mysql 2.keystone 3.Nova 4.glance 5.rabbitmq 控制节点组件: 1.cinder 2.dashboard 一.修改主机名及静态IP 1.vim  /etc/hostname             xxctrl(xxctrl改为目标名) 2.vim  /etc/hosts     IP     xxctrl(目标名) 3.hostname xxctrl (使改名生效,也可

ubuntu16.04多节点布置openstack newton版

控制节点安装 1.网络配置 需要两张网卡,两张网卡第一张网卡配置静态地址,第二张为provider interface,配置如下: # The provider network interface auto INTERFACE_NAME iface INTERFACE_NAME inet manual up ip link set dev $IFACE up down ip link set dev $IFACE down 将其中的INTERFACE_NAME换成自己的interface(最后两

openstack R版 搭建过程遇到的种种问题

一.创建虚拟机失败 vm上运行virt-install 创建kvm类型的主机,centos的版本建议不要超过7.2,本人用的7.7版本,不能创建kvm类型的虚拟机,只能创建qemu类型的虚拟机.把宿主机版本降到7.2后,恢复正常. 二.Nova控制节点安装报错 采用centos7.2,yum安装报错,需要在手动添加一个QEMU-EV.repo文件 [[email protected] yum.repos.d]# cat 1.repo [openstack] name=openstack base

openstack newton linuxbridge 改成 ovs

最近搭建了一个all in one 的 openstack newton 版,安装官方文档做用的是linuxbridge.已经老版玩的时候都是用的ovs,趁比较闲的时候也将N版改造一下 官方文档 http://docs.openstack.org/liberty/networking-guide/scenario-provider-ovs.html 下面只列出比较重要的文件,官方有文档,这次参考L版的文档来操作的 安装包yum install openstack-neutron openstac

openstack I版的搭建五--

登陆 用户demo登陆 如果你在启动某个服务的时候,没启动起来,没日子 那么我们就手动启动一下. [[email protected] ~]# neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini 这样的

openstack I版的搭建二

[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# cd keystone-2014.1 [[email protected] keystone-2014.1]# python setup.py install [[email protected] keystone-2014.1]# cd etc/ [[email protected] etc]# ll 总用量 72 -rw-rw-r-- 1 1004 1004

openstack I版的搭建六--

[[email protected] init.d]# chkconfig openstack-neutron-linuxbridge-agent on [[email protected] init.d]# chkconfig openstack-nova-compute on [[email protected] ~]# nova host-list +---------------------------+-------------+----------+ | host_name    

openstack I版的搭建四--

[[email protected]]# cd /usr/local/src/neutron-2014.1 [[email protected] neutron-2014.1]# python setup.py install [[email protected] etc]# pwd /usr/local/src/neutron-2014.1/etc [[email protected] etc]# mkdir /etc/neutron [[email protected] etc]# mkdi

openstack I版的搭建三--Nova

安装Nova [[email protected] src]# cd ~ [[email protected] ~]# cd /usr/local/src/nova-2014.1 [[email protected] nova-2014.1]# python setup.py install [[email protected] nova]# pwd /usr/local/src/nova-2014.1/etc/nova [ro[email protected] nova]# ll 总用量 48