NSQのDockerコンテナを立ち上げる
概要
- NSQをDockerで動かしてみる
コンテナ作成
docker-compose.yaml
- https://nsq.io/のドキュメントをそのまま利用してみる
version: '3.7' services: nsqlookupd: image: nsqio/nsq command: /nsqlookupd ports: - "4160" - "4161" nsqd: image: nsqio/nsq command: /nsqd --lookupd-tcp-address=nsqlookupd:4160 depends_on: - nsqlookupd ports: - "4150" - "4151" nsqadmin: image: nsqio/nsq command: /nsqadmin --lookupd-http-address=nsqlookupd:4161 depends_on: - nsqlookupd ports: - "4171"
コンテナ起動
docker-compose up -d
- NSQが起動した
docker-compose ps Name Command State Ports ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nsq-test_nsqadmin_1 /nsqadmin --lookupd-http-a ... Up 4150/tcp, 4151/tcp, 4160/tcp, 4161/tcp, 4170/tcp, 0.0.0.0:49157->4171/tcp,:::49157->4171/tcp nsq-test_nsqd_1 /nsqd --lookupd-tcp-addres ... Up 0.0.0.0:49156->4150/tcp,:::49156->4150/tcp, 0.0.0.0:49155->4151/tcp,:::49155->4151/tcp, 4160/tcp, 4161/tcp, 4170/tcp, 4171/tcp nsq-test_nsqlookupd_1 /nsqlookupd Up 4150/tcp, 4151/tcp, 0.0.0.0:49154->4160/tcp,:::49154->4160/tcp, 0.0.0.0:49153->4161/tcp,:::49153->4161/tcp, 4170/tcp, 4171/tcp
- NOTE: 起動直後のメモリ消費はそれぞれ3-4MB程度
設定メモ
NSQD
-tcp-address string
-http-address string
-https-address string
nsqlookupd
-tcp-address string
-http-address string
nsqadmin
-http-address string