MENU

mac 安装 nsq

April 12, 2024 • MacOSX,linux相关

采用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已被废弃