Skip to content
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

add sentinel multi monitor #376

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

basti-nis
Copy link
Contributor

@basti-nis basti-nis commented Nov 18, 2020

Pull Request (PR) description

After multi instance was added we should let redis-sentinel watch over these instances

This Pull Request (PR) add following features and fixes the following issues

  • multi instance support for redis-sentinel

This will close following Issues:
Close #319
Close #223

@basti-nis
Copy link
Contributor Author

Hey guys,
this is finally ready for review!
Please have a look @ekohl or @bastelfreak !

Thank you!

@bastelfreak bastelfreak requested a review from ekohl November 22, 2020 15:02
@bastelfreak
Copy link
Member

A lot of changes going on here and I'm not a redis expert. @ekohl you maybe?

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it should be a defined type instead (redis::sentinel::instance or something). It should concat all monitored instances. The reason I think about this is that it's becoming harder to monitor.

types/sentinelmonitor.pp Outdated Show resolved Hide resolved
manifests/sentinel.pp Outdated Show resolved Hide resolved
@basti-nis
Copy link
Contributor Author

I'm wondering if it should be a defined type instead (redis::sentinel::instance or something). It should concat all monitored instances. The reason I think about this is that it's becoming harder to monitor.

@ekohl
Good point, will change it to that name!
I'll go into the 2 suggestions in this week, hope we can merge it soon :)

@basti-nis
Copy link
Contributor Author

basti-nis commented Jan 28, 2021

I'm wondering if it should be a defined type instead (redis::sentinel::instance or something). It should concat all monitored instances. The reason I think about this is that it's becoming harder to monitor.

@ekohl
In a past PR you mentioned, that we should not add concat to our dependencies and further more that i should do a loop in the template. Or do i get you wrong?

redis::sentinel::instance is missleading, because it is not for sentinel instances.
This PR makes it possible that your sentinel can monitor multiple redis instances.

I think it's fine as it is.
Not much has changed in the template, only a loop was added.
Why do you think it's harder to monitor, i can't follow your thoughts.
If you could explain it to me in more detail, i would adapt it.

Otherwise we would have a solution that has been in demand for a long time, which works very well and is already being used successfully in over 10 environments.

@ekohl
Copy link
Member

ekohl commented Jan 29, 2021

In a past PR you mentioned, that we should not add concat to our dependencies and further more that i should do a loop in the template. Or do i get you wrong?

If it's all in the same class, concat is not needed. However, if you use a defined type I think it will be needed.

redis::sentinel::instance is missleading, because it is not for sentinel instances.
This PR makes it possible that your sentinel can monitor multiple redis instances.

instance is just a name I suggested. It was more about a concept that you have something that repeats itself. A defined type can make it easier to see that.

I think it's fine as it is.
Not much has changed in the template, only a loop was added.
Why do you think it's harder to monitor, i can't follow your thoughts.
If you could explain it to me in more detail, i would adapt it.

I think passing a complex hash to a class is a painful API that's harder to understand than calling multiple defined types. In the end it'll result in the same content on disk so it's more about a usability from a developers point of view.

Does that make sense and help to elaborate my view?

@basti-nis
Copy link
Contributor Author

basti-nis commented Feb 3, 2021

@ekohl

I think passing a complex hash to a class is a painful API that's harder to understand than calling multiple defined types. In the end it'll result in the same content on disk so it's more about a usability from a developers point of view.

Does that make sense and help to elaborate my view?

Ok, that makes sense. Thanks for your detailed answer!

If it's all in the same class, concat is not needed. However, if you use a defined type I think it will be needed.

instance is just a name I suggested. It was more about a concept that you have something that repeats itself. A defined type can make it easier to see that.

You mean i should write an defined resource, that we can do something like this?:

redis::sentinel::monitor { 'my_redis_cluster':
  redis_host       => '1.2.3.4',
  redis_port       => 6881,
  down_after       => 5000,
  failover_timeout => 12000,
  quorum           => 2,
  parallel_sync    => 1,
  auth_pass        => 'secret',
}

Sorry, i think i missunderstood you in the past.

@gizmo15
Copy link

gizmo15 commented Feb 1, 2022

Hi,

I'm facing the same need, is there any updates ?

Thanks

@basti-nis
Copy link
Contributor Author

Hi @gizmo15 ,

sorry, i didn't have time to write the code in the past months.
Actually my branch from my forked project works in our production environment without any problems almos a year now:
https://github.com/basti-nis/puppet-redis/tree/feature/sentinel_multi_monitor

If you need a quick solution, give it a try.

I will look into it, to complete the code like @ekohl suggested it, in the next couple of days.

If anybody else have an idea, feel free to contribute :)

@gizmo15
Copy link

gizmo15 commented Feb 2, 2022

Hi,
Thanks for you answer and your work! we will check that!

@vox-pupuli-tasks
Copy link

Dear @basti-nis, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants