1

我似乎被夹在两个操作之间,既pg_upgrade要更改PostgreSQL主要版本,pg_ctl又要控制old cluster.

[Sun Dec 30 09:29 rich@HQ /usr/local/var] /usr/local/Cellar/postgresql@10/10.6/bin/pg_upgrade -v \
>     -b /usr/local/Cellar/postgresql@10/10.6/bin \
>     -B /usr/local/Cellar/postgresql/11.1/bin \
>     -d /usr/local/var/postgres.old \
>     -D /usr/local/var/postgres
Running in verbose mode
"/usr/local/Cellar/postgresql@10/10.6/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/usr/local/var/postgres.old" -o "-p 50432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000  -c listen_addresses='' -c unix_socket_permissions=0700" start >> "pg_upgrade_server.log" 2>&1

There seems to be a postmaster servicing the old cluster.
Please shutdown that postmaster and try again.
Failure, exiting

我试图重命名/usr/local/var/postgres/postgresql.pid,但这并没有解决任何问题。文档说我可以pg_ctl用来关闭邮局主管,但这不起作用:

[Sun Dec 30 09:44 rich@HQ ~] pg_ctl --pgdata=/usr/local/var/postgres start -m fast
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start....2018-12-30 09:44:33.541 EST [12042] FATAL:  database files are incompatible with server
2018-12-30 09:44:33.541 EST [12042] DETAIL:  The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.1.
 stopped waiting
pg_ctl: could not start server
Examine the log output.

所以不关闭postmaster就无法升级版本,而关闭postmaster需要初始化新版本。我被抓住了。任何关于我如何开始11.1工作的见解都值得赞赏。

更新

尝试处理旧版本后更新日志显示如下:

-----------------------------------------------------------------
    pg_upgrade run on Tue Jan  1 21:22:45 2019
-----------------------------------------------------------------

command: "/usr/local/Cellar/postgresql@10/10.6/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/usr/local/var/postgres.old" -o "-p 50432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000  -c listen_addresses='' -c unix_socket_permissions=0700" start >> "pg_upgrade_server.log" 2>&1
pg_ctl: another server might be running; trying to start server anyway
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
    Referenced from: /usr/local/Cellar/postgresql@10/10.6/bin/postgres
    Reason: image not found
no data was returned by command ""/usr/local/Cellar/postgresql@10/10.6/bin/postgres" -V"
The program "postgres" is needed by pg_ctl but was not found in the
same directory as "/usr/local/Cellar/postgresql@10/10.6/bin/pg_ctl".
Check your installation.


[Tue Jan 01 21:23 rich@HQ /usr/local/Cellar/postgresql@10/10.6/bin] ll
total 18960
drwxr-xr-x  38 rich  admin   1.3K Dec 28 17:01 .
drwxr-xr-x  14 rich  admin   476B Dec 28 16:56 ..
-r-xr-xr-x   1 rich  admin    51K Nov 16 04:56 clusterdb
-r-xr-xr-x   1 rich  admin    55K Nov 16 04:56 createdb
-r-xr-xr-x   1 rich  admin    59K Nov 16 04:56 createuser
-r-xr-xr-x   1 rich  admin    51K Nov 16 04:56 dropdb
-r-xr-xr-x   1 rich  admin    51K Nov 16 04:56 dropuser
-r-xr-xr-x   1 rich  admin   789K Nov 16 04:56 ecpg
-r-xr-xr-x   1 rich  admin   113K Nov 16 04:56 initdb
-r-xr-xr-x   1 rich  admin    30K Nov 16 04:56 oid2name
-r-xr-xr-x   1 rich  admin    26K Nov 16 04:56 pg_archivecleanup
-r-xr-xr-x   1 rich  admin   102K Nov 16 04:56 pg_basebackup
-r-xr-xr-x   1 rich  admin    30K Nov 16 04:56 pg_config
-r-xr-xr-x   1 rich  admin    38K Nov 16 04:56 pg_controldata
-r-xr-xr-x   1 rich  admin    52K Nov 16 04:56 pg_ctl
-r-xr-xr-x   1 rich  admin   351K Nov 16 04:56 pg_dump
-r-xr-xr-x   1 rich  admin    92K Nov 16 04:56 pg_dumpall
-r-xr-xr-x   1 rich  admin    51K Nov 16 04:56 pg_isready
-r-xr-xr-x   1 rich  admin    65K Nov 16 04:56 pg_receivewal
-r-xr-xr-x   1 rich  admin    70K Nov 16 04:56 pg_recvlogical
-r-xr-xr-x   1 rich  admin    47K Nov 16 04:56 pg_resetwal
-r-xr-xr-x   1 rich  admin   148K Nov 16 04:56 pg_restore
-r-xr-xr-x   1 rich  admin    78K Nov 16 04:56 pg_rewind
-r-xr-xr-x   1 rich  admin    26K Nov 16 04:56 pg_standby
-r-xr-xr-x   1 rich  admin    31K Nov 16 04:56 pg_test_fsync
-r-xr-xr-x   1 rich  admin    26K Nov 16 04:56 pg_test_timing
-r-xr-xr-x   1 rich  admin   120K Nov 16 04:56 pg_upgrade
-rw-------   1 rich  admin   796B Dec 28 17:04 pg_upgrade_internal.log
-rw-------   1 rich  admin   358B Dec 28 17:04 pg_upgrade_server.log
-rw-------   1 rich  admin   358B Dec 28 17:04 pg_upgrade_utility.log
-r-xr-xr-x   1 rich  admin    76K Nov 16 04:56 pg_waldump
-r-xr-xr-x   1 rich  admin   122K Nov 16 04:56 pgbench
-r-xr-xr-x   1 rich  admin   5.8M Nov 16 04:55 postgres
lrwxr-xr-x   1 rich  admin     8B Nov 16 04:55 postmaster -> postgres
-r-xr-xr-x   1 rich  admin   544K Nov 16 04:56 psql
-r-xr-xr-x   1 rich  admin    59K Nov 16 04:56 reindexdb
-r-xr-xr-x   1 rich  admin    64K Nov 16 04:56 vacuumdb
-r-xr-xr-x   1 rich  admin    30K Nov 16 04:56 vacuumlo
4

0 回答 0