go实现Event事件模型修正
msgpack代替json防止丢失类型

nats的安装docker方式

妙音 posted @ 2021年6月12日 12:02 in golang with tags nats , 1402 阅读

描述

    docker-compose方式启动nats-server。nats的镜像非常小, docker-cpomse进行管理。下面是配置方式
 

docker-compose.yaml配置 

 
version: "2"
services:
   nats-server:
       #image: provide/nats-server:latest
       image: nats:latest
       volumes:
           - ./nats-server.conf:/nats-server.conf
       ports:
           - 4222:4222
 

配置文件nats-server.conf

# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the gnatsd docker image to create one to an existing server.
  routes = []
}
 

启动

 
docker-compose -f docker-compose.yaml up/restart/start/stop
 
Avatar_small
sophia 说:
2023年6月19日 17:24

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. 인천출장마사지

Avatar_small
sophia 说:
2023年6月27日 10:26

Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. agencia seo

Avatar_small
sophia 说:
2023年8月21日 03:34

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work large rifle magnum primers

Avatar_small
sophia 说:
2023年8月29日 17:43

I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... เว็บแทงบอลดีที่สุดUFABET

Avatar_small
Dave 说:
2023年9月07日 03:35

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. bubble game

Avatar_small
sophia 说:
2023年9月09日 21:09

This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post. INDIAN VISA FOR GABON CITIZENS

Avatar_small
sophia 说:
2023年9月10日 15:14

This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post. fusion mushroom chocolate

Avatar_small
sophia 说:
2023年9月13日 21:56

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. GLUCOTRUST

Avatar_small
Dave 说:
2023年9月17日 12:03

This article was written by a real thinking writer. I agree many of the with the solid points made by the writer. I’ll be back. carport nz kitset

Avatar_small
Dave 说:
2023年10月09日 14:01

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. REGENERE DROPS

Avatar_small
Dave 说:
2023年11月14日 18:06

The packaging is like a guardian, ensuring the pencils are protected and always ready for action. natraj pencil packing job

Avatar_small
Dave 说:
2023年11月17日 00:08

I am unable to read articles online very often, but I’m glad I did today. This is very well written and your points are well-expressed. Please, don’t ever stop writing. temazepam kopen morgen in huis

Avatar_small
Dave 说:
2023年11月25日 14:16

I read that Post and got it fine and informative. 3m film

Avatar_small
Dave 说:
2023年12月20日 21:08

It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait reading. I am impressed with your work and skill. Thanks. Ladbrokes Casino

Avatar_small
Dave 说:
2023年12月21日 20:36

Wonderful article. Fascinating to read. I love to read such an excellent article. Thanks! It has made my task more and extra easy. Keep rocking. roket288

Avatar_small
Dave 说:
2023年12月24日 00:25

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. ausweis kaufen

Avatar_small
Dave 说:
2024年1月06日 22:12

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. acheter de la weed en ligne

Avatar_small
Dave 说:
2024年1月18日 21:37

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. plug play

Avatar_small
Dave 说:
2024年1月19日 20:09

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. automatic instagram likes monthly

Avatar_small
Dave 说:
2024年1月20日 23:38

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. automatic instagram likes monthly

Avatar_small
Dave 说:
2024年2月08日 22:11

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. acheter de la weed en ligne


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter