on avance...
1 2 3 4 5 6
| root@fe9916a4d964:/# psql --user=replication --host=postgresql-t01 --port=5449 -c "IDENTIFY_SYSTEM" replication=1
Password for user replication:
systemid | timeline | xlogpos | dbname
---------------------+----------+-----------+--------
7036005893330907173 | 1 | 0/17387C0 |
(1 row) |
maintenant j'ai ça, mais je suis root :
root@fe9916a4d964:/# pg_basebackup --host=postgresql-t01 --port=5449 --pgdata=/var/lib/postgresql/data --user=replication --verbose --progress --wal-method=stream --write-recovery-conf --password
Password:
pg_basebackup: error: could not access directory "/var/lib/postgresql/data": Permission denied
et pourtant
1 2 3 4 5 6 7 8
| root@fe9916a4d964:/# cd /var/lib/postgresql/
ls -l
total 0
drwx------. 2 postgres root 6 May 18 08:18 data
postgres@fe9916a4d964:~$ whoami
postgres
postgres@fe9916a4d964:~$ cd data
-bash: cd: data: Permission denied |
je ne peux pas entrer dans data, que je sois en root ou postgres dans le container. C'st justement le volume qui est monté dans le container lorsque je le démarre en mode bash
docker run -it --rm -v /DBData/replica2:/var/lib/postgresql/data postgres:14 bash
Partager