nsq 初试

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

posted on 2019-01-17 09:51  studyphp  阅读(543)  评论(0编辑  收藏  举报

导航