ceilometer获取数据暂时先不做解答,本篇注重websocket解决浏览器与openstack组件之间的实时状态更新。

大致流程如下:

nginx配置的反向代理如下:

/etc/nginx/nginx.conf

include /etc/nginx/conf.d/*.conf;

/etc/nginx/conf.d/openstack.conf

upstream websocket_beijing {
server 192.168.213.88:4500;
} server {
listen 81;
#server_name horizon.plcloud.com; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location / {
include uwsgi_params;
uwsgi_pass unix:/var/run/uwsgi/openstack.sock;
}
location /static/{
alias /home/zzw/develop/horizon/static/;
}
} server {
listen 4600; location / {
proxy_pass http://websocket_beijing;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

日志说明:

/var/log/nginx/access.log #nginx访问日志

/var/log/nginx/error.log #nginx错误日志

uwsgi配置:

websocket.ini -> /home/zzw/develop/ceilometer/etc/ceilometer/websocket.ini

/etc/uwsgi/vassals/openstack.ini

# awcloud horizon uwsgi config file
[uwsgi] # Django-related settings
# the virtualenv (full path)
# home = /var/plcloud/horizon/.venv # the base directory (full path)
chdir = /home/zzw/develop/horizon/openstack_dashboard/wsgi
# Django's wsgi file
file = django.wsgi # maximum number of worker processes
processes = 4 # the socket (use the full path to be safe
socket = /var/run/uwsgi/%n.sock
# with appropriate permissions - may be needed
chmod-socket = 777
daemonize = /var/log/uwsgi/%n.log

日志说明:

/var/log/uwsgi/openstack.log

/var/log/uwsgi/websocket.log

redis配置订阅模式:

/etc/redis.conf

daemonize yes
pidfile /var/run/redis/redis.pid
port 6379
tcp-backlog 511
bind 0.0.0.0
timeout 0
tcp-keepalive 0
loglevel notice
logfile /var/log/redis/redis.log
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /var/lib/redis/
slave-serve-stale-data yes
slave-read-only yes
repl-disable-tcp-nodelay no
slave-priority 100
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

日志说明:

/var/log/redis/redis.log

ceilometer配置:

├── ceilometer.conf
├── ceilometertab.ini
├── matchmaker_ring.json
├── pipeline.yaml
├── policy.json
├── sources.json
└── templates
├── default.html
└── default.sms

日志说明:

├── agent-notification.log
├── alarm-evaluator.log
├── alarm-notifier.log
├── api.log
├── auditor.log
├── central.log
├── checker.log
├── collector.log
├── compute.log
├── websocket.log
└── zmq-receiver.log

配置过程报错集锦:

1. uwsgi缺少对openssl支持,/var/log/uwsgi/websocket.log 报错如下:

[pid: |app: |req: /] 192.168.216.48 () { vars in  bytes} [Thu Apr  :: ] GET /websocket?uid=33d5edff940f4812b5368e54499991e4&region=lab-test => generated  bytes in  msecs (HTTP/1.1 )  headers in  bytes ( switches on core )
you need to build uWSGI with SSL support to use the websocket handshake api function !!!

解决方法:重新编译uwsgi,支持openssl

cd uwsgi-2.0./
make
stop uwsgi
python setup.py install
start uwsgi

websocket数据流解析的更多相关文章

  1. WebSocket协议解析

    WebSocket协议解析 转载请注明出处:WebSocket解析 现在,很多网站为了实现推送技术,所用的技术都是轮询.轮询是指在特定的时间间隔(如每一秒),由浏览器对服务器发起HTTP请求,然后由服 ...

  2. iOS swift项目IM实现,从长连接到数据流解析分析之Socket

    iOS  swift项目IM实现,从长连接到底层数据解析分析之Socket 一:项目简介:  去年开始接手了一个国企移动项目,项目的需求是实现IM即时通讯功能. * 一期版本功能包括了:       ...

  3. Websocket 协议解析

    WebSocket protocol 是HTML5一种新的协议.它是实现了浏览器与服务器全双工通信(full-duplex).          现 很多网站为了实现即时通讯,所用的技术都是轮询(po ...

  4. 萌萌的websocket原理解析

    转载自:http://www.zhihu.com/question/20215561 一.WebSocket是HTML5出的东西(协议),也就是说HTTP协议没有变化,或者说没关系,但HTTP是不支持 ...

  5. 转载-WebSocket协议解析

    现在,很多网站为了实现推送技术,所用的技术都是轮询.轮询是指在特定的时间间隔(如每一秒),由浏览器对服务器发起HTTP请求,然后由服务器返回数据给浏览器.由于HTTP协议是惰性的,只有客户端发起请求, ...

  6. springMVC中数据流解析与装载

    最近在看springmvc原理时,看到一篇比较赞的博文,留存学习,如果侵权,请告知,立删. 地址: https://my.oschina.net/lichhao/blog/172562

  7. pdf 数据流解析

     根据这个解释可以认为,/CCITTFaxDecode应该指单色图像(每个像素占8位?还是1位),FlateDecode 指文字或者矢量图片(png) 参考论文:http://www.doc88.co ...

  8. 通讯框架 t-io 学习——websocket 部分源码解析

    前言 前端时间看了看t-io的websocket部分源码,于是抽时间看了看websocket的握手和他的通讯机制.本篇只是简单记录一下websocket握手部分. WebSocket握手 好多人都用过 ...

  9. WebSocket解析

    WebSocket解析 转载请注明出处:WebSocket解析 现在,很多网站为了实现推送技术,所用的技术都是轮询.轮询是指在特定的时间间隔(如每一秒),由浏览器对服务器发起HTTP请求,然后由服务器 ...

随机推荐

  1. IIS5/6/7 ASP.net 请求处理过程

    tks:http://www.cnblogs.com/TomXu/p/3756774.html 主要内容 本文讲解的是:服务器接受Http Request请求之后,是如何进入.Net CLR,从而进一 ...

  2. $apply用法注意

    Angular为我们提供了一些接口绑定JavaScript代码和数据,而绑定数据改变和更新angular则是使用$apply方法实现的. $apply 进行数据变化检查的实际上是$digest函数,但 ...

  3. centos搭建git服务器(转)

    一:git服务安装 1.安装git相关组件 [root@gitserver ~] yum -y install git 2.创建git用户 [root@gitserver ~] groupadd gi ...

  4. HDU 4287-Intelligent IME(哈希)

    Intelligent IME Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  5. Extjs grid 遍历store

    var projectMemberGrid = Ext.getCmp("projectMemberGrid"); var selFuns = []; projectMemberGr ...

  6. Openerp图片路径处理

    Openerp目前存储图片如人力资源头像图片等都是以二进制的方式存储在数据库中,若要修改数据库里只存储路径可以用这种方法 Image 装饰器: Image装饰器包含3中图片显示 Image 大图片 i ...

  7. (一)Linux——Linux基本概念

    Linux是一种自由和开放源码的类UNIX操作系统,使用Linux内核.目前存在着许多不同的Linux发行版,可安装在各种各样的电脑硬件设备,从手机.平板电脑.路由器和影音游戏控制台,到桌上型电脑,大 ...

  8. Python 的基本运算和内置函数

    一.运算符 (一)Python算术运算符 以下假设变量: a=10,b=20: 运算符 描述 实例 + 加 - 两个对象相加 a + b 输出结果 30 - 减 - 得到负数或是一个数减去另一个数 a ...

  9. Eclipse安装Properties Editore插件

    Properties Editor for Eclipse3[1].0-3.2安装使用-http://jzgl-javaeye.iteye.com/blog/386010 PropertiesEdit ...

  10. html 5 中的 6位 十六进制颜色码 代表的意思180313

    人的眼睛看到的颜色有两种: ⒈ 一种是发光体发出的颜色,比如计算机显示器屏幕显示的颜色: ⒉ 另一种是物体本身不发光,而是反射的光产生   的颜色,比如看报纸和杂志上的颜色. 我们又知道任何颜色都是由 ...