07.计算Nova→1.nova架构→1.架构概览→5.Database和Message Queue

  1. Database:Nova 会有一些数据需要存放到数据库中,一般使用 MySQL。数据库安装在控制节点上。Nova 使用命名为 “nova” 的数据库。不知道为什么我的devstack里没有nova数据库???
    1.  1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      root@controller:~# su - stack
      stack@controller:~$ mysql
      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 172
      Server version: 5.7.26-0ubuntu0.16.04.1 (Ubuntu)
      
      Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
      
      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      mysql> SHOW DATABASES;
      +--------------------+
      | Database           |
      +--------------------+
      | information_schema |
      | cinder             |
      | glance             |
      | keystone           |
      | mysql              |
      | neutron            |
      | nova_api           |
      | nova_cell0         |
      | nova_cell1         |
      | performance_schema |
      | sys                |
      +--------------------+
      11 rows in set (0.03 sec)
  2. Message Queue:Nova 包含众多的子服务,这些子服务之间需要相互协调和通信。为解耦各个子服务,Nova 通过 Message Queue 作为子服务的信息中转站。所以在架构图上我们看到了子服务之间没有直接的连线,它们都通过 Message Queue 联系。Advanced Message Queuing Protocol

openstack通用设计思路:
  1. Messaging 服务
    1. 为什么不让 API 直接调用Scheduler,或是让Scheuler 直接调用 Compute,而是非要通过 Messaging 进行中转?
    2. 程序之间的调用通常分两种:同步调用和异步调用。
      1. API 直接调用 Scheduler 的接口就是同步调用。
        1. 其特点是 API 发出请求后需要一直等待,直到 Scheduler 完成对 Compute 的调度,将结果返回给 API 后 API 才能够继续做后面的工作。
      2. API 通过 Messaging 间接调用 Scheduler 就是异步调用。
        1. 其特点是 API 发出请求后不需要等待,直接返回,继续做后面的工作。
    3. 采用异步调用可以解耦各个自服务,即子服务不需要知道其他服务在哪里运行, 只需要发送消息给 Messaging 就能完成调用。并且提高性能,因为异步调用使得调用者无须等待结果返回。 这样可以继续执行更多的工作, 提高系统总的吞吐量。
  2. Database:OpenStack 各组件都需要维护自己的状态信息。比如 Nova 中有虚机的规格、状态,这些信息都是在数据库中维护的。每个 OpenStack 组件在 MySQL 中有自己的数据库。

猜你喜欢

转载自www.cnblogs.com/LeisureZhao/p/11238269.html
今日推荐