I am using nutcracker in my application to fetch data from Redis nodes.
Just wanted to know whether it supports multi get or it internally fetches all keys one by one.
Yes it does.
You can find all the Redis commands that twemproxy supports here
Related
Redis by default have 16 databases that can be selected by using SELECT command.
But as per the docs, https://redis.io/commands/select,
When using Redis Cluster, the SELECT command cannot be used, since
Redis Cluster only supports database zero. In the case of a Redis
Cluster, having multiple databases would be useless and an unnecessary
source of complexity.
As per redis docs, cluster/HA is achieved by
cluster - https://redis.io/topics/cluster-tutorial
sentinel -
https://redis.io/topics/sentinel.
I am clear that Redis Cluster only supports database zero, but I couldn't get the info anywhere to check the support for multiple databases in Sentinel setup with multiple nodes?
Any reference to this would be helpful. Thanks!
With sentinel setup, you can have multiple databases.
Redis Sentinel is only used to provide HA for Redis, it doesn't change Redis in any way. And you can use this Redis as the single instance Redis without sentinel.
As we known, redis cluster have 16384 hash slots.when redis client connect to redis cluster, how redis client to connect real save data redis node?
The rule is quite simple, redis use CRC16(key) % 16384 to determine which slot will a key go in. If you want to do everything by yourself, you just need to calculate every key's crc16.
But generally, you don't need to do these by yourself. At the moment, almost every well-known client, like jedis, predis,StackExchange.Redis , supports the cluster mode.
I'm using Redis as a caching system on the client windows endpoint. I want to use two simultaneous caching streams where one is lru enabled and the other is disabled.
How do I run two different configs on the same instance?
Ended up using two instances with aof
OK so talked to people at Redis. It's not possible as all the configuration is global for the instance.
So the only solution is to have two different instances
I just started evaluating Redis. I am using Redis 2.8.19 which the most latest stable release. Redis 2.9 is still unstable and Redis 3.0 is just available for developer's preview (not recommended for production). I was tryin to setus a cluster of Redis and when I changed my redis.conf and appended
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
and started my Redis server by
src/redis-server ./redis.conf
it gave me an error as follows
* FATAL CONFIG FILE ERROR *
Reading the configuration file, at line 2
'cluster-enabled yes'
Bad directive or wrong number of arguments
I googled the error and got to know that my version (2.8.19) does not support cluster. I was still unable to fine any such specification in Redis Docs. My question is simple. Does Redis 2.8.19 supports redis cluster configuration? Or I have to upgrade to Redis 2.9 or Redis 3.0. I am evaluating Redis because I need to deploy it in production. Please guide.
Redis Cluster support is only for versions >= 3.0.0. Redis 3.0.0 will be released as a stable version in a matter of days, it's a good idea to use it if you want to use Cluster. The cluster support is considered to be stable, however for it to be considered mature we want to see adoption. Btw there is already at least a very large site using it in production. Currently the most sane thing to do if you need Redis Cluster is to test it for your use case, and if it looks great, use it.
Redis cluster is supported only in Redis 3.0+ (which is now stable). I have written a simple API called "Simple Redis Cluster Client" which can be used in redis's sub 3.0 versions for running in a cluster like mode (Not precisely a cluster, it just distributes keys among redis nodes based on the key's hashcode, You can have a look # https://github.com/prash-mi/simple-redis-cluster-client
Cluster support for Redis is only from v3 - v2.8.19 doesn't do clustering.
I set up twemproxy (nutcracker) with 2 redis servers as backends including slaves, sentinel and failover.
As soon as I add another redis server some of the keys are not able to be read, probably due to twemproxy redirecting to another redis.
How do I add another redis instance without breaking the consistency?
I want to use the setup as a consistent and very fast database.
Here are my settings:
redis_cluster:
auto_eject_hosts: false
distribution: ketama
hash: fnv1a_32
listen: 127.0.0.1:6379
preconnect: true
redis: true
servers:
- 127.0.0.1:7004:1 redis_1
- 127.0.0.1:7005:1 redis_2
I want to keep sharding a job of the server and be able to add instances. Do I need to use another setup?
Twemproxy can't do that. You can use Redis Cluster, or if you want to use Twemproxy you have to use a technique called presharding. Which is, start directly with, like, 32 or 64 instances or alike, even if them all run in the same host to start. Then start moving instances from one box to another in order to scale to multiple actual servers. The word to the right of the instances configured inside Twemproxy "redis_1" are used in order to hash, so that you can change IP address when you move instances, and still the hashing will be the same for that server.
Redis Cluster is release candidate 2 at this point. While it needs more testing and deployments to be battle tested as Redis is, it is already a viable product, so you may want to test it as well.