-
Notifications
You must be signed in to change notification settings - Fork 55
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
recovery.conf in pgdata not data directory. #30
Comments
Hi, I'm not sure to understand the difference here.
The |
We also start postgres with the same value of pgdata. pgdata in pg_ctl start -D $PGDATA refers to the config directory (where postgresql.conf is). I could set up my cluster like this:
EDIT: I modified one of my cluster for a better exemple. |
Hi, Ok, well, this is an exotic way to setup PostgreSQL, first time I see this :) Moreover, that make me wonder why they decided to put the I gave it some minutes yesterday to try to create an instance this way, but when I tried to start it, it complained it couldn't find the value of parameter "port" with the following command:
Could you provide me with some quick steps to reproduce your test case? Thank you, |
Hi, I was shocked when I discovered this too... Especially the first time I tried to switchover and postgres wouldn't find my recovery.conf :). The setup is done like this:
Benoit. On a side note I wonder where postgres will put the postgresql.auto.conf. I have to check this. UPDATE: I miss read you message. But postgres -C works for me.. |
Hi, This setup is by default on Ubuntu. (and Debian ?) Would you be interested, if I modify (pgsqlms & README.md) to do the following ?
Benoit. |
Hello Benoit, Patch are welcome ! But first, before you start working on this, I need to understand...especially because I still wasn't able to reproduce this. Here is my setup: $ pwd
/home/ioguix/var/lib/pgsql/test
$ ls
conf data
$ ls conf
pg_hba.conf pg_ident.conf postgresql.conf
$ ls data
base global pg_clog pg_multixact pg_notify pg_serial pg_snapshots pg_stat pg_stat_tmp pg_subtrans pg_tblspc pg_twophase PG_VERSION pg_xlog
$ grep data_directory conf/postgresql.conf
data_directory = '/home/ioguix/var/lib/pgsql/test/data' # use data in another directory
$ grep ^port conf/postgresql.conf
port = 5435
$ pg_ctl -D /home/ioguix/var/lib/pgsql/test/conf status
FATAL: invalid value for parameter "port": ""
pg_ctl: could not determine the data directory using command ""/home/ioguix/usr/local/pgsql/REL9_3_12/bin/postgres" -C data_directory -D "/home/ioguix/var/lib/pgsql/test/conf" " Moreover, as far as I know, Debian/Ubuntu does not setup cluster this way. They put the conf files (and some additional ones) in $ ls /etc/postgresql/9.4/main/
environment pg_ctl.conf pg_hba.conf pg_ident.conf postgresql.conf start.conf
$ sudo pg_ctlcluster 9.4/main start
$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
9.4 main 5432 online postgres /var/lib/postgresql/9.4/main /var/log/postgresql/postgresql-9.4-main.log
$ ps f -u postgres
PID TTY STAT TIME COMMAND
19749 ? S 0:00 /usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf
19751 ? Ss 0:00 \_ postgres: checkpointer process
19752 ? Ss 0:00 \_ postgres: writer process
19753 ? Ss 0:00 \_ postgres: wal writer process
19754 ? Ss 0:00 \_ postgres: autovacuum launcher process
19755 ? Ss 0:00 \_ postgres: stats collector process |
About this, you can make a pull request whenever you can, I'll review it quickly, I promise :) I'll take care of these two patches if I find some time in one or two weeks and you couldn't do it yet. Thanks! |
Hi, For the --pgdata / -D, I prefer long arguments also. I opted for the lazy solution. You are right for the debian thing. I realised it this weekend while testing stuff. Sorry. Here is my setup, tell me if you need more infos. How do you start your cluster ? (postmaster.opts):
Config:
Start / tests:
|
OK, I found my problem, just some issues with my environment. Anyway, if you have some time to produce a patch to add this /ioguix |
I did the pull request. To answer my question from earlier: postgresql.auto.conf goes into the data_directory when data_directory and PGDATA are different. Benoit |
I just answered in #34. So now, it boil down to:
|
Replying to myself: we can not use start_opts because the RA itself needs to know about the datadir path for PG_VERSION, recovery.conf, the controldata and so on... Sorry for the noise :) |
I just merged your PR from #35. ISTM we can now close this issue. Thank you! |
Hi,
I think we should create the new recovery.conf in the data directory not PGDATA.
https://www.postgresql.org/docs/9.4/static/continuous-archiving.html
Create a recovery command file recovery.conf in the cluster data directory (see Chapter 26).
postgresql.conf
Benoit
The text was updated successfully, but these errors were encountered: