redis-cluster

With Redis Cluster, is to possible to just pass the hash tags to eval?

笑着哭i 提交于 2019-12-11 11:18:42
问题 From the Redis documentation on eval it says: should not represent key names In the Redis cluster tutorial Hash tags are documented in the Redis Cluster specification, but the gist is that if there is a substring between {} brackets in a key, only what is inside the string is hashed, so for example this{foo}key and another{foo}key are guaranteed to be in the same hash slot, and can be used together in a command with multiple keys as arguments. Is it possible to just pass the hash tag or

Error unknown type Go

回眸只為那壹抹淺笑 提交于 2019-12-11 08:04:45
问题 i'm really new to Go, su just bear with me here. I'm trying to write a code for loading mysql data to redis cluster using following :redis-go-cluster, load2redis This is the code. Its a little bit long, just bear with me here. package main import ( "bytes" "database/sql" "flag" // "github.com/garyburd/redigo/redis" _ "github.com/go-sql-driver/mysql" //"gopkg.in/redis.v4" "github.com/chasex/redis-go-cluster" "log" "runtime" // "strings" "sync" "time" ) var client *redis.Cluster type Task

redis-cli redirected to 127.0.0.1

∥☆過路亽.° 提交于 2019-12-10 16:46:14
问题 I started Redis cluster on PC1, then connected it on PC2. When needed to redirect to another cluster node, it shows Redirected to slot [7785] located at 127.0.0.1 , but should show Redirected to slot [7785] located at [IP of PC1, like 192.168.1.20] , then it shows an error. What is happening? What can I do? The output: [admin@localhost ~]$ redis-cli -c -h 192.168.1.20 -p 30001 192.168.1.20:30001> get foo -> Redirected to slot [12182] located at 127.0.0.1:30003 Could not connect to Redis at

Is there any Redis client (Java prefered) which supports transactions on Redis cluster?

会有一股神秘感。 提交于 2019-12-08 08:17:09
问题 I looked online intensively but couldn't find a mature Redis client offering this functionality. Only found this project. Anyone knows of a Redis client offering the above mentioned? Thank you. 回答1: Transactions within a Redis Cluster are a different story than transaction with Redis Standalone. TL;DR; That's more a conceptual problem regarding guarantees and trade-offs than a client issue. Explanation In Redis Cluster, a particular node is a master for one or more hash-slots, that’s the

Is there any Redis client (Java prefered) which supports transactions on Redis cluster?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 03:38:41
I looked online intensively but couldn't find a mature Redis client offering this functionality. Only found this project . Anyone knows of a Redis client offering the above mentioned? Thank you. Transactions within a Redis Cluster are a different story than transaction with Redis Standalone. TL;DR; That's more a conceptual problem regarding guarantees and trade-offs than a client issue. Explanation In Redis Cluster, a particular node is a master for one or more hash-slots, that’s the partitioning scheme to shard data amongst multiple nodes. One hash-slot, calculated from the keys used in the

How to delete keys matching a pattern in Redis Cluster

一世执手 提交于 2019-12-06 13:56:10
问题 I have tried method in this question, but it does not work since I'm working in cluster mode, and redis told me: (error) CROSSSLOT Keys in request don't hash to the same slot 回答1: Answers for that question try to remove multiple keys in a single DEL . However, keys matching the given pattern might NOT locate in the same slot, and Redis Cluster DOES NOT support multiple-key command if these keys don't belong to the same slot. That's why you get the error message. In order to fix this problem,

Using jedis how to write to a specific slot/node in redis cluster

筅森魡賤 提交于 2019-12-06 06:03:45
I'm trying to improve the performance of writing data to redis cluster. We are planning to move from redi-sentinel to cluster mode for scalability. But, the performance of write operations is very less compared to redis-sentinel. We leveraged pipeline in redis-sentinel but cluster mode doesn't support pipeline. So, I was thinking to group all the keys that go to a same node and send the batch to that specific node using pipeline. So, I'm wondering how to know/compute (before writing to cluster) to which node/slot a particular key would be written to? Solution 1: Found a solution to identify

How to delete keys matching a pattern in Redis Cluster

≡放荡痞女 提交于 2019-12-04 18:43:05
I have tried method in this question , but it does not work since I'm working in cluster mode, and redis told me: (error) CROSSSLOT Keys in request don't hash to the same slot Answers for that question try to remove multiple keys in a single DEL . However, keys matching the given pattern might NOT locate in the same slot, and Redis Cluster DOES NOT support multiple-key command if these keys don't belong to the same slot. That's why you get the error message. In order to fix this problem, you need to DEL these keys one-by-one: redis-cli --scan --pattern "foo*" |xargs -L 1 redis-cli del The -L

Connect to ElastiCache cluster via Node.js

大兔子大兔子 提交于 2019-12-04 07:46:12
I'm confused as to how to connect to AWS's ElastiCache Redis via Node.js. I've successfully managed to connect to the primary host (001) via the node_redis NPM, but I'm unable to use the clustering ability of ioredis because apparently ElastiCache doesn't implement the CLUSTER commands. I figured that there must be another way, but the AWS SDK for Node only has commands for managing ElastiCache, not for actually connecting to it. Without using CLUSTER, I'm concerned that my app won't be able to fail over if the master node fails, since I can't fall back to the other clusters. I also get errors

How to config redis-cluster when use spring-data-redis 1.7.0.M1

醉酒当歌 提交于 2019-12-01 20:30:43
问题 I use spring-data-redis version 1.7.0.M1,and jedis version 2.8.0 Here is my configuration <bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"> <property name="connectionFactory" ref="redisConnectionFactory"></property> <property name="keySerializer"> <bean class="org.springframework.data.redis.serializer.StringRedisSerializer"/> </property> <property name="hashKeySerializer"> <bean class="org.springframework.data.redis.serializer.StringRedisSerializer"/> <