nsq測試

打開一個終端,啟動nsqlookupd

1
# nsqlookupd --tcp-address=127.0.0.1:4160 --http-address=127.0.0.1:4161 --broadcast-address=127.0.0.1

再打開一個終端,啟動nsq

1
# nsqd --broadcast-address=127.0.0.1 -http-address=127.0.0.1:4151 --lookupd-tcp-address=127.0.0.1:4160 --tcp-address=127.0.0.1:4150
1
curl -d "hello world 1" "http://127.0.0.1:4151/put?topic=test"
1
# nsq_to_file --topic=test --output-dir=/home/work/nsq_log --lookupd-http-address=127.0.0.1:4161