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

Use configured port everywhere we talk to postgres #545

Merged
merged 2 commits into from
Oct 13, 2015

Conversation

marcparadise
Copy link
Member

Fixes #459 and allows a custom port to be specified in chef-server postgresql settings.

@@ -197,7 +197,7 @@
{ip_mode, [ <%=PrivateChef['use_ipv6'] ? "ipv6,ipv4" : "ipv4" %> ] },
%% Database connection parameters
{db_host, "<%= node['private_chef']['postgresql']['vip'] %>"},
{db_port, 5432},
{db_port, <%= node['private_chef']['opscode-erchef']['sql_user'] %>},
Copy link
Contributor

Choose a reason for hiding this comment

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

I imagine this should be <%= node['private_chef']['postgresql']['port'] %> rather than sql_user?

An aside: We should probably (eventually) always have 2 attributes 1 that controls what port the service listens on when we set it up, and another to control what port applications should talk to. By default they would be the same, but it would give us the flexibility to add connection pooling/tpc proxies such that erchef would actually talk to a different port.

Copy link
Member Author

Choose a reason for hiding this comment

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

D'oh. Corrected. As we move forward with different permitted postgres backends per-service, we'll actually push the postgres host/vip/superuser config down into the application itself, probably with a default value that is used if it's not specified continuing to live in postgresql

@marcparadise marcparadise force-pushed the mp/fix-non-default-postgres-port branch from d323081 to 8681f9d Compare September 25, 2015 15:16
@sdelano
Copy link
Contributor

sdelano commented Sep 25, 2015

👍 - lgtm. Also 👍 to @stevendanna's suggestion of listen and connect port differences, someday.

@stevendanna
Copy link
Contributor

👍 Looks good, MWR

Marc Paradise added 2 commits October 13, 2015 14:55
ChangeLog-Entry: Issue 459: Use configured port everywhere we talk to postgres
Even when the connection is local, always specify postgresql port for
psql and the pg gem. The local pipe name includes the
port number number by default, so if the port is changed, the pipe
needed to connect can't be found.
@marcparadise marcparadise force-pushed the mp/fix-non-default-postgres-port branch from 8681f9d to b894d70 Compare October 13, 2015 19:49
marcparadise added a commit that referenced this pull request Oct 13, 2015
Use configured port everywhere we talk to postgres
@marcparadise marcparadise merged commit 01af24d into master Oct 13, 2015
@marcparadise marcparadise deleted the mp/fix-non-default-postgres-port branch October 13, 2015 21:20
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.

4 participants