安装 NATS 和 NATS Streaming
NATS 和 NATS Streaming 的最小化安装
# Single server NATS
kubectl apply -f https://raw.githubusercontent.com/nats-io/k8s/master/nats-server/single-server-nats.yml
kubectl apply -f https://raw.githubusercontent.com/nats-io/k8s/master/nats-streaming-server/single-server-stan.ymlkubectl run -i --rm --tty nats-box --image=synadia/nats-box --restart=Never
# Send message to NATS
nats-box:~# nats-sub -s nats hello &
Listening on [hello]
nats-box:~# nats-pub -s nats hello world
# Send/Receive message to STAN
nats-box:~# stan-pub -s nats -c stan hello world
Published [hello] : 'world'
nats-box:~# stan-sub -s nats -c stan hello
Connected to nats clusterID: [stan] clientID: [stan-sub]
Listening on [hello], clientID=[stan-sub], qgroup=[] durable=[]
[#1] Received: sequence:1 subject:"hello" data:"world" timestamp:1579544643374163630使用 StatefulSets 来配置高可用
使用 Helm Charts
最后更新于