example/

directory
v0.0.0-...-e2ed998 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2020 License: MIT

README

Example

Gonsq example will run following components:

  • Producer
  • Consumer
  • NSQD
  • NSQLookupD
  • NSQAdmin
  • Prometheus
  • Grafana

To run the example, run:

docker-compose up -d

Or, to always rebuild the image:

make compose-up

Then run:

docker ps

For example, this list of containers should be running:

❯ docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                                                                            NAMES
868cf41e46bb        example_nsq_producer      "./producer --nsq.to…"   8 seconds ago       Up 6 seconds                                                                                         example_nsq_producer_1_2bc42d4afa60
687f3927fd8d        nsqio/nsq:v1.2.0          "/nsqd --lookupd-tcp…"   9 seconds ago       Up 7 seconds        4160-4161/tcp, 4170-4171/tcp, 0.0.0.0:32795->4150/tcp, 0.0.0.0:32794->4151/tcp   example_nsqd_1_1d6e17cbac11
1841d9772ff2        nsqio/nsq:v1.2.0          "/nsqadmin --lookupd…"   9 seconds ago       Up 7 seconds        4150-4151/tcp, 4160-4161/tcp, 4170/tcp, 0.0.0.0:4171->4171/tcp                   example_nsqadmin_1_a335e2024df1
f2cf1dd72d25        example_nsq_consumer      "./consumer --server…"   9 seconds ago       Up 7 seconds        0.0.0.0:9000->9000/tcp                                                           example_nsq_consumer_1_52f2a7e7d81c
c4060bfd0614        prom/prometheus:v2.18.1   "/bin/prometheus --c…"   10 seconds ago      Up 8 seconds        0.0.0.0:9090->9090/tcp                                                           prometheus
bf28e539bc7b        grafana/grafana:7.0.1     "/run.sh"                10 seconds ago      Up 8 seconds        0.0.0.0:3000->3000/tcp                                                           example_grafana_1_14b67bbddaac
e285d7355e5c        nsqio/nsq:v1.2.0          "/nsqlookupd"            10 seconds ago      Up 8 seconds        4150-4151/tcp, 4170-4171/tcp, 0.0.0.0:32793->4160/tcp, 0.0.0.0:32792->4161/tcp   example_nsqlookupd_1_2b745ef6ca19

To stop the example, run:

docker-compose down

Accessing The Services

To access NSQAdmin, access: http://localhost:4171

To access Prometheus, access: http://localhost:9090

To access NSQ Consumer metrics: access: http://localhost:9080/metrics

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL