nats-streaming-server icon indicating copy to clipboard operation
nats-streaming-server copied to clipboard

Nats Clustering not working as expected with NATS Server 2.10.17

Open prateeeka-nadimpalli opened this issue 6 months ago • 1 comments

Observed behavior

We are trying recently to shift from using NATS streaming to directly the NATS server. However, we are encountering issues with clustering configuration as it appears to be missing from our current setup.

The current configuration file does not include any clustering details. Because of this connection from my app to NATS is failing as its trying to connect to cluster. I need to set up clustering for my NATS servers, but seems cluster details are not getting from service itself. Could you assist how can I set these configurations ?

Current Configuration File(NATS server config file):


{
"http_port": 8222,
"lame_duck_duration": "30s",
"lame_duck_grace_period": "10s",
"pid_file": "/var/run/nats/nats.pid",
"port": 4222,
"server_name": $SERVER_NAME
}

Expected behavior

File should be as shown as below

######################### NATS Streaming Config #########################
streaming {
id: test-cluster
ft_group_name: test-stan-ft-group ############################### Store Config ###############################
store: "file"
dir: /data/stan/store ############################### NATS Streaming Clustering ###############################
} ###############################################

Embedded NATS Config

############################################### PID file shared with configuration reloader. pid_file: "/var/run/nats/nats.pid" ###############

Monitoring

###############
http: 8222
server_name: $POD_NAME ###################################

NATS Full Mesh Clustering Setup

###################################
cluster {
port: 6222 routes = [
nats://test-0.test.default.svc:6222,
]
cluster_advertise: $CLUSTER_ADVERTISE connect_retries: 30
}
max_payload: 15728640/

Server and client version

NATS Server Version: 2.10.17 NATS Helm Version : 1.2.1

Host environment

No response

Steps to reproduce

No response

prateeeka-nadimpalli avatar Aug 20 '24 04:08 prateeeka-nadimpalli