<h1 id="%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2%EF%BC%9Ahttp%3A%2F%2Fwww.sskywatcher.com%2Fblog%2F">我的博客:<a href="http://www.sskywatcher.com/blog/">http://www.sskywatcher.com/blog/</a></h1>
<h1 id="%E7%BF%BB%E8%AF%91%E8%87%AAopenstack%E5%AE%98%E7%BD%91%E6%96%87%E7%AB%A0%EF%BC%8C%E8%8B%B1%E6%96%87%E5%8E%9F%E6%96%87%EF%BC%9Ahttps%3A%2F%2Fdocs.openstack.org%2Fnova%2Flatest%2Freference%2Frpc.html">翻译自openstack官网文章,英文原文:<a href="https://docs.openstack.org/nova/latest/reference/rpc.html">https://docs.openstack.org/nova/latest/reference/rpc.html</a></h1>
<p id="main-toc"><strong>目录</strong></p>
<p id="%E7%AE%80%E8%BF%B0-toc" style="margin-left:40px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#%E7%AE%80%E8%BF%B0">简述</a></p>
<p id="Nova%20RPC%20%E5%AF%BC%E8%A7%88-toc" style="margin-left:40px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Nova%20RPC%20%E5%AF%BC%E8%A7%88">Nova RPC 导览</a></p>
<p id="Topic%20Publisher-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Topic%20Publisher">Topic Publisher</a></p>
<p id="Direct%20Consumer-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Direct%20Consumer">Direct Consumer</a></p>
<p id="Topic%20Consumer-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Topic%20Consumer">Topic Consumer</a></p>
<p id="Direct%20Publisher-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Direct%20Publisher">Direct Publisher</a></p>
<p id="Topic%20Exchange-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Topic%20Exchange">Topic Exchange</a></p>
<p id="Direct%20Exchange-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Direct%20Exchange">Direct Exchange</a></p>
<p id="Queue%20Element-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Queue%20Element">Queue Element</a></p>
<p id="RPC%20Call%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B%E8%AF%A6%E8%A7%A3-toc" style="margin-left:40px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#RPC%20Call%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B%E8%AF%A6%E8%A7%A3">RPC Call调用流程详解</a></p>
<p id="RPC%20Cast%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B%E8%AF%A6%E8%A7%A3-toc" style="margin-left:40px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#RPC%20Cast%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B%E8%AF%A6%E8%A7%A3">RPC Cast调用流程详解</a></p>
<p id="AMQP%20Broker%20%E7%9A%84%E8%B4%9F%E8%BD%BD-toc" style="margin-left:40px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#AMQP%20Broker%20%E7%9A%84%E8%B4%9F%E8%BD%BD">AMQP Broker 的负载</a></p>
<p id="API%20%E8%B0%83%E7%94%A8%E7%9A%84%E5%90%9E%E5%90%90%E9%87%8F-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#API%20%E8%B0%83%E7%94%A8%E7%9A%84%E5%90%9E%E5%90%90%E9%87%8F">API 调用的吞吐量</a></p>
<p id="Workers%E7%9A%84%E6%80%BB%E4%B8%AA%E6%95%B0-toc" style="margin-left:80px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#Workers%E7%9A%84%E6%80%BB%E4%B8%AA%E6%95%B0">Workers的总个数</a></p>
<p id="%E4%BD%BF%E7%94%A8RabbitMQ%20%E7%9A%84%E4%B8%80%E4%BA%9B%E5%8F%82%E6%95%B0%E8%A7%A3%E9%87%8A-toc" style="margin-left:40px;"><a href="https://blog.csdn.net/bestjie01/article/details/83317081#%E4%BD%BF%E7%94%A8RabbitMQ%20%E7%9A%84%E4%B8%80%E4%BA%9B%E5%8F%82%E6%95%B0%E8%A7%A3%E9%87%8A">使用RabbitMQ 的一些参数解释</a></p>
<hr id="hr-toc">
<hr>
<h2 id="%E7%AE%80%E8%BF%B0"><span style="color:#86ca5e;">简述</span></h2>
<hr>
<p>AMQP 是OpenStack云管平台选用的消息队列系统。(默认是 RabbitMQ),位于任意两个Nova组件之间的AMQP broker允许他们以一个松耦合的方式进行通信。更严谨地说,Nova组件之间使用远程过程调用(Remote Procedure Calls ,下文中直接以RPC 简称)互相通信;这是基于publish/subscribe范例构建的,使用该模式能获得以下有利之处:</p>
<ul><li>客户端与服务端解耦;</li><li>异步调用(一个客户端发起的远程调用并不要求服务端同时工作).</li><li>对远程调用的的随机负载均衡(架设有多个服务端处于线上且正常工作, 单向的调用可以被透明的传递至第一个可用的服务端。</li></ul>
<p>Nova使用了direct、fanout以及topic-based三种类型的exchanges. 下图展示了其基本结构:</p>
<div style="text-align:center;">
<figure class="image">
<a href="https://docs.openstack.org/nova/latest/_images/rpc-arch.png"><img alt="../_images/rpc-arch.png" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-e34aed902014b036a50cb7c26a3c7dbe.png"></a>
<figcaption>
图1 NOVA中使用RPC的结构
</figcaption>
</figure>
</div>
<p>Nova 通过提供一个适配器的类来实现了基于AMQP的RPC (包括请求-回复型调用和单向调用,代表性的别名是<code>rpc.call</code>和 <code>rpc.cast</code>) ,这个类包括marshaling and unmarshaling of messages 到一个函数调用中。每一个Nova服务 (比如Compute, Scheduler等等) 都会在初始化的时候创建2个 |
|