openstack组件通讯端口定义
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组件通讯端口定义的更多相关文章
- openstack项目【day23】:openstack组件介绍
本节内容 openstack介绍 openstack项目(服务名是项目名的别名) openstack运行流程 openstack各组件详解 一:openstack介绍 open ...
- Angular6 基础(数据绑定、生命周期、父子组件通讯、响应式编程)
Angular相比于vue来说,更像一个完整的框架,本身就集成了很多模块,如路由,HTTP,服务等,而vue是需要另外引入比如(vuex,axios等).Angular引入了依赖注入.单元测试.类等后 ...
- Openstack组件部署 — Netwotking service组件介绍与网络基本概念
目录 目录 前文列表 Openstack Networking serivce 基本的Neutron概念 Neutron的抽象对象 网络networks 子网subnets 路由器routers 端口 ...
- Openstack组件实现原理 — OpenVswitch/Gre/vlan
目录 目录 前文提要 Neutron 管理的网络相关实体 OpenVswitchOVS OVS 的架构 VLan GRE 隧道 Compute Node 中的 Instance 通过 GRE 访问 P ...
- openstack组件之keystone
一 什么是keystone keystone是 OpenStack Identity Service 的项目名称.它在整个体系中充当一个授权者的角色. Keystone项目的主要目的是给整个opens ...
- openstack组件手动部署整合
preface:当你完全且正确的配置好整个OpenStack ENV 你将能看到的和体验到的!!! 我们先来看看简单效果吧,祝君能在这条路上走的更远,更好;
- COM口,串行通讯端口,RS-232接口 基础知识
COM口即串行通讯端口. COM口的接口标准规范和总线标准规范是RS-232,有时候也叫做RS-232口.电脑上的com口多为9针,最大速率115200bps.通常用于连接鼠标(串口)及通讯设备(如连 ...
- 【Vue】Vue中的父子组件通讯以及使用sync同步父子组件数据
前言: 之前写过一篇文章<在不同场景下Vue组件间的数据交流>,但现在来看,其中关于“父子组件通信”的介绍仍有诸多缺漏或者不当之处, 正好这几天学习了关于用sync修饰符做父子组件数据双向 ...
- seventBus(封装) 一个巧妙的解决vue同级组件通讯的思路
如果在你项目中需要多处用到同级组件通讯,而又不想去写繁琐的vuex,可以参考这个小思路.本人在写项目中琢磨出来的,感觉挺好用,分享一下. 1.在utils文件夹下添加BusEvent.js 注释已经很 ...
随机推荐
- supervisord的环境变量的设置
在python中引用jar包,使用java的功能,需要使用三方包:pyjnius from jnius import autoclass 需要java环境,因此需要设置JAVA_HOME环境变量. 但 ...
- GPU Instance
http://forum.china.unity3d.com/thread-17131-1-1.html https://docs.unity3d.com/Manual/GPUInstancing.h ...
- Kubernetes用户指南(三)--在生产环境中使用Pod来工作、管理部署
一.在生产环境中使用Pod来工作 本节将介绍一些在生产环境中运行应用非常有用的功能. 1.持久化存储 容器的文件系统只有当容器正常运行时有效,一旦容器奔溃或者重启,所有对文件系统的修改将会丢失,从一个 ...
- easyui required 提交验证
使用easyui时,对于提交验证,不不过在标签属性中加入data-options=required:true这句话这么来的.还须要另外加上才写东西能够把验证完整实现 1.设置from的属性 <f ...
- ajax乱码解决总结
第一,javascript沿用java的字符处理方式,内部是使用unicode来处理所有字符的,第二,utf-8是每个汉字(unicode字符)用3个字节来存储.第三,用utf-8来send数据是不会 ...
- Odoo8中“更多”下拉菜单选项指定后台执行代码
在Odoo8中的仓库模块,根据每日最小安全库存数量,系统会自动生成一些补货单,而且是一个产品会生成一笔,如果产品比较多,这里生成的补货单也会很多. 如果这里的补货单没有即时处理,那相同产品后续不会再生 ...
- ODOO翻译导出窗口修正
当你辛苦修正odoo的翻译,想把它导出到其它系统的时候, 你会发现导出向导窗口无法显示下拉列表. 下面的方法修正此问题: 1.打开"开发者模式". 2.去到翻译导出向导:设置 - ...
- ijkPlayer 集成
代码地址如下:http://www.demodashi.com/demo/11957.html 概述 ijkplayer 是一款做视频直播的框架,基于FFmpeg,支持Android和iOS.这里介绍 ...
- cocos2d-x 3.0rc2版公布了
本人博客地址,转载吧亲们:http://blog.csdn.net/dawn_moon 之前做小鸟的和跑酷的时候尽管cocos2d-x出了3.0版,可是还是alpha版.当时大致看了一下发现有蛮多修改 ...
- Centos下Subversion 服务器安装配置
1.安装 # yum install subversion 2. svn配置 建立svn版本库目录可建多个:2.1 新建文件夹: # mkdir -p /opt/svndata/repos 2.2 建 ...