采用docker
方式安装,编排文件docker-compose.yml
:
version: '3'
services:
nsqlookupd:
image: nsqio/nsq
networks:
- nsq-network
hostname: nsqlookupd
ports:
- "4161:4161"
- "4160:4160"
command: /nsqlookupd
nsqd:
image: nsqio/nsq
depends_on:
- nsqlookupd
hostname: nsqd
volumes:
- ./data:/data
networks:
- nsq-network
ports:
- "4151:4151"
- "4150:4150"
command: /nsqd --broadcast-address=nsqd --lookupd-tcp-address=nsqlookupd:4160 --data-path=/data
nsqadmin:
image: nsqio/nsq
depends_on:
- nsqlookupd
hostname: nsqadmin
ports:
- "4171:4171"
networks:
- nsq-network
command: /nsqadmin --lookupd-http-address=nsqlookupd:4161
networks:
nsq-network:
driver: bridge
说明
在docker-compose
版本>=25.0
以后,字段version
已被废弃