-
Notifications
You must be signed in to change notification settings - Fork 210
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
Conversation
a887d0a
to
7dec949
Compare
7dec949
to
d323081
Compare
@@ -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'] %>}, |
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 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.
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.
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
d323081
to
8681f9d
Compare
👍 - lgtm. Also 👍 to @stevendanna's suggestion of listen and connect port differences, someday. |
👍 Looks good, MWR |
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.
8681f9d
to
b894d70
Compare
Use configured port everywhere we talk to postgres
Fixes #459 and allows a custom port to be specified in chef-server postgresql settings.