NSQ入门记 -- 安装

安装

  1. 官方clone代码:

    git clone https://github.com/nsqio/nsq

  2. 安装包管理器gpm

    brew install gpm

  3. 切换到nsq目录,用gpm安装:

    gpm install
    go get github.com/nsqio/nsq/…

  4. 自测是否成功:

    ./test.sh

  5. 安装成功

由于官网提到,master分支可能不稳定,dev分支才是稳定版本,所以一心想尝试稳定版本的我就在安装dev版本上走远了。

Godeps中依赖的go包似乎都过于老旧,所以各种问题,如:

../../hashicorp/serf/command/agent/mdns.go:5:2: cannot find package "github.com/armon/mdns" in any of:
        /usr/local/go/src/github.com/armon/mdns (from $GOROOT)
        /Users/jiezhu/Documents/Project/go/src/github.com/armon/mdns (from $GOPATH)

本以为把mdns按serf依赖的版本安装上就OK了,没想到又来:

../../armon/mdns/client.go:4:2: cannot find package "code.google.com/p/go.net/ipv4" in any of:
        /usr/local/go/src/code.google.com/p/go.net/ipv4 (from $GOROOT)
        /Users/jiezhu/Documents/Project/go/src/code.google.com/p/go.net/ipv4 (from $GOPATH)
../../armon/mdns/client.go:5:2: cannot find package "code.google.com/p/go.net/ipv6" in any of:
        /usr/local/go/src/code.google.com/p/go.net/ipv6 (from $GOROOT)
        /Users/jiezhu/Documents/Project/go/src/code.google.com/p/go.net/ipv6 (from $GOPATH)

既然如此,还是试试master分支尝先吧,反正是学习,并不是工程~