-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing shard_index to overcome limitations of sorting
- Loading branch information
1 parent
18b59a9
commit 31bc972
Showing
2 changed files
with
55 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,65 @@ | ||
# Configuration Options | ||
|
||
The application gets configured by a set of configuration files. `001_default.yaml` contains the main configuration, administration commands will create the other configurations based on the `001_default.yaml` configuration. | ||
The application gets configured by a set of configuration files. `001_default.yaml` contains the main configuration, | ||
administration commands will create the other configurations based on the `001_default.yaml` configuration. | ||
|
||
## Databases | ||
|
||
It is recommended to use a redis database. You need two different databases, i.e. for the application and the metrics. | ||
The `metrics` key contains the database configuration for the metrics and the `database` key contains the database configuration for the application. | ||
The `metrics` key contains the database configuration for the metrics and the `database` key contains the database | ||
configuration for the application. | ||
|
||
### Redis | ||
|
||
You can configure the application to use a standalone redis instance. | ||
You can configure the application to use a standalone redis instance. | ||
|
||
```yaml | ||
name: db # or meter | ||
type: redis | ||
settings: | ||
addresses: [ "localhost:6379" ] # Set of addresses pointing to the SAME redis server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
addresses: [ "localhost:6379" ] # Set of addresses pointing to the SAME redis server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
``` | ||
### Redis + Sentinel | ||
You can configure the application to use a redis + sentinel instance. | ||
You can configure the application to use a redis + sentinel instance. | ||
```yaml | ||
name: db # or meter | ||
type: redis | ||
settings: | ||
sentinel_addresses: [ "localhost:26379" ] # Set of addresses pointing to the SAME sentinel server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
sentinel_username: "username" # Sentinel username | ||
sentinel_password: "password" # Sentinel password | ||
sentinel_addresses: [ "localhost:26379" ] # Set of addresses pointing to the SAME sentinel server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
sentinel_username: "username" # Sentinel username | ||
sentinel_password: "password" # Sentinel password | ||
``` | ||
### Redis Sharded | ||
You can also use the application-based Redis sharding by specifing multiple shards. You can use Redis standalone or Redis + Sentinel connections. The application will automagically shard the Redis keys to the different Redis instances. Make sure, that the configuration order is consistent, otherwise the database gets mixed up. | ||
You can also use the application-based Redis sharding by specifing multiple shards. You can use Redis standalone or | ||
Redis + Sentinel connections. The application will automagically shard the Redis keys to the different Redis instances. | ||
Make sure, that the shard_index is consistent, otherwise the database gets mixed up. | ||
```yaml | ||
name: db # or meter | ||
type: redis-shard | ||
settings: | ||
shards: | ||
- addresses: [ "localhost:6379" ] # Set of addresses pointing to the SAME redis server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
- sentinel_addresses: [ "localhost:26379" ] # Set of addresses pointing to the SAME sentinel server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
sentinel_username: "username" # Sentinel username | ||
sentinel_password: "password" # Sentinel password | ||
shards: | ||
- addresses: [ "localhost:6379" ] # Set of addresses pointing to the SAME redis server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
shard_index: 0 # Ascending shard index, beginning at 0 | ||
- sentinel_addresses: [ "localhost:26379" ] # Set of addresses pointing to the SAME sentinel server. | ||
database: 1 # Redis database ID | ||
password: "" # Redis password | ||
master: "mymaster" # Redis master name | ||
sentinel_username: "username" # Sentinel username | ||
sentinel_password: "password" # Sentinel password | ||
shard_index: 1 # Ascending shard index, beginning at 0 | ||
``` |