写点什么

2022-12-29:nsq 是 go 语言写的消息队列。请问 k3s 部署 nsq,yaml 如何写?

  • 2022-12-29
    北京
  • 本文字数:925 字

    阅读完需:约 3 分钟

2022-12-29:nsq是go语言写的消息队列。请问k3s部署nsq,yaml如何写?

2022-12-29:nsq 是 go 语言写的消息队列。请问 k3s 部署 nsq,yaml 如何写?


答案 2022-12-29:


yaml 如下:


apiVersion: apps/v1kind: Deploymentmetadata:  labels:    app: nsq  name: nsq  namespace: moonfddspec:  replicas: 1  selector:    matchLabels:      app: nsq  template:    metadata:      labels:        app: nsq    spec:      containers:        - image: "nsqio/nsq"          imagePullPolicy: IfNotPresent          name: nsqlookupd          args:            - "/nsqlookupd"        - image: "nsqio/nsq"          imagePullPolicy: IfNotPresent          name: nsqd          args:            - "/nsqd"            - "--lookupd-tcp-address"            - "localhost:4160"          volumeMounts:            - mountPath: /data              name: volv2        - image: "nsqio/nsq"          imagePullPolicy: IfNotPresent          name: nsqadmin          args:            - "/nsqadmin"            - "--lookupd-http-address"            - "localhost:4161"      volumes:        - hostPath:            path: /root/k8s/moonfdd/nsq/data            type: DirectoryOrCreate          name: volv2---apiVersion: v1kind: Servicemetadata:  labels:    app: nsq  name: nsq  namespace: moonfddspec:  ports:    - name: nsqlookupd0      port: 4160      protocol: TCP      targetPort: 4160    - name: nsqlookupd1      port: 4161      protocol: TCP      targetPort: 4161    - name: nsqd0      port: 4150      protocol: TCP      targetPort: 4150    - name: nsqd1      port: 4151      protocol: TCP      targetPort: 4151    - name: nsqadmin      port: 4171      protocol: TCP      targetPort: 4171  selector:    app: nsq  type: NodePort
复制代码

从 service 得知 web 端口和 curl 命令的端口

web 端口是 58395curl 命令端口是 36055


进入 web 页面,可以看到 topics 里啥都没有

敲 curl 命令,给 nsq 增加 topic,名称是 test

刷新 web 页面,可以看到 topics 里有 test 名称


发布于: 刚刚阅读数: 3
用户头像

还未添加个人签名 2021-02-15 加入

还未添加个人简介

评论

发布
暂无评论
2022-12-29:nsq是go语言写的消息队列。请问k3s部署nsq,yaml如何写?_云原生_福大大架构师每日一题_InfoQ写作社区