0

i'm new to both Redis and Go Language, so just bear with me. I'm trying to load some mysql data to the redis cluster.

I'm using this code from gitHub:Go program to load mysql data to redis

Using this, I'm able to load mysql data to a redis instance that is acting as a standalone redis server(127.0.0.1:7000).

But when i'm trying to load the same data to the nodes in a redis cluster(having 3 masters(127.0.0.1:7000,7001,7002)), i'm getting the following exception:

hmset error: MOVED 12937 127.0.0.1:7001

My redis.config for node running on port 7000:

port 7000
cluster-enabled yes
cluster-config-file nodes-7000.conf
cluster-node-timeout 5000
appendonly yes
protected-mode no

Can somebody suggest why this is happening? Thanks in advance.

Marek
  • 245
  • 1
  • 4
  • 15
  • https://redis.io/topics/cluster-spec#moved-redirection The node redirected you. You need to reissue the query to the node specified (127.0.0.1:7001). – Gavin Jul 20 '17 at 12:34
  • @Gavin: How is it possible to do that? According to the code i can only load the db data, to 1 node at an instance(I can provide only 1 host ip and port at a time). Is there no way by which the client can move from node to node doing insertion automatically? – Marek Jul 20 '17 at 14:50
  • Give [this](https://github.com/chasex/redis-go-cluster) library a look. – Gavin Jul 20 '17 at 16:54

0 Answers0