diff --git a/docs/clustering.md b/docs/clustering.md index 26acfa0a791..48fc98640c5 100644 --- a/docs/clustering.md +++ b/docs/clustering.md @@ -40,6 +40,22 @@ const value = await cluster.get('key'); | modules | | Included [Redis Modules](../README.md#packages) | | scripts | | Script definitions (see [Lua Scripts](../README.md#lua-scripts)) | | functions | | Function definitions (see [Functions](../README.md#functions)) | +## Auth with password and username + +Specifying the password in the URL or a root node will only affect the connection to that specific node. In case you want to set the password for all the connections being created from a cluster instance, use the `defaults` option. +```javascript +createCluster({ + rootNodes: [{ + url: 'redis://10.0.0.1:30001' + }, { + url: 'redis://10.0.0.2:30002' + }], + defaults: { + username: 'username', + password: 'password' + } +}); +``` ## Node Address Map