nsqlookupd tcp 4160 http 4161
nsqd 4150
nsqadmin 4171

1:安装
$ brew install nsq
1) 停止nsq默认的启动
$ brew services stop nsq

2:运行nsqlookupd
$ nsqlookupd

3:运行nsqd
$ nsqd --lookupd-tcp-address=127.0.0.1:4160

4:运行nsqadmin
$ nsqadmin --lookupd-http-address=127.0.0.1:4161

5:推送一条消息并创建一个topic
$ curl -d 'hello world 1' 'http://127.0.0.1:4151/pub?topic=test'

6:运行nsq_to_file
$ nsq_to_file --topic=test --output-dir=/tmp --lookupd-http-address=127.0.0.1:4161

7:推送更多的消息
$ 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'

 

 来源:

中文翻译:http://wiki.jikexueyuan.com/project/nsq-guide/nsqd.html

英文原文:https://nsq.io/overview/quick_start.html

相关文章:

  • 2022-12-23
  • 2021-09-26
  • 2021-11-28
  • 2021-12-26
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2021-09-20
  • 2021-06-20
  • 2022-12-23
  • 2021-10-20
相关资源
相似解决方案