Skip to content

Commit 33ee0df

Browse files
authored
Fix connection string and gossip timeout documentation (#483)
1 parent fa63d10 commit 33ee0df

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

docs/api/getting-started.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,39 @@ mode, you must explicitly set `tls=false` in your connection string or client co
3535

3636
KurrentDB uses connection strings to configure the client connection. The connection string supports two protocols:
3737

38-
- **`kurrentdb://`** - for connecting directly to specific node endpoints (single node or multi-node cluster with explicit endpoints)
39-
- **`kurrentdb+discover://`** - for connecting using cluster discovery via DNS or gossip endpoints
38+
- **`kurrentdb://`** - for connecting to a single node, or to a multi-node cluster using multiple gossip seed endpoints
39+
- **`kurrentdb+discover://`** - for connecting using DNS discovery with a single DNS endpoint
4040

41-
When using `kurrentdb://`, you specify the exact endpoints to connect to. The client will connect directly to these endpoints. For multi-node clusters, you can specify multiple endpoints separated by commas, and the client will query each node's Gossip API to get cluster information, then picks a node based on the URI's node preference.
41+
When using `kurrentdb://` with multiple endpoints separated by commas, the client will query each node's Gossip API to get cluster information, then picks a node based on the URI's node preference. If one of the nodes is down, the client will try another endpoint.
4242

43-
With `kurrentdb+discover://`, the client uses cluster discovery to find available nodes. This is particularly useful when you have a DNS A record pointing to cluster nodes or when you want the client to automatically discover the cluster topology.
43+
With `kurrentdb+discover://`, the client resolves a single DNS endpoint to discover the cluster topology. This is useful when you have a DNS `A` record pointing to your cluster nodes.
44+
45+
::: warning Only one host with +discover
46+
When using `kurrentdb+discover://`, only a single host should be provided. If multiple hosts are specified, only the first one will be used for discovery and the rest will be ignored. If you need to specify multiple endpoints for redundancy, use `kurrentdb://` without `+discover` instead.
47+
:::
4448

4549
::: info Gossip support
4650
Since version 22.10, kurrentdb supports gossip on single-node deployments, so
4751
`kurrentdb+discover://` can be used for any topology, including single-node setups.
4852
:::
4953

50-
For cluster connections using discovery, use the following format:
54+
For multi-node clusters where you know the individual node addresses, use multiple gossip seed endpoints:
5155

5256
```
53-
kurrentdb+discover://admin:changeit@cluster.dns.name:2113
57+
kurrentdb://admin:changeit@node1.dns.name:2113,node2.dns.name:2113,node3.dns.name:2113
5458
```
5559

56-
Where `cluster.dns.name` is a DNS `A` record that points to all cluster nodes.
60+
The client will use the Gossip API to discover the cluster topology and select the best node based on the configured node preference.
5761

58-
For direct connections to specific endpoints, you can specify individual nodes:
62+
For cluster connections using DNS discovery, use a single DNS endpoint:
5963

6064
```
61-
kurrentdb://admin:changeit@node1.dns.name:2113,node2.dns.name:2113,node3.dns.name:2113
65+
kurrentdb+discover://admin:changeit@cluster.dns.name:2113
6266
```
6367

64-
Or for a single node:
68+
Where `cluster.dns.name` is a DNS `A` record that points to all cluster nodes.
69+
70+
For a single node:
6571

6672
```
6773
kurrentdb://admin:changeit@localhost:2113
@@ -75,7 +81,7 @@ There are a number of query parameters that can be used in the connection string
7581
| `connectionName` | Any string | None | Connection name |
7682
| `maxDiscoverAttempts` | Number | `10` | Number of attempts to discover the cluster. |
7783
| `discoveryInterval` | Number | `100` | Cluster discovery polling interval in milliseconds. |
78-
| `gossipTimeout` | Number | `5` | Gossip timeout in seconds, when the gossip call times out, it will be retried. |
84+
| `gossipTimeout` | Number | `5` | Timeout in seconds for each gossip request during cluster discovery. |
7985
| `nodePreference` | `leader`, `follower`, `random`, `readOnlyReplica` | `leader` | Preferred node role. When creating a client for write operations, always use `leader`. |
8086
| `tlsVerifyCert` | `true`, `false` | `true` | In secure mode, set to `true` when using an untrusted connection to the node if you don't have the CA file available. Don't use in production. |
8187
| `tlsCaFile` | String, file path | None | Path to the CA file when connecting to a secure cluster with a certificate that's not signed by a trusted CA. |

0 commit comments

Comments
 (0)