本文包含以下部分

  • Compute service overview
  • Install and configure controller node
  • Prerequisites
  • Install and configure components
  • Finalize installation
  • Install and configure a compute node
  • Install and configure components
  • Finalize installation
  • Verify operation

Compute service overview

Compute service在openstack中的作用比较复杂,大致模块和功能如下:

nova-api service

接受并响应用户的请求

nova-api-metadata service

处理metadata请求

nova-compute service

是一个worker daemon。会调用hypervisor api来创建删除vm等。

nova-scheduler service

接受vm的请求,并分发给compute service

nova-conductor module

目前的作用是compute service和database的一个中间层,不要把它和compute service部署在同一个机器上。

nova-network worker daemon

跟nova-compute service差不多,从queue中接受task并执行。比如配置bridge和iptable。

nova-consoleauth daemon

Authorizes tokens for users that console proxies provide.

nova-novncproxy daemon

Provides a proxy for accessing running instances through a VNC connection. Supports browser-based novnc clients.

nova-novncproxy daemon

Provides a proxy for accessing running instances through a SPICE connection. Supports browser-based HTML5 client.

nova-xvpvncproxy daemon

Provides a proxy for accessing running instances through a VNC connection. Supports an OpenStack-specific Java client.

Install and configure controller node

prerequisite

创建db

  1. mysql -u root -p
  2. CREATE DATABASE nova_api;
  3. CREATE DATABASE nova;
  4. GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
  5. IDENTIFIED BY 'NOVA_DBPASS';
  6. GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
  7. IDENTIFIED BY 'NOVA_DBPASS';
  8. GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
  9. IDENTIFIED BY 'NOVA_DBPASS';
  10. GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
  11. IDENTIFIED BY 'NOVA_DBPASS';

设置keystone

  1. . admin-openrc
  2. # 创建用户
  3. openstack user create --domain default --password-prompt nova
  4. # 在service project中为nova用户添加admin
  5. openstack role add --project service --user nova admin
  6. # 创建compute service
  7. openstack service create --name nova --description "OpenStack Compute" compute
  8. # 创建end points
  9. openstack endpoint create --region RegionOne compute public http://controller01:8774/v2.1/%\(tenant_id\)s
  10. openstack endpoint create --region RegionOne compute internal http://controller01:8774/v2.1/%\(tenant_id\)s
  11. openstack endpoint create --region RegionOne compute admin http://controller01:8774/v2.1/%\(tenant_id\)s

Install and configure components

  1. yum install openstack-nova-api openstack-nova-conductor \
  2. openstack-nova-console openstack-nova-novncproxy \
  3. openstack-nova-scheduler

编辑 /etc/nova/nova.conf

  1. [DEFAULT]
  2. ...
  3. enabled_apis = osapi_compute,metadata
  4. rpc_backend = rabbit
  5. auth_strategy = keystone
  6. my_ip = 10.79.148.84
  7. use_neutron = True
  8. firewall_driver = nova.virt.firewall.NoopFirewallDriver
  9. [api_database]
  10. ...
  11. connection = mysql+pymysql://nova:NOVA_DBPASS@controller01/nova_api
  12. [database]
  13. ...
  14. connection = mysql+pymysql://nova:NOVA_DBPASS@controller01/nova
  15. [oslo_messaging_rabbit]
  16. ...
  17. rabbit_host = controller01
  18. rabbit_userid = openstack
  19. rabbit_password = RABBIT_PASS
  20. [keystone_authtoken]
  21. ...
  22. auth_uri = http://controller01:5000
  23. auth_url = http://controller01:35357
  24. memcached_servers = controller01:11211
  25. auth_type = password
  26. project_domain_name = default
  27. user_domain_name = default
  28. project_name = service
  29. username = nova
  30. password = nova
  31. [vnc]
  32. ...
  33. vncserver_listen = $my_ip
  34. vncserver_proxyclient_address = $my_ip
  35. [glance]
  36. ...
  37. api_servers = http://controller01:9292
  38. [oslo_concurrency]
  39. ...
  40. lock_path = /var/lib/nova/tmp

初始化compute database

  1. su -s /bin/sh -c "nova-manage api_db sync" nova
  2. su -s /bin/sh -c "nova-manage db sync" nova

Finalize installation

  1. systemctl enable \
  2. openstack-nova-api.service \
  3. openstack-nova-consoleauth.service \
  4. openstack-nova-scheduler.service \
  5. openstack-nova-conductor.service \
  6. openstack-nova-novncproxy.service
  7. systemctl start \
  8. openstack-nova-api.service \
  9. openstack-nova-consoleauth.service \
  10. openstack-nova-scheduler.service \
  11. openstack-nova-conductor.service \
  12. openstack-nova-novncproxy.service

Install and configure a compute node

Install and configure components

  1. yum install openstack-nova-compute

编辑 /etc/nova/nova.conf

  1. [DEFAULT]
  2. ...
  3. rpc_backend = rabbit
  4. auth_strategy = keystone
  5. my_ip = 10.79.148.86
  6. use_neutron = True
  7. firewall_driver = nova.virt.firewall.NoopFirewallDriver
  8. [oslo_messaging_rabbit]
  9. ...
  10. rabbit_host = controller01
  11. rabbit_userid = openstack
  12. rabbit_password = RABBIT_PASS
  13. [keystone_authtoken]
  14. ...
  15. auth_uri = http://controller01:5000
  16. auth_url = http://controller01:35357
  17. memcached_servers = controller01:11211
  18. auth_type = password
  19. project_domain_name = default
  20. user_domain_name = default
  21. project_name = service
  22. username = nova
  23. password = nova
  24. [vnc]
  25. ...
  26. enabled = True
  27. vncserver_listen = 0.0.0.0
  28. vncserver_proxyclient_address = $my_ip
  29. novncproxy_base_url = http://controller01:6080/vnc_auto.html
  30. [glance]
  31. ...
  32. api_servers = http://controller01:9292
  33. [oslo_concurrency]
  34. ...
  35. lock_path = /var/lib/nova/tmp

Finalize installation

判断一下我们的硬件是否支持 hardware acceleration for virtual machines

  1. egrep -c '(vmx|svm)' /proc/cpuinfo

如果返回0,说明不支持,则需要配置 libvirt 使用qeum 而不是kvm。

编辑 /etc/nova/nova.conf

  1. [libvirt]
  2. ...
  3. virt_type = qemu

启动libvirt 和 nova compute 并设置开机启动

  1. systemctl enable libvirtd.service openstack-nova-compute.service
  2. systemctl start libvirtd.service openstack-nova-compute.service

Verify operation

  1. . admin.openrc
  2. openstack compute service list

改名了应该能看到类似如下输出

  1. +----+--------------------+------------+----------+---------+-------+----------------------------+
  2. | Id | Binary | Host | Zone | Status | State | Updated At |
  3. +----+--------------------+------------+----------+---------+-------+----------------------------+
  4. | 1 | nova-consoleauth | controller | internal | enabled | up | 2016-02-09T23:11:15.000000 |
  5. | 2 | nova-scheduler | controller | internal | enabled | up | 2016-02-09T23:11:15.000000 |
  6. | 3 | nova-conductor | controller | internal | enabled | up | 2016-02-09T23:11:16.000000 |
  7. | 4 | nova-compute | compute1 | nova | enabled | up | 2016-02-09T23:11:20.000000 |
  8. +----+--------------------+------------+----------+---------+-------+----------------------------+

openstack setup demo Compute service的更多相关文章

  1. openstack setup demo Image service

    Image service (glance)是openstack中管理vm image的service.本文包含以下内容: overview install overview glance包含以下部分 ...

  2. openstack setup demo Identity service

    openstack Identity service 名叫keystone.它提供了用户校验,以及服务目录查询(即列出所有的服务以及相关信息)等功能. keystone 主要包含以下几个部分 Serv ...

  3. openstack setup demo 前言

    我们搭建一套三节点的openstanck集群.一个controller节点,两个compute节点.操作系统采用Centos7,操作系统版本信息如下. [root@controller01 ~]# c ...

  4. openstack setup demo Enviroment

    Enviroment 本文包含以下部分. Host networking Network Time Protocol (NTP) OpenStack packages SQL database NoS ...

  5. openstack setup demo Overview

    Overview openstack是一套开源的云计算部署平台,通过一系列service提供IAAS.每一个service都提供API.具体的service列表如下: dashboard Horizo ...

  6. Openstack组件部署 — Netwotking service组件介绍与网络基本概念

    目录 目录 前文列表 Openstack Networking serivce 基本的Neutron概念 Neutron的抽象对象 网络networks 子网subnets 路由器routers 端口 ...

  7. OpenStack之七: compute服务(端口8774)

    注意此处的bug,参考o版 官网地址 https://docs.openstack.org/nova/stein/install/controller-install-rdo.html 控制端配置 # ...

  8. Inno Setup for Windows service

    Inno Setup for Windows service? up vote86down votefavorite 77 I have a .Net Windows service. I want ...

  9. openstack compute service list Unable to establish connection to http://controller:8774/v2.1/os-services: ('Connection aborted.', BadStatusLine("''",))

    8774是nova的端口号,所以我就逐一查看nova的日志文件. tail -f /var/log/nova/nova-conductor.log 2019-06-13 08:24:53.559 44 ...

随机推荐

  1. Scala基础篇-04 try表达式

    1.try表达式 定义 try{} catch{} finally{} //例子 try{ Integer.parseInt("dog") }catch { }finally { ...

  2. linux下svn安装(ALI ECS)

    yum安装svn 搭建和使用SVN 可参考阿里云文档:https://help.aliyun.com/document_detail/52864.html?spm=5176.8208715.110.1 ...

  3. tomcat不打印日志

    commons-logging.jar导入这个包到tomcat  lib下 2.修改tomcat的bin目录下面的catalina.bat文件   只需修改:set CLASSPATH=%CLASSP ...

  4. Relational Algebra 关系代数

    Relational Algebra Relational Algebra is the mathematical basis for the query language SQL Introduct ...

  5. ubuntulinux 更改时区设置时间

    Linux/shell命令的实际应用——查看并修改系统时区 命令: www.2cto.com date -R //查询当前系统时间与默认时区 cp /usr/share/zoneinfo/Asia/S ...

  6. delphi byte to of set

    最佳方案 type // Controls.TCMMouseWheel relies on TShiftState not exceeding 2 bytes in size TShiftState ...

  7. returnFloat_thousand() 以万计数 ,如100,结果是0.01

    function returnFloat_thousand(value){ var value=Math.ceil(Math.round(parseFloat(value)*100)/100)/100 ...

  8. 【design pattern】代理模式

    前言 设计模式分为三大类: 创建型模式:工厂方法模式.抽象工厂模式.单例模式.建造者模式.原型模式: 结构型模式:适配器模式.装饰器模式.代理模式.外观模式.桥接模式.组合模式.享元模式: 行为型模式 ...

  9. oracle亲手安装过程

    适用于centos6 radhat6版本 1.检查依赖库: rpm -q binutils compat-libcap1 compat-libstdc++ compat-libstdc++.i686 ...

  10. (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on d

    出现redis错误: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to p ...