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

Replica set example that uses PetSet (v2) #206

Merged
merged 2 commits into from
Oct 18, 2016

Conversation

php-coder
Copy link
Contributor

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

@bparees
Copy link
Collaborator

bparees commented Oct 18, 2016

this one opens for me. will wait for [test] success.

@rhscl-bot
Copy link

Can one of the admins verify this patch?

1 similar comment
@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@bparees bparees merged commit ce0a6da into sclorg:master Oct 18, 2016
@php-coder php-coder deleted the petset_support branch October 18, 2016 16:41
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/)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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."

Copy link
Contributor

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,)"
Copy link
Contributor

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?

Copy link
Contributor Author

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).

Copy link
Contributor

Choose a reason for hiding this comment

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

No technical differences?

Copy link
Contributor Author

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.

Copy link
Contributor

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 :-)

Copy link
Contributor Author

@php-coder php-coder Oct 19, 2016

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? ;-)

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

@omron93
Copy link
Contributor

omron93 commented Oct 19, 2016

@php-coder @rhcarvalho It somehow missed me that #184 is ready for review :-)

@djohnston89
Copy link

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?

@bparees
Copy link
Collaborator

bparees commented Feb 22, 2017

@djohnston89 see https://github.com/sclorg/mongodb-container/tree/master/examples/petset

it uses the centos/mongo-32-centos7 image.

@djohnston89
Copy link

djohnston89 commented Feb 23, 2017

@bparees unfortunately I apparently don't have privileges to create a stateful set.
'Cannot create stateful set "mongodb". User "" cannot create apps.statefulsets in project "**"'

@VLange80
Copy link

Is there a workaround anyone has found for "cannot create apps.statefulsets in project " ?

@bparees
Copy link
Collaborator

bparees commented Mar 15, 2017

@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:
https://github.com/sclorg/mongodb-container/blob/cf99d38bfcff2657fd1effba7c2bf69e6bc96dfd/examples/petset/mongodb-petset-persistent.yaml

I'm not sure if it has bit-rotted in any other ways, though.

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

Successfully merging this pull request may close these issues.

8 participants