-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
The postgres_data_dir variable seems not used when initialising the database #124
Comments
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
Hello, we are still facing this issue and were not able to cleanly resolve it. |
This issue is no longer marked for closure. |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
Indeed, it is stale, but the issue still exists :-) |
This issue is no longer marked for closure. |
That's peculiar, I just installed from official CentOS repo's using this role and overwrote a number of variables, including: postgresql_data_dir: "/var/lib/pgsql/{{ postgresql_version }}/data" which correctly initialized the database in |
I've used the version 13 packages from https://www.postgresql.org/download/linux/redhat/
It turns out the config dir only contains an empty backup and data directory and all the config ends up in the data directory. Running the |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
not stale |
This issue is no longer marked for closure. |
…ata Directory Fixes bugs geerlingguy#158, geerlingguy#40, geerlingguy#124 allowing for a custom data directory
I can confirm that this is an issue with Postgresql 13. I tried it with 12 and the custom |
I defined postgresql_data_dir and it doesn't work. custom data dir was successfully initialized, but PostgreSQL still starts with the default one |
This worked for me:
The postgresql_data_dir variable only initializes a database in the given directory. |
@christopheg solution worked for me (Ubuntu 20). The database gets initialized in the directory set through |
Is this still an issue for using a custom data directory? |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
not stale |
This issue is no longer marked for closure. |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
not stale ...
…On Mon, Sep 19, 2022 at 6:19 PM stale[bot] ***@***.***> wrote:
This issue has been marked 'stale' due to lack of recent activity. If
there is no further activity, the issue will be closed in another 30 days.
Thank you for your contribution!
Please read this blog post
<https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories>
to see the reasons why I mark issues as stale.
—
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALBHSDOD4OSCQOBDEEPISLV7DYGNANCNFSM4MIQCFRQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This issue is no longer marked for closure. |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
Not stale On Dec 23, 2022, at 10:17 PM, stale[bot] ***@***.***> wrote:
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
This issue is no longer marked for closure. |
…ata Directory Fixes bugs geerlingguy#158, geerlingguy#40, geerlingguy#124 allowing for a custom data directory
…irectory Fixes geerlingguy#158, geerlingguy#40, geerlingguy#124 allowing for a custom data directory
There is a problem with - role: geerlingguy.postgresql
postgresql_user: postgres
postgresql_group: postgres
# postgresql_global_config_options:
# - option: listen_addresses
# value: '*'
# - option: unix_socket_directories
# value: '{{ postgresql_unix_socket_directories | join(",") }}'
# - option: log_directory
# value: 'log'
postgres_hba_entries:
- type: host
database: all
user: all
address: '127.0.0.1/32'
method: trust
- type: host
database: all
user: all
address: '::1/128'
method: md5 "msg": "[Errno 2] No such file or directory: b'/usr/lib/postgresql/14/bin/initdb'", |
…irectory Fixes geerlingguy#158, geerlingguy#40, geerlingguy#124 allowing for a custom data directory
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
no stale |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
not stale
…On Fri, Dec 8, 2023 at 1:57 PM github-actions[bot] ***@***.***> wrote:
This issue has been marked 'stale' due to lack of recent activity. If
there is no further activity, the issue will be closed in another 30 days.
Thank you for your contribution!
Please read this blog post
<https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories>
to see the reasons why I mark issues as stale.
—
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALBHSFQ7XUHN3L7TGINF5DYINWKTAVCNFSM4MIQCFR2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBUG43TMOJTGQ2Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
same on 3.5.0 version, Ubuntu 22: fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/lib/postgresql/14/bin/initdb -D /var/lib/postgresql/14/main", "msg": "[Errno 2] No such file or directory: b'/usr/lib/postgresql/14/bin/initdb'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []} As far as I see, there is 16 version directory, not 14. |
…irectory Fixes geerlingguy#158, geerlingguy#40, geerlingguy#124 allowing for a custom data directory
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
no stale
…On Fri, Jul 12, 2024 at 2:57 PM github-actions[bot] < ***@***.***> wrote:
This issue has been marked 'stale' due to lack of recent activity. If
there is no further activity, the issue will be closed in another 30 days.
Thank you for your contribution!
Please read this blog post
<https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories>
to see the reasons why I mark issues as stale.
—
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALBHSAUYXAMPVDFV5JHKJLZMAYK5AVCNFSM4MIQCFR2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMRSGYZDMNJTGE2A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
I have installed postgres 9.6 on ubuntu 16 with the aid of your ansible role which is great. One thing I have noticed however is that the database is initialised using the data path
/var/lib/postgresql/9.6/main
regardless of what was set in the variablepostgresql_data_dir
.So it seems the database has been silently initialized with the default postgres data path and before the database directory is then set as I can see in the logs
TASK [geerlingguy.ansible-role-postgresql : Set PostgreSQL environment variables.] *********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
changed: [10.90.22.11]
Wednesday 15 April 2020 11:27:15 +0000 (0:00:02.252) 0:08:02.882 *******
TASK [geerlingguy.ansible-role-postgresql : Ensure PostgreSQL data directory exists.] ******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
--- before
+++ after
@@ -1,7 +1,7 @@
{
"path": "/custom_path/database/data/postgresql/9.6/main",
}
TASK [geerlingguy.ansible-role-postgresql : Ensure PostgreSQL data directory exists.] ******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
changed: [10.90.22.11]
Wednesday 15 April 2020 11:27:16 +0000 (0:00:00.969) 0:08:03.851 *******
Wednesday 15 April 2020 11:27:17 +0000 (0:00:00.943) 0:08:04.794 *******
TASK [geerlingguy.ansible-role-postgresql : Ensure PostgreSQL database is initialized.] ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
changed: [10.90.22.11]
Wednesday 15 April 2020 11:27:18 +0000 (0:00:01.621) 0:08:06.416 *******
Wednesday 15 April 2020 11:27:18 +0000 (0:00:00.082) 0:08:06.499 *******
TASK [geerlingguy.ansible-role-postgresql : Configure global settings.] ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
--- before: /etc/postgresql/9.6/main/postgresql.conf (content)
+++ after: /etc/postgresql/9.6/main/postgresql.conf (content)
@@ -38,7 +38,7 @@
The default values of these variables are driven from the -D command-line
option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '/var/lib/postgresql/9.6/main' # use data in another directory
+data_directory = '/custom_path/database/data/postgresql/9.6/main'
# (change requires restart)
hba_file = '/etc/postgresql/9.6/main/pg_hba.conf' # host-based authentication file
# (change requires restart)
TASK [geerlingguy.ansible-role-postgresql : Configure global settings.] ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
changed: [10.90.22.11] => (item={u'option': u'data_directory', u'value': u'/custom_path/database/data/postgresql/9.6/main'})
Wednesday 15 April 2020 11:27:19 +0000 (0:00:01.043) 0:08:07.543 *******
The workaround am using at the moment is to run an rsyn command to copy the data directory using this command below. which introduces some inconsistencies sometimes
The text was updated successfully, but these errors were encountered: