英文:
Golang and NSQ (bitly)
问题
我是你的中文翻译助手,以下是翻译好的内容:
我是一个新手,但是我似乎找不到任何示例或帮助。我有一个正常运行的NSQ实例,可以注册任务、消费者等等。不幸的是,我最初没有设置这个系统。我想要做的是找出如何激活NSQ提供的一些内置命令行工具(如nsq_to_file、nsq_tail等)。我找到了关于如何启动它们的文档,但不知道从哪里启动它们。
当我尝试运行nsq_tail --channel=MyTestChannel --topic=test --lookupd-http-address=127.0.0.1:4161
时,显示"nsq_tail: command not found"。我唯一知道的是,在我们的情况下,NSQ是由Docker管理的。任何帮助或指导都将非常棒。谢谢!
英文:
So kind of a noob here but I can't seem to find any examples or help anywhere. I have a working instance of NSQ, can register tasks, consumers, etc. Unfortunately I did not originally set the system up. What I am trying to do is figure out how to activate some of the built in command line tools that NSQ offers ( nsq_to_file, nsq_tail, etc. ). I found documentation on how to fire them but have no idea where to fire them from.
When I try nsq_tail --channel=MyTestChannel --topic=test --lookupd-http-address=127.0.0.1:4161
i get nsq_tail command not found. The only other thing I know is that NSQ is managed by docker in our circumstance. Any help / a shove in the right direction would be awesome. Thanks!
答案1
得分: 5
我做了一些调查并回答了自己的问题。希望这对某人有所帮助,因为文档实际上并不存在:
- 通过查看仪表板确保 NSQ 正在运行:localhost:4171
- 安装 NSQ 库(与 nsq-go 不同)
go get github.com/bitly/nsq
- 安装 godep,bitly 管理依赖项的方式
go get github.com/tools/godep
- 进入 bitly 源代码目录
cd $GOPATH/src/github.com/bitly
- 使用 Docker 编译和测试 nsq 命令行工具
sudo docker build nsq
- 你应该看到大约运行了 5 或 6 个步骤,然后是一系列的测试和成功消息。
- 运行
nsq_tail
,你应该看到类似于--topic is required
的内容 - 鼓掌吧,你刚刚安装了 NSQ 的命令行工具。
如果你没有安装 Docker,可能还需要安装它,上面没有提到,但是提供给你参考。
英文:
Did some digging and answered my own question. Hopefully this helps someone since the docs dont really exist:
- Make sure NSQ is running by checking out the dashboard: localhost:4171
- Install the NSQ library (different than nsq-go)
go get github.com/bitly/nsq
- Install godep, how bitly manages dependencies
go get github.com/tools/godep
- Go to bitly src directory
cd $GOPATH/src/github.com/bitly
- Use docker to compile and test the nsq command line tools
sudo docker build nsq
- You should see about 5 or 6 steps run followed by a schlew of tests and a success message.
- Run
nsq_tail
you should see something along the lines of--topic is required
- Clap your hands, you just installed the command line tools for NSQ.
Might also need to install docker if you don't have it, not referenced above but FYI.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论