Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "redis"
- require "json"
- SENTINELS = [{ host: "192.168.99.100", port: 26379 },
- { host: "192.168.99.101", port: 26379 },
- { host: "192.168.99.102", port: 26379 }]
- redis = Redis.new(url: "redis://master01/", sentinels: SENTINELS, role: :master)
- redis.set "foo", [1, 2, 3].to_json
- # => OK
- JSON.parse(redis.get("foo"))
Add Comment
Please, Sign In to add comment