Golang和NSQ(bitly)

huangapple go评论70阅读模式
英文:

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

我做了一些调查并回答了自己的问题。希望这对某人有所帮助,因为文档实际上并不存在:

  1. 通过查看仪表板确保 NSQ 正在运行:localhost:4171
  2. 安装 NSQ 库(与 nsq-go 不同)go get github.com/bitly/nsq
  3. 安装 godep,bitly 管理依赖项的方式go get github.com/tools/godep
  4. 进入 bitly 源代码目录cd $GOPATH/src/github.com/bitly
  5. 使用 Docker 编译和测试 nsq 命令行工具sudo docker build nsq
    • 你应该看到大约运行了 5 或 6 个步骤,然后是一系列的测试和成功消息。
  6. 运行 nsq_tail,你应该看到类似于 --topic is required 的内容
  7. 鼓掌吧,你刚刚安装了 NSQ 的命令行工具。

如果你没有安装 Docker,可能还需要安装它,上面没有提到,但是提供给你参考。

英文:

Did some digging and answered my own question. Hopefully this helps someone since the docs dont really exist:

  1. Make sure NSQ is running by checking out the dashboard: localhost:4171
  2. Install the NSQ library (different than nsq-go) go get github.com/bitly/nsq
  3. Install godep, how bitly manages dependencies go get github.com/tools/godep
  4. Go to bitly src directory cd $GOPATH/src/github.com/bitly
  5. 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.
  6. Run nsq_tail you should see something along the lines of --topic is required
  7. 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.

huangapple
  • 本文由 发表于 2014年8月30日 06:39:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/25577155.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定