-
Notifications
You must be signed in to change notification settings - Fork 50
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
infra to build js-cluster for tests #151
Conversation
tests/helpers/cluster.ts
Outdated
cluster.forEach((s) => { | ||
console.log( | ||
`launched server [${s.process.pid}] at ${s.hostname}:${s.port} - monitor ${s.monitoring}`, | ||
`nats-server -c ${s.configFile} [${s.process.pid}] at nats://${s.hostname}:${s.port} cluster://${s.hostname}:${s.cluster} http://127.0.0.1:${s.monitoring}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With JS, for clustering to work well, the routes need to be explicit because the replicas and quorum size is based on that. Meaning that a server should have
cluster {
port: xxx
routes [
"nats://thisserver:routeport",
"nats://2ndserver:routeport",
"nats://3rdserver:routeport",
]
}
So I am not sure if having a server just with cluster port running is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are:
All the cluster ports are captured here:
And then after all captured, self-routes are removed (I know they don't have to be)
And finally, all the servers are restarted with their JS cluster configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A full config looks like this:
port: 4222
cluster {
name: MOYI2Y0O2HYD057TSX017D
listen: "127.0.0.1:49922"
routes [
nats://127.0.0.1:49928
]
}
ports_file_dir: /var/folders/1y/_rk6yz81341g5q8k1vr5nqmw0000gq/T
host: "127.0.0.1"
http: "127.0.0.1:49921"
jetstream {
max_file_store: 1048576
max_memory_store: 1048576
store_dir: /tmp/jetstream/MOYI2Y0O2HYD057TSX01ED
}
server_name: MOYI2Y0O2HYD057TSX01AV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.