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. 本机搭建PHP环境全教程(图文)

    为了更好的维护空间网站,研究和调试PHP程序,许多人需要在自己的计算机内搭建PHP环境.本文将介绍使用phpnow环境组件搭建的全过程.使用搜索工具,搜索phpnow<ignore_js_op& ...

  2. 常见社工破解WPA2密码方法及防范措施

    0×00前言 何为社工?社工是一种通过利用受害者心理弱点,如本能反应.好奇心.同情心.信任.贪婪等进行诸如欺骗.盗取.控制等非法手段的一种攻击方式.在无线安全中也可以利用社工做到许多非法操作.下面举几 ...

  3. Linux GPRS模块问题

    这是一个硬件问题,不过被我这个学软件的给遇到了.很尴尬,纠结了很久. GPRS模块如果没有插上sim卡,开机之后一切正常.一旦插上卡之后开机大约过十秒钟之后会自动关机.并在串口上面打印一下信息: II ...

  4. 在Docker中从头部署自己的Spark集群

    由于自己的电脑配置普普通通,在VM虚拟机中搭建的集群规模也就是6个节点左右,再多就会卡的不行 碰巧接触了Docker这种轻量级的容器虚拟化技术,理论上在普通PC机上搭建的集群规模可以达到很高(具体能有 ...

  5. IP地址转化为32位无符号数

    转自 http://blog.csdn.net/testcs_dn/article/details/38585719 一.将ip地址转成long数值 将IP地址转化成整数的方法如下: 1.通过Stri ...

  6. 【千纸诗书】—— PHP/MySQL二手书网站后台开发之基础知识

    前言: 在具体回顾每一个功能的实现前,还是有必要先温习一些项目涉及到的PHP.MySQL[语法基础].项目github地址:https://github.com/66Web/php_book_stor ...

  7. 转:使用gradle 构建编译程序

    https://rinvay.github.io/android/2015/04/09/Build-Android-with-Gradle/

  8. JavaScript操作dom总结

    最近一直忙于新项目,真的挺费心的 从产品原型.ui.接口.真心挺费心的.好多地方都不完善!(i want say F word!!) 基础的东西又需要重新看看了! Node Node.NodeType ...

  9. Linux信号(signal) 机制分析(转)

    [摘要]本文分析了Linux内核对于信号的实现机制和应用层的相关处理.首先介绍了软中断信号的本质及信号的两种不同分类方法尤其是不可靠信号的原理.接着分析了内核对于信号的处理流程包括信号的触发/注册/执 ...

  10. Phalcon 訪问控制列表 ACL(Access Control Lists ACL)

    Phalcon在权限方面通过 Phalcon\Acl 提供了一个轻量级的 ACL(訪问控制列表). Access Control Lists (ACL) 同意系统对用户的訪问权限进行控制,比方同意訪问 ...