两台机器上分别创建docker-compose.yml
然后执行docker-compose up -d
version: '2'
services:
nsqlookupd:
image: nsqio/nsq
command: /nsqlookupd
ports:
- "192.168.174.130:4160:4160"
- "192.168.174.130:4161:4161"
nsqd:
image: nsqio/nsq
command: /nsqd --broadcast-address=192.168.174.130 --lookupd-tcp-address=192.168.174.130:4160
depends_on:
- nsqlookupd
ports:
- "192.168.174.130:4150:4150"
- "192.168.174.130:4151