Git Product home page Git Product logo

redis-migrator's People

Contributors

redross avatar sishen avatar yankov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redis-migrator's Issues

Redis 2.6 supports MIGRATE

Probably too early as long as 2.6 is in RC. So this is a place holder issue.
Redis 2.6 supports the MIGRATE command that allows to atomically migrate a key between two servers without the need to know the type of the key.
from the docs:

Atomically transfer a key from a source Redis instance to a destination Redis instance. On success the key is deleted from the original instance and is guaranteed to exist in the target instance.

Usage :

MIGRATE host port key destination-db timeout

keys * can't work with huge of DB

I had tried use redis-migrator to split a large DB, there have more than 20,000,000 keys in Redis.

In this line, I saw that use keys(*) to get all of the keys from Redis, that can't work, because it will timeout.

ERR wrong number of arguments for 'migrate' command

require 'redis_migrator'

old_redis_hosts = ["redis://127.0.0.1:6379"]
new_redis_hosts = ["redis://127.0.0.1:6380", "redis://127.0.0.1:6381", "redis://127.0.0.1:6382", "redis://127.0.0.1:6383", "redis://127.0.0.1:6384"]

migrator = Redis::Migrator.new(old_redis_hosts, new_redis_hosts)
migrator.run
  • Redis 2.8.8
  • Ruby 2.0.0
  • redis-rb 3.0.4
/usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:126:in `value': ERR wrong number of arguments for 'migrate' command (Redis::CommandError)
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:118:in `_set'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:64:in `block in finish'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:63:in `each'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:63:in `each_with_index'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:63:in `each'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:63:in `map'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/pipeline.rb:63:in `finish'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:121:in `block in call_pipeline'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:243:in `with_reconnect'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:119:in `call_pipeline'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis.rb:2031:in `block in pipelined'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis.rb:36:in `block in synchronize'
    from /usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis-3.0.4/lib/redis.rb:2027:in `pipelined'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis_migrator-0.1.1/lib/redis_migrator/redis_native_migrator.rb:21:in `block in migrate'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis_migrator-0.1.1/lib/redis_migrator/redis_native_migrator.rb:20:in `each'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis_migrator-0.1.1/lib/redis_migrator/redis_native_migrator.rb:20:in `migrate'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis_migrator-0.1.1/lib/redis_migrator.rb:53:in `migrate_keys'
    from /usr/local/lib/ruby/gems/2.0.0/gems/redis_migrator-0.1.1/lib/redis_migrator.rb:68:in `block (2 levels) in run'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.