一、控制节点安装部署Nova

  Nova 包含API(负责接收相应外部请求,支持OpenStackAPI,EC2API);cert:负责身份认证;schedule:用于云主机调度(虚拟机创建在哪台主机上);conductor:计算节点访问数据中间件;consoleauth:用户控制台授权验证;novncproxy:vnc代理。

  1、安装

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

  2、创建用户:  

[root@linux-node1 ~]# openstack user create --domain default --password=nova nova
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | d21d0715890447fb87f72e85dce6d4be |
| enabled | True |
| id | 5fbc8074b56843b0a1cdb7d4730bb7fa |
| name | nova |
| password_expires_at | None |
+---------------------+----------------------------------+
[root@linux-node1 ~]# openstack role add --project service --user nova admin

  3、修改nova的配置文件,配置结果如下

[root@linux-node1 ~]# vi /etc/nova/nova.conf
[database]
connection=mysql://nova:nova@172.22.0.218/nova
[api_database]
connection=mysql://nova:nova@172.22.0.218/nova
[xvp]
rpc_backend=rabbit
[oslo_messaging_rabbit]
rabbit_host=172.22.0.218
rabbit_port=
rabbit_userid=openstack
rabbit_password=openstack
[keystone_authtoken]
auth_uri = http://172.22.0.218:5000
auth_url = http://172.22.0.218:35357
auth_plugin = password
memcached_servers = 172.22.0.218:
project_domain_id = d21d0715890447fb87f72e85dce6d4be
user_domain_id = d21d0715890447fb87f72e85dce6d4be
project_name = service
username = nova
password = nova
[DEFAULT]
my_ip=172.22.0.218
auth_strategy=keystone
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
enabled_apis=osapi_compute,metadata
transport_url=rabbit://openstack:openstack@172.22.0.218
[vnc]
vncserver_listen=$my_ip
vncserver_proxyclient_address=$my_ip
[glance]
api_servers=http://172.22.0.218:9292
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
[root@linux-node1 ~]# grep -n "^[a-Z]"  /etc/nova/nova.conf
:auth_strategy=keystone
:use_neutron = True
:my_ip=172.22.0.218
:enabled_apis=osapi_compute,metadata
:firewall_driver = nova.virt.firewall.NoopFirewallDriver
:transport_url=rabbit://openstack:openstack@172.22.0.218
:rpc_backend=rabbit
:connection=mysql://nova:nova@172.22.0.218/nova
:api_servers=http://172.22.0.218:9292
:auth_uri = http://172.22.0.218:5000
:auth_url = http://172.22.0.218:35357
:auth_plugin = password
:memcached_servers = 172.22.0.218:
:project_domain_id = d21d0715890447fb87f72e85dce6d4be
:user_domain_id = d21d0715890447fb87f72e85dce6d4be
:project_name = service
:username = nova
:password = nova
:lock_path=/var/lib/nova/tmp
:rabbit_host=172.22.0.218
:rabbit_port=
:rabbit_userid=openstack
:rabbit_password=openstack
:vncserver_listen=$my_ip
:vncserver_proxyclient_address=$my_ip

  4、数据库同步并检查:  

[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage db sync" nova
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
MariaDB [nova]> show tables;
+--------------------------------------------+
| Tables_in_nova |
+--------------------------------------------+
| agent_builds |
| aggregate_hosts |
| aggregate_metadata |
| aggregates |
| allocations |
| block_device_mapping |
| bw_usage_cache |
| cells |
| certificates |
| compute_nodes |
| console_auth_tokens |
| console_pools |
| consoles |
| dns_domains |
| fixed_ips |
| floating_ips |
| instance_actions |
| instance_actions_events |
| instance_extra |
| instance_faults |
| instance_group_member |
| instance_group_policy |
| instance_groups |
| instance_id_mappings |
| instance_info_caches |
| instance_metadata |
| instance_system_metadata |
| instance_type_extra_specs |
| instance_type_projects |
| instance_types |
| instances |
| inventories |
| key_pairs |
| migrate_version |
| migrations |
| networks |
| pci_devices |
| project_user_quotas |
| provider_fw_rules |
| quota_classes |
| quota_usages |
| quotas |
| reservations |
| resource_provider_aggregates |
| resource_providers |
| s3_images |
| security_group_default_rules |
| security_group_instance_association |
| security_group_rules |
| security_groups |
| services |
| shadow_agent_builds |
| shadow_aggregate_hosts |
| shadow_aggregate_metadata |
| shadow_aggregates |
| shadow_block_device_mapping |
| shadow_bw_usage_cache |
| shadow_cells |
| shadow_certificates |
| shadow_compute_nodes |
| shadow_console_pools |
| shadow_consoles |
| shadow_dns_domains |
| shadow_fixed_ips |
| shadow_floating_ips |
| shadow_instance_actions |
| shadow_instance_actions_events |
| shadow_instance_extra |
| shadow_instance_faults |
| shadow_instance_group_member |
| shadow_instance_group_policy |
| shadow_instance_groups |
| shadow_instance_id_mappings |
| shadow_instance_info_caches |
| shadow_instance_metadata |
| shadow_instance_system_metadata |
| shadow_instance_type_extra_specs |
| shadow_instance_type_projects |
| shadow_instance_types |
| shadow_instances |
| shadow_key_pairs |
| shadow_migrate_version |
| shadow_migrations |
| shadow_networks |
| shadow_pci_devices |
| shadow_project_user_quotas |
| shadow_provider_fw_rules |
| shadow_quota_classes |
| shadow_quota_usages |
| shadow_quotas |
| shadow_reservations |
| shadow_s3_images |
| shadow_security_group_default_rules |
| shadow_security_group_instance_association |
| shadow_security_group_rules |
| shadow_security_groups |
| shadow_services |
| shadow_snapshot_id_mappings |
| shadow_snapshots |
| shadow_task_log |
| shadow_virtual_interfaces |
| shadow_volume_id_mappings |
| shadow_volume_usage_cache |
| snapshot_id_mappings |
| snapshots |
| tags |
| task_log |
| virtual_interfaces |
| volume_id_mappings |
| volume_usage_cache |
+--------------------------------------------+
rows in set (0.01 sec)

二、启动Nova并注册:

  1、开机启动

[root@linux-node1 ~]# 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

  2、在keystone上注册nova,并检查控制节点的nova服务是否配置成功  

[root@linux-node1 ~]# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 6e8e777cc27c4459aebc35458961a910 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne compute public http://172.22.0.218:8774/v2/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 0a71c8fd893647b690c7574ca73ed9b9 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 6e8e777cc27c4459aebc35458961a910 |
| service_name | nova |
| service_type | compute |
| url | http://172.22.0.218:8774/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne compute internal http://172.22.0.218:8774/v2/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 5e99985fb4b14c3286d373e0b18dc311 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 6e8e777cc27c4459aebc35458961a910 |
| service_name | nova |
| service_type | compute |
| url | http://172.22.0.218:8774/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne compute admin http://172.22.0.218:8774/v2/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | d7b07484b2f4437388cd67eb1bccda47 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 6e8e777cc27c4459aebc35458961a910 |
| service_name | nova |
| service_type | compute |
| url | http://172.22.0.218:8774/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[root@linux-node1 ~]# openstack host list +-------------+-------------+----------+
| Host Name | Service | Zone |
+-------------+-------------+----------+
| linux-node1 | conductor | internal |
| linux-node1 | consoleauth | internal |
| linux-node1 | cert | internal |
| linux-node1 | scheduler | internal |

三、计算节点环境准备

  1、Nova compute 计算节点的安装部署    

     1)环境部署安装:

[root@linux-node2 ~]# yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm -y

[root@linux-node2 ~]# yum install centos-release-openstack-newton -y

[root@linux-node2 ~]# yum install python-openstackclient -y

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

2)开始部署计算节点
                   更改计算节点上的配置文件,直接使用控制节点的配置文件

     [root@linux-node1 ~]# scp /etc/nova/nova.conf 172.22.0.209:/etc/nova     

      

过滤配置文件有些需要更改:
[root@linux-node2 ~]# grep -n '^[a-z]' /etc/nova/nova.conf
:auth_strategy=keystone
:use_neutron = True
:my_ip=172.22.0.209
:enabled_apis=osapi_compute,metadata
:firewall_driver = nova.virt.firewall.NoopFirewallDriver
:transport_url=rabbit://openstack:openstack@172.22.0.218
:rpc_backend=rabbit
:connection=mysql://nova:nova@172.22.0.218/nova
:connection=mysql://nova:nova@172.22.0.218/nova
:api_servers=http://172.22.0.218:9292
:auth_uri = http://172.22.0.218:5000
:auth_url = http://172.22.0.218:35357
:auth_plugin = password
:memcached_servers = 172.22.0.218:
:project_domain_id = d21d0715890447fb87f72e85dce6d4be
:user_domain_id = d21d0715890447fb87f72e85dce6d4be
:project_name = service
:username = nova
:password = nova
:virt_type=qemu
:lock_path=/var/lib/nova/tmp
:rabbit_host=172.22.0.218
:rabbit_port=
:rabbit_userid=openstack
:rabbit_password=openstack
:enabled=true
:keymap=en-us
:vncserver_listen=0.0.0.0
:vncserver_proxyclient_address=$my_ip
:novncproxy_base_url=http://172.22.0.218:6080/vnc_auto.html

     3)启动计算节点的libvirt和nova-compute      

      

[root@linux-node2 ~]# systemctl enable libvirtd openstack-nova-compute
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
[root@linux-node2 ~]# systemctl start libvirtd openstack-nova-compute

  2、安装时间服务:   

  

[root@linux-node2 ~]# yum install chrony -y
[root@linux-node2 ~]# cat /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 172.22.0.218 iburst
[root@linux-node2 ~]# timedatectl set-timezone Asia/Shanghai
[root@linux-node2 ~]# timedatectl status
Local time: Wed -- :: CST
Universal time: Tue -- :: UTC
RTC time: Tue -- ::
Time zone: Asia/Shanghai (CST, +)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
[root@linux-node2 ~]# systemctl enable chronyd.service
[root@linux-node2 ~]# systemctl start chronyd.service
[root@linux-node2 ~]# chronyc sources
Number of sources =
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? linux-node1 - +0ns[ +0ns] +/- 0ns

四、查看是否部署成功:

  1、在控制节点中查看注册的host,最后一个compute即是注册的host  

[root@linux-node1 ~]# openstack host list
+-------------+-------------+----------+
| Host Name | Service | Zone |
+-------------+-------------+----------+
| linux-node1 | conductor | internal |
| linux-node1 | consoleauth | internal |
| linux-node1 | cert | internal |
| linux-node1 | scheduler | internal |
| linux-node2 | compute | nova |
+-------------+-------------+----------+

  2、在控制节点中测试nova和glance连接正常,nova链接keystone是否正常

[root@linux-node1 ~]# nova image-list
WARNING: Command image-list is deprecated and will be removed after Nova 15.0. is released. Use python-glanceclient or openstackclient instead.
+--------------------------------------+--------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------+--------+--------+
| 8f5837b4-bbec-4ef5-96f6-aba989c27206 | cirros | ACTIVE | |
+--------------------------------------+--------+--------+--------+
[root@linux-node1 ~]# nova endpoints
/usr/lib/python2./site-packages/novaclient/v2/shell.py:: UserWarning: nova endpoints is deprecated, use openstack catalog list instead
"nova endpoints is deprecated, use openstack catalog list instead")
WARNING: nova has no endpoint in ! Available endpoints for this service:
+-----------+--------------------------------------------------------------+
| nova | Value |
+-----------+--------------------------------------------------------------+
| id | 0a71c8fd893647b690c7574ca73ed9b9 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:8774/v2/503b0eab0420454e909a46e476bf1ede |
+-----------+--------------------------------------------------------------+
+-----------+--------------------------------------------------------------+
| nova | Value |
+-----------+--------------------------------------------------------------+
| id | 5e99985fb4b14c3286d373e0b18dc311 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:8774/v2/503b0eab0420454e909a46e476bf1ede |
+-----------+--------------------------------------------------------------+
+-----------+--------------------------------------------------------------+
| nova | Value |
+-----------+--------------------------------------------------------------+
| id | d7b07484b2f4437388cd67eb1bccda47 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:8774/v2/503b0eab0420454e909a46e476bf1ede |
+-----------+--------------------------------------------------------------+
WARNING: glance has no endpoint in ! Available endpoints for this service:
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 2646c93f3cda442fb062887f6c510343 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 5cc3112ed5944f04935805467ad36ec8 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | af6c4a21691344d7adfd6ec3e2d3674e |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:9292 |
+-----------+----------------------------------+
WARNING: keystone has no endpoint in ! Available endpoints for this service:
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | 10f1ab0fe78c425d8cc4bfd058791fee |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:35357/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | 894040c4f3d044f0af4ecb7230d6cb75 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:5000/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | e8789e11929c447e87271748e316e727 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.22.0.218:5000/v2.0 |
+-----------+----------------------------------+

    

openstack安装newton版本Nova部署(三)的更多相关文章

  1. openstack安装newton版本keyston部署(一)

    一.部署环境:     两台centos7,  内存2G 控制计算节点: Hostname1:                    ip:172.22.0.218 计算节点及存储节点 Hostnam ...

  2. openstack安装newton版本Glance部署(二)

    一.部署Glance 1.Glance 安装 [root@linux-node1 ~]#yum install openstack-glance python-glance python-glance ...

  3. openstack安装newton版本neutron服务部署(四)

    一.管理节点部署服务: 1.安装neutron: [root@linux-node1 ~]# yum install openstack-neutron openstack-neutron-ml2 o ...

  4. openstack安装newton版本dashboard+cinder(六)

    一.dashboard 1.安装dashboard及配置 [root@linux-node1 ~]# yum install openstack-dashboard -y #可以装任何地方只要能连接 ...

  5. openstack安装newton版本创建虚拟机(五)

    一.创建网络: 1.在控制节点上创建一个单一扁平网络(名字:flat),网络类型为flat,网络适共享的(share),网络提供者:physnet1,它是和eth0关联起来的 [root@linux- ...

  6. OpenStack kilo版(3) Nova部署

    部署在controller和compute节点 配置数据库 MariaDB [(none)]> CREATE DATABASE nova;  Query OK, 1 row affected ( ...

  7. openstack安装-计算节点-nova计算服务安装

    一.基础服务安装 先安装基础工具 yum install net-tools vim telnet wget lrzsz 1.添加hosts解析 cat << EOF >/etc/h ...

  8. OpenStack Newton版本Ceph集成部署记录

    2017年2月,OpenStack Ocata版本正式release,就此记录上一版本 Newton 结合Ceph Jewel版的部署实践.宿主机操作系统为CentOS 7.2 . 初级版: 192. ...

  9. devstack安装openstack newton版本

    准备使用devstack安装openstack N版,搞一套开发环境出来.一连整了4天,遇到各种问题,各种错误,一直到第4天下午4点多才算完成. 在这个过程中感觉到使用devstack搭建openst ...

随机推荐

  1. spring2.5和struts1.3.8整合

    第一步:导入对应jar文件 第二步: 1.在web容器中实例化spring容器 <!-- 指定spring的配置文件,默认从web根目录寻找配置文件,我们可以通过spring提供的classpa ...

  2. codeforces 558A A. Lala Land and Apple Trees(水题)

    题目链接: A. Lala Land and Apple Trees time limit per test 1 second memory limit per test 256 megabytes ...

  3. 文章预告的自我挖坑系列——D3.js 系列之星光闪烁

    D3.js 是个神奇的工具,下面收集了一些与星星相关的可视化的例子,静待慢慢的把坑填上 雷达图http://bl.ocks.org/kevinschaul/8213691      星空 二维(一)h ...

  4. 详解 pthread_detach()函数

    pthread_t 类型定义: typedef unsigned long int pthread_t; //come from /usr/include/bits/pthread.h 用途:pthr ...

  5. linux shell date 时间运算以及时间差计算方法

    最近一段时间,在处理Shell 脚本时候,遇到时间的处理问题. 时间的加减,以及时间差的计算. 获取当前时间戳 date +%s . 时间加减 这里处理方法,是将基础的时间转变为时间戳,然后,需要增加 ...

  6. <<Senium2自动化测试>>读书笔记二

    为进一步加强Python知识扩展和学习,在朋友的推荐下选择了<<Selenium2自动化测试实战>>,作者胡志恒,基于Python语言实现,以实例的方式详细讲解WebDrive ...

  7. MySQL整体架构与内存结构

    一  mysql 整体框架: MySQL是由SQL接口,解析器,优化器,缓存,存储引擎等组成的. 1. Connectors指的是不同语言中与SQL的交互. 2. Management Serveic ...

  8. 洛谷P1941飞扬的小鸟——细节DP

    题目:https://www.luogu.org/problemnew/show/P1941 此题主要注意许多细节,详见代码. 代码如下: #include<iostream> #incl ...

  9. MQTT协议简介及协议原理

    MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基于发布/订阅(publish/subscribe)模式的“轻量级”通讯协议,该协议构建 ...

  10. 最短路径 一 Dijkstra 模板(O(n^2))

    题目传送:http://hihocoder.com/problemset/problem/1081 #include<iostream> #include<cstdio> #i ...