openstack 组件通讯是通过ZeroMQ+ceilometer发送组件调用信息,具体是通过TCP通讯,发送数据和接收数据是用同一个端口(在配置文件指定),下面通过代码稍作解析:

IceHouse/ceilometer/ceilometer/openstack/common/rpc/impl_zmq.py

def _multi_send(method, context, topic, msg, timeout=None,
envelope=False, _msg_id=None):
"""Wraps the sending of messages. Dispatches to the matchmaker and sends message to all relevant hosts.
"""
conf = CONF
LOG.debug(_("%(msg)s") % {'msg': ' '.join(map(pformat, (topic, msg)))}) queues = _get_matchmaker().queues(topic)
LOG.debug(_("Sending message(s) to: %s"), queues) # Don't stack if we have no matchmaker results
if not queues:
LOG.warn(_("No matchmaker results. Not casting."))
# While not strictly a timeout, callers know how to handle
# this exception and a timeout isn't too big a lie.
raise rpc_common.Timeout(_("No match from matchmaker.")) # This supports brokerless fanout (addresses > 1)
for queue in queues:
(_topic, ip_addr) = queue
_addr = "tcp://%s:%s" % (ip_addr, conf.rpc_zmq_port) if method.__name__ == '_cast':
eventlet.spawn_n(method, _addr, context,
_topic, msg, timeout, envelope,
_msg_id)
return
return method(_addr, context, _topic, msg, timeout,
envelope)

debug日志:/var/log/ceilometer/compute.log

compute.log:-- ::58.972  DEBUG ceilometer.openstack.common.rpc.common [-] Sending message(s) to: [(u'metering.ceilometer', u'ceilometer')] _multi_send /usr/lib/python2./site-packages/ceilometer/openstack/common/rpc/impl_zmq.py:
compute.log:-- ::58.982 DEBUG ceilometer.openstack.common.rpc.common [-] Sending message(s) to: [(u'metering.ceilometer', u'ceilometer')] _multi_send /usr/lib/python2./site-packages/ceilometer/openstack/common/rpc/impl_zmq.py:

1. conf.rpc_zmq_port是通过/etc/nova/nova.conf中指定的,也即是nova服务(/usr/bin/oslo-messaging-zmq-receiver)启动的监听端口:

[root@test1 ceilometer]# netstat -lntp | grep
tcp 192.168.213.202: 0.0.0.0:* LISTEN /haproxy
tcp 192.168.213.88: 0.0.0.0:* LISTEN /python
[root@test1 ceilometer]# ps -ef | grep
nova May13 ? :: /usr/bin/python /usr/bin/oslo-messaging-zmq-receiver --config-file /etc/nova/nova.conf
root : pts/ :: grep

2. 通过上面代码可以看到nova与ceilometer通讯的指定的目的端口也是rpc_zmq_port,由此可以得出,在all in one环境中,需要对cinder、nova、neutron和ceilometer做端口转发,才能在不修改源码的基础上做到组件之间通讯(组件与ceilometer建立tcp连接),用haproxy:

/etc/haproxy/haproxy.cfg

#/etc/haproxy/haproxy.cfg

#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log /dev/log local2 chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 32768
user haproxy
group haproxy
daemon # turn on stats unix socket
stats socket /var/lib/haproxy/stats #---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode tcp
log global
#option httplog
option dontlognull
#option http-server-close
#option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 32768 listen haproxy_stats
bind *:8888
mode http
stats uri /
#stats refresh 5
# stats realm HAproxy\ stats
# stats auth admin:admin listen zmq-cinder
bind 192.168.213.202:9501
mode tcp
#log 127.0.0.1 local2
balance roundrobin
server test1 192.168.213.88:9500 listen zmq-nova
bind 192.168.213.202:9502
mode tcp
#log 127.0.0.1 local2
balance roundrobin
server test1 192.168.213.88:9500 listen zmq-neutron
bind 192.168.213.202:9505
mode tcp
#log 127.0.0.1 local2
balance roundrobin
server test1 192.168.213.88:9500 listen zmq-ceilometer
bind 192.168.213.202:9500
mode tcp
#log 127.0.0.1 local2
balance roundrobin
server test1 192.168.213.88:9500

3. 建立TCP连接时指定目的IP是在nova配置文件的[matchmaker_ring]模块中指定:

[matchmaker_ring]
ringfile = /etc/nova/matchmaker_ring.json
{
"conductor":["test1"],
"scheduler":["test1"],
"compute": ["test1"],
"cert": ["test1"],
"consoleauth":["test1"],
"backendtask":["test1"],
"metering": ["ceilometer"],
"notifications-info": ["ceilometer"],
"notifications-error": ["ceilometer"]
}

openstack组件通讯端口定义的更多相关文章

  1. openstack项目【day23】:openstack组件介绍

    本节内容 openstack介绍 openstack项目(服务名是项目名的别名) openstack运行流程 openstack各组件详解 一:openstack介绍             open ...

  2. Angular6 基础(数据绑定、生命周期、父子组件通讯、响应式编程)

    Angular相比于vue来说,更像一个完整的框架,本身就集成了很多模块,如路由,HTTP,服务等,而vue是需要另外引入比如(vuex,axios等).Angular引入了依赖注入.单元测试.类等后 ...

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

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

  4. Openstack组件实现原理 — OpenVswitch/Gre/vlan

    目录 目录 前文提要 Neutron 管理的网络相关实体 OpenVswitchOVS OVS 的架构 VLan GRE 隧道 Compute Node 中的 Instance 通过 GRE 访问 P ...

  5. openstack组件之keystone

    一 什么是keystone keystone是 OpenStack Identity Service 的项目名称.它在整个体系中充当一个授权者的角色. Keystone项目的主要目的是给整个opens ...

  6. openstack组件手动部署整合

    preface:当你完全且正确的配置好整个OpenStack ENV 你将能看到的和体验到的!!! 我们先来看看简单效果吧,祝君能在这条路上走的更远,更好;

  7. COM口,串行通讯端口,RS-232接口 基础知识

    COM口即串行通讯端口. COM口的接口标准规范和总线标准规范是RS-232,有时候也叫做RS-232口.电脑上的com口多为9针,最大速率115200bps.通常用于连接鼠标(串口)及通讯设备(如连 ...

  8. 【Vue】Vue中的父子组件通讯以及使用sync同步父子组件数据

    前言: 之前写过一篇文章<在不同场景下Vue组件间的数据交流>,但现在来看,其中关于“父子组件通信”的介绍仍有诸多缺漏或者不当之处, 正好这几天学习了关于用sync修饰符做父子组件数据双向 ...

  9. seventBus(封装) 一个巧妙的解决vue同级组件通讯的思路

    如果在你项目中需要多处用到同级组件通讯,而又不想去写繁琐的vuex,可以参考这个小思路.本人在写项目中琢磨出来的,感觉挺好用,分享一下. 1.在utils文件夹下添加BusEvent.js 注释已经很 ...

随机推荐

  1. [Android Traffic] 看无线电波如何影响网络操作]

    转载自: http://blog.csdn.net/kesenhoo/article/details/7391031 Optimizing Downloads for Efficient Networ ...

  2. [Java基础] Java多线程-工具篇-BlockingQueue

    转载自: http://www.cnblogs.com/jackyuj/archive/2010/11/24/1886553.html 前言: 在新增的Concurrent包中,BlockingQue ...

  3. python3发送html格式的邮件

    def send_mail(to_list, sub, content, attpath): me = "*******" + "<" + mail_us ...

  4. Kubernetes概念介绍和v1版本部署过程

    简介: k8s一个开源的,跨主机管理容器应用集群的编排系统,为应用提供了基础的部署.维护和扩缩容机制. 编排:跨Docker主机同一管理容器集群. 目的 简化开发和运维容器集群的工作. 让开发和运维能 ...

  5. 【招聘App】—— React/Nodejs/MongoDB全栈项目:信息完善&用户列表

    前言:最近在学习Redux+react+Router+Nodejs全栈开发高级课程,这里对实践过程作个记录,方便自己和大家翻阅.最终成果github地址:https://github.com/66We ...

  6. Django——django1.6 基于类的通用视图

    最初 django 的视图都是用函数实现的,后来开发出一些通用视图函数,以取代某些常见的重复性代码.通用视图就像是一些封装好的处理器,使用它们的时候只须要给出特定的参数集即可,不必关心具体的实现.各种 ...

  7. Oracle 查询搜索字符串在哪些存储过程中包含

    如下: select *from all_source where OWNER = 'LC0019999'and TEXT like '%insert into%d values(%'

  8. C#创建一个Window服务

    Window服务介绍 Microsoft Windows 服务能够创建在它们自己的 Windows 会话中可长时间运行的可执行应用程序.这些服务可以在计算机启动时自动启动,可以暂停和重新启动而且不显示 ...

  9. 改变Prompt默认路径,Change Default Visual Studio Command Prompt Location

    在项目中经常需要使用 Visual Studio Command Prompt编译项目,每次启动时都是默认进入 C:\windows\system32> 目录, 需要cd切换路径,如果把Visu ...

  10. android之ScrollView里嵌套ListView(转)

    hi,大家好,研究完ScrollView嵌套ScrollView之后,本人突然又想研究ScrollView里嵌套ListView了. 如果还不知道ScrollView嵌套ScrollView是怎么实现 ...