Skip to content

集群问题写入数据出错 #2125

Closed
Closed

Description

@sprufu

127.0.0.1:7001> set foo bar
(error) MOVED 12182 127.0.0.1:7002
127.0.0.1:7001> set hello world
(error) MOVED 866 127.0.0.1:7006

Activity

  1. michael-grunder commented on Nov 4, 2014

    @michael-grunder
    Contributor

    I'm not sure if this answers your question, but I think you want to use the -c option.

    From redis-cli --help:
    -c Enable cluster mode (follow -ASK and -MOVED redirections).

    So you would do something like:

    redis-cli -h 127.0.0.1 -p 7001 -c
    
  2. sprufu commented on Nov 6, 2014

    @sprufu
    Author

    非常感谢.

    但已经在使用了的phpredis和node.js的redis客户端却不是那么轻易加个参数就能处理, 只得更换支持集群的客户端了.

    redis更新比较快, 但客户端虽然多,但很多却不支持集群, 相信不只我一人遇到这个问题吧.

  3. michael-grunder commented on Nov 6, 2014

    @michael-grunder
    Contributor

    One I can answer! 😃

    I write phpredis, which does support Redis cluster in the branch feature/redis_cluster. It's still in alpha, but does support almost all of the commands and will redirect requests automatically.

    If you have questions about how to use it, please submit issues to that repo:
    http://www.github.com/nicolasff/phpredis

    Actually it would be great if more people used it so I can fix any nasty bugs!

    Cheers!
    Mike

  4. sprufu commented on Nov 12, 2014

    @sprufu
    Author

    如果支持publish的话, 就可以拿来用啦, 得好好试一下, 谢谢!

  5. vapy commented on Nov 28, 2017

    @vapy

    it worked after use the -c option,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions