-
Notifications
You must be signed in to change notification settings - Fork 179
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
Replica set example that uses PetSet (v2) #206
Conversation
this one opens for me. will wait for [test] success. |
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
be the case when scaling from 5 down to 1 member. | ||
|
||
The next step is to update the replica set configuration to | ||
[remove members](https://docs.mongodb.com/manual/tutorial/remove-replica-set-member/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@php-coder Is this possible?
After 5->1 scale down, no PRIMARY is elected. Am I right? If so, is it possible to change replset config on non-PRIMARY member?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph relates to any scale down procedure and not to the paragraph about case of scaling down from 5 to 1. In other words, when user scales down he/she has to modify replica set configuration manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding some note that after big scale down it won't be possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already there: "On the other hand, scaling down to a lower number will temporarily render the replica set to have only SECONDARY members and be in read-only mode. That would be the case when scaling from 5 down to 1 member."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already there: "On the other hand, scaling down to a lower number will temporarily render the replica set to have only SECONDARY members and be in read-only mode. That would be the case when scaling from 5 down to 1 member."
Yes. And in next paragraph there is that user have to update config manually. But it is not possible in this case!
Also I think that "replica set to have only SECONDARY members and be in read-only mode" might not be true too. It depends on what is a official OpenShift way how user applications should address replicaset?
|
||
# TODO: replace this with a call to `replset_addr` from common.sh, once it returns host names. | ||
local endpoints | ||
endpoints="$(find_endpoints | paste -s -d,)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@php-coder Why do you use hostnames for addressing? Any benefit than using endpoins()
and replset_addr()
from common.sh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems more natural. Also idea of using endpoints()
came too late, when I didn't want to do improvements like this (because of possible breakage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No technical differences?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU @rhcarvalho said that there is no differences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One big difference is that code could be shared.
Also using hostnames could be little bit slower :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you sure that it will work and give us some benefits, why are you commenting here and not providing PR? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to know why it was chosen. PR was merged before I managed to ask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we agreed to go with this alternative implementation + TODO was to minimize changes that could break the example.
Eliminating the duplication is desired, thus the TODO.
Worth noting that while here accessing the replica set via IPs will work, we definitely want to have host names in the replica set configuration and NOT IP addresses. The reason is that IPs can change over time, while host names are stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we definitely want to have host names in the replica set configuration and NOT IP addresses. The reason is that IPs can change over time, while host names are stable.
I know this and understand benefits.
@php-coder @rhcarvalho It somehow missed me that #184 is ready for review :-) |
Does anyone have a working OpenShift template/ Docker image for this PetSet clustering implementation that might work with OpenShift Container Platform version 3.3/3.4? |
@djohnston89 see https://github.com/sclorg/mongodb-container/tree/master/examples/petset it uses the centos/mongo-32-centos7 image. |
@bparees unfortunately I apparently don't have privileges to create a stateful set. |
Is there a workaround anyone has found for "cannot create apps.statefulsets in project " ? |
@djohnston89 @legracen it probably means you're running an older version of openshift when it was called the PetSet resource and not the StatefulSet resource. I'd suggest you try a newer version, you shouldn't need any special permissions. Barring that, you can try going back to the older version of the template that defined PetSet resources: I'm not sure if it has bit-rotted in any other ways, though. |
This is effectively the same as #184 but without all of our comments. I hope that new PR will allow us to overcome problems with unicorns that are shown for the old PR sometimes.
PTAL @bparees