nsq 安装试用

因为是mac 系统安装试用brew install nsq

安装

brew  install nsq

组件说明

  • nsqd
守护进程进行消息的接受,缓存以及传递消息给客户端,需要配置nsqlookupd地址
  • nsqlookupd
守护进程,启动服务的发现,为消息者提供查找nsqd 生产者指定的topic
  • nsqadmin
一个可视化界面,方便进行nsq 的管理以及监控
  • 启动

  • nsqlookupd

nsqlookupd
  • nsqd
nsqd --lookupd-tcp-address=127.0.0.1:4160
  • nsqadmin
 nsqadmin --lookupd-http-address=127.0.0.1:4161
  • 发布初始化消息
curl -d 'hello world 1' 'http://127.0.0.1:4151/pub?topic=test'
  • 启动 nsq_to_file (client)
nsq_to_file --topic=test --output-dir=/tmp --lookupd-http-address=127.0.0.1:4161
  • 发送消息
curl -d 'hello world 2' 'http://127.0.0.1:4151/pub?topic=test'
curl -d 'hello world 3' 'http://127.0.0.1:4151/pub?topic=test'

参考截图



参考资料

https://nsq.io/overview/quick_start.html
https://nsq.io/overview/design.html

猜你喜欢

转载自www.cnblogs.com/rongfengliang/p/9221903.html
nsq