Technology at Flyclops

The easiest way to install NSQ on FreeBSD

posted in DevOps on 2015-05-15 19:38:27 UTC by Dave Martorana

This is the easiest way to install NSQ on FreeBSD. There are other, probably more proper ways of doing so, but it’s as close as you can get to the Linux install instructions.

First, you’ll need bash if you don’t already have it:

1
2
3
4
5
# Install BASH for installation
pkg install -y bash

# Install Go
pkg install -y go

Make sure you set up your Go paths:

1
2
3
# Set up Go paths
export GOPATH="<gopath>"
export PATH=$PATH:$GOPATH/bin

Next, install GPM, the package manager Bitly chose to use with NSQ. In order to install GPM and use it, you’ll need to temporarily mount fdescfs, the file-descriptor file system for FreeBSD. You don’t need this as a permanent mount, so I use it in the install script only:

1
2
3
4
5
6
# Install GPM
git clone https://github.com/pote/gpm.git gpm
cd gpm
git checkout -b v1.3.2
./configure
make install

Now that we have GPM set up, we can move to NSQ:

1
2
3
4
5
6
# Install
go get -d github.com/bitly/nsq || true
cd "$GOPATH/src/github.com/bitly/nsq"
git checkout -b v0.3.5
gpm install
go get ./...

That’s it. nsqd, nsqlookup, etc., will be in your $GOPATH/bin directory.

Tagged:
#nsq  #freebsd