Skip to content

giraffi/sidekiq_sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SidekiqSentinel

This Gem is outdated.

How configure sidekiq for redis sentinel, See: https://github.com/mperham/sidekiq/wiki/Advanced-Options#complete-control


Build Status

The Sidekiq CLI will be used a Redis Sentinel cluster.

When Sidekiq.config has a key which named sentinel, the sidekiq client will use redis sentinel cluster as backend.

Dependency

Installation

Add this line to your application's Gemfile:

gem 'sidekiq_sentinel'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sidekiq_sentinel

Usage

  1. Put your redis sentinel cluster informations to YAML file.
  2. Run sidekiq with -C option

config.yml example

# Sample configuration file for Sidekiq.
# Options here can still be overridden by cmd line args.
#   sidekiq -C config.yml
---
:sentinel:
  :master_name: example-test
  :sentinels:
  - :host: localhost
    :port: 26379
  - :host: localhost
    :port: 26380
:verbose: true
:pidfile: ./sidekiq.pid
:concurrency:  5
:queues:
  - [often, 7]
  - [default, 5]
  - [seldom, 3]

Test

There are two files for testing.

  • examples/config.yml (forked from sidekiq project)
  • examples/sinkiq.rb (forked from sidekiq project)

You can setup redis sentinel cluster with redis-sentinel project examples.

  1. Setup redis sentinel cluster and watch redis with MONITOR API.
  2. Run sidekiq worker bundle exec sidekiq -C ./examples/config.yml -r examples/sinkiq.rb
  3. Run sinatra server bundle exec ruby examples/sinkiq.rb
  4. Post messages from sinatra(http://localhost:4567)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Authors

Created and maintained by Yukihiko Sawanobori (sawanoboriyu@higanworks.com)

License

MIT (see LICENSE)

About

Sidekiq with Redis Sentinel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages