Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nats Clustering not working as expected with NATS Server 2.10.17 #1308

Open
prateeeka-nadimpalli opened this issue Aug 20, 2024 · 1 comment

Comments

@prateeeka-nadimpalli
Copy link

prateeeka-nadimpalli commented Aug 20, 2024

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

@derekcollison
Copy link
Member

STAN (NATS Streaming) and JetStream are very different even though they solve similar problems.

Once you have a server (or cluster running) you should be able to connect with a normal NATS client.

@wallyqs wallyqs transferred this issue from nats-io/nats-server Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants