-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentinel: refactorize to use ::redis #19
Conversation
Does this still preserve the ability to run a sentinel without running a redis server? Separate configs and services was a goal of my original patches. Also, does it ensure required write perms on conf file? I'm in bed on my phone, otherwise Id check. Will check things out tomorrow. |
Also with the exec cp removed, each time puppet is run sentinel's state, which is kept in the conf file, will be lost. That or a similar mechanism must be in place. It is why sentinel+puppet is so messy. |
@cdent yes, you can run sentinel without running a redis server thanks to "service_name" which will only manage redis-sentinel service. |
I'll do some testing on the other issues, but this problem with the From the sentinel docs:
This means that the after the sentinel server boots up and starts looking at masters and learning about slaves it will change the config file. The next time puppet runs, because the config file is managed, those changes will be lost, and the service will be restarted, disrupting the sentinel's management of its own state. Thus we end up with the hacky solution: cp with two files. The sentinel.conf.puppet is the managed file. Only when it changes (with intentional admin changes) is it copied to the actual sentinel configuration file (and the service restarted). There may be a better solution, but it has to be something that allows sentinel to write to its own config without disruption. |
I've started my testing, the initial problems to stand out following, using this simple test.pp: class { 'redis':
sentinel_enabled => true,
service_name => 'redis-sentinel',
sentinel_master_name => 'cow',
sentinel_master_host => '10.0.0.2',
}
I haven't had a chance to check on deb-based systems but will do so shortly. |
@EmilienM and I talked about this morning in IRC and made some progress on figuring out what needs to happen. There were three basic conclusions that we hope to address later today:
Another question @EmilienM: Using this style, how do I declare in one manifest that I want to run both a redis-server and redis-sentinel on the same host? If I add another |
In previous commits, usage of redis::sentinel made impossible to run ::redis class which is the Puppet way to run this module. This patch keeps feature parity but clean-up the implementation to use ::redis and configure Sentinel with the same configuration file as regular system. The rspec tests show that we can use ::redis and have Redis Sentinel configuration that is expected.
I think we should keep your implementation and fix the resource duplication: #20 |
In previous commits, usage of redis::sentinel made impossible to run
::redis class which is the Puppet way to run this module.
This patch keeps feature parity but clean-up the implementation to use
::redis and configure Sentinel with the same configuration file as
regular system.
The rspec tests show that we can use ::redis and have Redis Sentinel
configuration that is expected.