Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Configuration
===

When connecting to Redis version 6 or above with an ACL configured, your ACL user needs to at least have permissions to run the ECHO command. We run this command to verify that we have a valid connection to the Redis service.
Because there are lots of different ways to configure redis, StackExchange.Redis offers a rich configuration model, which is invoked when calling `Connect` (or `ConnectAsync`):
Expand All @@ -16,7 +15,6 @@ The `configuration` here can be either:
The latter is *basically* a tokenized form of the former.

## Basic Configuration Strings
-

The *simplest* configuration example is just the host name:

Expand Down Expand Up @@ -67,7 +65,6 @@ var conn = ConnectionMultiplexer.Connect("contoso5.redis.cache.windows.net,ssl=t
```

## Configuration Options
---

The `ConfigurationOptions` object has a wide range of properties, all of which are fully documented in intellisense. Some of the more common options to use include:

Expand Down Expand Up @@ -149,7 +146,6 @@ Tokens in the configuration string are comma-separated; any without an `=` sign
Tokens starting with `$` are taken to represent command maps, for example: `$config=cfg`.

## Obsolete Configuration Options
---

These options are parsed in connection strings for backwards compatibility (meaning they do not error as invalid), but no longer have any effect.

Expand All @@ -159,7 +155,6 @@ These options are parsed in connection strings for backwards compatibility (mean
| writeBuffer={int} | `WriteBuffer` | `4096` | Size of the output buffer |

## Automatic and Manual Configuration
---

In many common scenarios, StackExchange.Redis will automatically configure a lot of settings, including the server type and version, connection timeouts, and primary/replica relationships. Sometimes, though, the commands for this have been disabled on the redis server. In this case, it is useful to provide more information:

Expand Down Expand Up @@ -189,7 +184,6 @@ redis0:6379,redis1:6380,keepAlive=180,version=2.8.8,$CLIENT=,$CLUSTER=,$CONFIG=,
```

## Renaming Commands
---

A slightly unusual feature of redis is that you can disable and/or rename individual commands. As per the previous example, this is done via the `CommandMap`, but instead of passing a `HashSet<string>` to `Create()` (to indicate the available or unavailable commands), you pass a `Dictionary<string,string>`. All commands not mentioned in the dictionary are assumed to be enabled and not renamed. A `null` or blank value records that the command is disabled. For example:

Expand All @@ -212,7 +206,6 @@ $INFO=,$SELECT=use
```

## Redis Server Permissions
---

If the user you're connecting to Redis with is limited, it still needs to have certain commands enabled for the StackExchange.Redis to succeed in connecting. The client uses:
- `AUTH` to authenticate
Expand All @@ -234,7 +227,6 @@ For example, a common _very_ minimal configuration ACL on the server (non-cluste
Note that if you choose to disable access to the above commands, it needs to be done via the `CommandMap` and not only the ACL on the server (otherwise we'll attempt the command and fail the handshake). Also, if any of the these commands are disabled, some functionality may be diminished or broken.

## twemproxy
---

[twemproxy](https://github.com/twitter/twemproxy) is a tool that allows multiple redis instances to be used as though it were a single server, with inbuilt sharding and fault tolerance (much like redis cluster, but implemented separately). The feature-set available to Twemproxy is reduced. To avoid having to configure this manually, the `Proxy` option can be used:

Expand All @@ -259,7 +251,6 @@ var options = new ConfigurationOptions+{


## Tiebreakers and Configuration Change Announcements
---

Normally StackExchange.Redis will resolve primary/replica nodes automatically. However, if you are not using a management tool such as redis-sentinel or redis cluster, there is a chance that occasionally you will get multiple primary nodes (for example, while resetting a node for maintenance it may reappear on the network as a primary). To help with this, StackExchange.Redis can use the notion of a *tie-breaker* - which is only used when multiple primaries are detected (not including redis cluster, where multiple primaries are *expected*). For compatibility with BookSleeve, this defaults to the key named `"__Booksleeve_TieBreak"` (always in database 0). This is used as a crude voting mechanism to help determine the *preferred* primary, so that work is routed correctly.

Expand All @@ -270,7 +261,6 @@ Both options can be customized or disabled (set to `""`), via the `.Configuratio
These settings are also used by the `IServer.MakeMaster()` method, which can set the tie-breaker in the database and broadcast the configuration change message. The configuration message can also be used separately to primary/replica changes simply to request all nodes to refresh their configurations, via the `ConnectionMultiplexer.PublishReconfigure` method.

## ReconnectRetryPolicy
---

StackExchange.Redis automatically tries to reconnect in the background when the connection is lost for any reason. It keeps retrying until the connection has been restored. It would use ReconnectRetryPolicy to decide how long it should wait between the retries.
ReconnectRetryPolicy can be exponential (default), linear or a custom retry policy.
Expand Down
5 changes: 5 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ theme: jekyll-theme-cayman
# GitHub's default config turns it on; the package comes from NuGet, not a tarball.
show_downloads: false

# Cayman renders the page title in its header banner, and the title comes from each page's
# first heading - so without this the heading reads twice, banner then body.
titles_from_headings:
strip_title: true

# Not in the always-on GitHub Pages plugin set, so it has to be asked for; generates
# sitemap.xml and robots.txt, neither of which the site had.
plugins:
Expand Down
3 changes: 3 additions & 0 deletions docs/_includes/head-custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- Overrides the theme's own head-custom.html, which ships with the favicon line commented out. -->
<link rel="icon" href="/assets/seredis.svg" type="image/svg+xml">
<link rel="icon" href="/favicon.ico" sizes="16x16 32x32 48x48">
11 changes: 11 additions & 0 deletions docs/assets/seredis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/favicon.ico
Binary file not shown.
Loading