Openstack中RabbitMQ RPC代碼分析


在Openstack中,RPC調用是通過RabbitMQ進行的。

任何一個RPC調用,都有Client/Server兩部分,分別在rpcapi.py和manager.py中實現。

這里以nova-scheduler調用nova-compute為例子。

nova/compute/rpcapi.py中有ComputeAPI

nova/compute/manager.py中有ComputeManager

兩個類有名字相同的方法,nova-scheduler調用ComputeAPI中的方法,通過底層的RabbitMQ,就能到達nova-compute的ComputeManager中的方法。

本文主要分析這個過程。

ComputeAPI.run_instance()的調用過程如下:

image

nova-compute監聽消息,將消息dispatch到ComputeManager的run_instance()方法。

image


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM