This is a creation in Article, where the information may have evolved or changed.
Because business needs, need to use NSQ. So I learned the next NSQ. First is the installation, I am on my own computer, tend to source code installation. The first is the source installation can install the latest code, the second is the entire installation process can be controlled.
However, some pits were encountered during the installation. Mainly I am not particularly familiar with Go and some derivative tools, and in the online search of articles, are copied to copy a lot of is not solve my problem. So I record the whole installation process, give myself a memo, give others a convenience.
Install Go
NSQ is written with go, so before installing NSQ, install go first.
I'll give you a command to install a specific procedure here. For specific reference I wrote another article from scratch to learn go--installation.
echo "export GOROOT=$HOME/.golang/go" >> ~/.bash_profileecho "export GOPATH=$HOME/.golang/path" >> ~/.bash_profileecho "export PATH=$PATH:$HOME/.golang/go/bin" >> ~/.bash_profileecho "export GOROOT_BOOTSTRAP=$HOME/.golang/go1.4" >> ~/.bash_profilesource ~/.bash_profilecd ~mkdir .golanggit clone https://github.com/golang/go.git gocp -r go go1.4cd go1.4git checkout -b release-branch.go1.4 origin/release-branch.go1.4cd src./make.bashcd ../../gogit checkout -b release-branch.go1.8 origin/release-branch.go1.8 #可以根据需要选择合适的版本cd src./make.bashgo version
Installing DEP
Since NSQ uses DEP as the package management tool, we also need to install this tool.
go get -u github.com/golang/dep/cmd/dep
go get
is the official Go package management tool. After executing this command, we will find that the $HOME/.golang/go/bin
executable file can be found in dep
.
Installing NSQ
The preparations were finished, and we formally started to install the NSQ. Here is an official document that you can look at. Http://nsq.io/deployment/installing.html.
git clone https://github.com/nsqio/nsq $GOPATH/src/github.com/nsqio/nsqcd $GOPATH/src/github.com/nsqio/nsqdep ensure
The official website has written this step. Then I found out that I couldn't find the executable file for NSQ anywhere. Then I all kinds of posture online search, the results found nothing soft. So I studied the files in the directory carefully and found a Makefile
file. Open a look, found that need make a bit to be able. So we need to do the following step more.
make
Well, the NSQ will be installed.