harlow / nsqd-discovery

Dynamically configure NSQ with DNS entries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DNS config for NSQD

Dynamically configure nsqd with IP addresses from DNS A-record. Read more about NSQ dynamic service discovery with DNS records.

Set up

  1. Create a private zone in AWS Route 53
  2. Create a Record Set with an address
  3. Add an A record w/ a list of IP's for nsqlookupd

Note: Step 3 should be automated. When nsqlookupd boots the IP should be automatcially added to the above A record.

Command Line Options

-config-http-address=: <addr>:<port> of the HTTP config endpoint
-lookupd-dns-address=: <addr> of DNS A record that provides nsqlookupd IP Addresses
-lookupd-tcp-port=4160: <port> of nsqlookupd TCP address

Run

docker run --rm -it harlow/nsqd-discovery \
  --lookupd-dns-address $LOOKUPD_DNS_ADDRESS \
  --config-http-address $CONFIG_HTTP_ADDRESS

Development

After verifying the desired functionality build the docker image in preparation for deployment.

The image is around ~5MB. Thanks to this post from Travis Reeder.

make build

Deploy

make deploy

About

Dynamically configure NSQ with DNS entries

License:MIT License


Languages

Language:Go 93.0%Language:Shell 5.2%Language:Makefile 1.8%