Installs and configures NSQ.
Chef version 18+
- Ubuntu 22.04
Notes: This cookbook has been tested on the listed platforms only. It may work on other platforms with modification.
Each of the attributes come with a default setting. Read the files in the attributes/
directory for a full description of what each setting does along with its default value.
Includes the chef-nsq
recipe to install the base NSQ packages.
None.
There are 3 primary roles used for setting up NSQ:
name 'nsqadmin'
description 'nsqadmin'
run_list(
'recipe[nsq::nsqadmin]'
)
default_attributes(
nsq: {
version: '0.2.24',
go_version: 'go1.1.2'
}
)
name 'nsqd'
description 'nsqd'
run_list(
'recipe[nsq::nsqd]'
)
default_attributes(
nsq: {
version: '0.2.24',
go_version: 'go1.1.2'
}
)
name 'nsqlookupd'
description 'nsqlookupd'
run_list(
'recipe[nsq::nsqlookupd]'
)
default_attributes(
nsq: {
version: '0.2.24',
go_version: 'go1.1.2'
}
)
None
None
None
In the environment.rb file relevant to your environment, it is useful to specify the static hostnames of your lookup nodes. You can put these addresses in DNS to make replacement easier.
nsq: {
nsqd: {
lookupd_tcp_address: (1..3).map{|i| "lookup-00#{i}.nsq.example.com:4160" },
lookupd_http_address: (1..3).map{|i| "lookup-00#{i}.nsq.example.com:4161" },
statsd_interval: '60s'
}
}
Once you have setup the lookup servers, you can optionally setup nsqadmin. nsqadmin can easily be deployed to any host with a statsd graphite host optional. These attributes can also be set in your environment.
nsq: {
nsqadmin: {
statsd_interval: '60s',
graphite_url: 'http://graphite-001.example.com',
proxy_graphite: true,
}
}
After the lookup servers are up and running, you can setup nsqd. To add nsqd to any host, just add the role listed above to any other host role. This will install and setup nsqd with the default attributes to listen on localhost.
$ kitchen test
- Author:: Matt Reiferson snakes@gmail.com
- Author:: Eric Lubow elubow@simplereach.com
- Author:: John Dewey john@dewey.ws
- Author:: Jon Nappi moogar0880@gmail.com