星期五我使用pg_upgradecluster
(在 Debian Buster 上)从 PostgreSQL 13 升级到 14。这很有效,所以今天我想升级另一台服务器(Linux Mint 20.3 Cinnamon)。这一次它不起作用。这是我所做的:
root@farao:~# pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
13 main 5432 online postgres /srv/local/postgresql/13 /var/log/postgresql/postgresql-13-main.log
14 main 5433 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
root@farao:~# pg_dropcluster --stop 14 main
root@farao:~# pg_upgradecluster -V -v 13 main /srv/local/postgresql/data/14
Use of uninitialized value $newversion in string eq at /usr/bin/pg_upgradecluster line 398.
Use of uninitialized value $_[0] in concatenation (.) or string at /usr/share/perl5/PgCommon.pm line 1049.
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Use of uninitialized value $argv[10] in system at /usr/bin/pg_upgradecluster line 461.
Error: invalid version ''
Error: Could not create target cluster
root@farao:~# pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
13 main 5432 online postgres /srv/local/postgresql/13 /var/log/postgresql/postgresql-13-main.log
root@farao:~# ps -ef | grep postgres
postgres 24351 1306 0 20:57 ? 00:00:00 /usr/lib/postgresql/13/bin/postgres -D /srv/local/postgresql/13 -c config_file=/etc/postgresql/13/main/postgresql.conf -c hba_file=/tmp/pg_hba.UabjBQ.conf
postgres 24353 24351 0 20:57 ? 00:00:00 postgres: 13/main: checkpointer
postgres 24354 24351 0 20:57 ? 00:00:00 postgres: 13/main: background writer
postgres 24355 24351 0 20:57 ? 00:00:00 postgres: 13/main: walwriter
postgres 24356 24351 0 20:57 ? 00:00:00 postgres: 13/main: autovacuum launcher
postgres 24357 24351 0 20:57 ? 00:00:00 postgres: 13/main: stats collector
postgres 24358 24351 0 20:57 ? 00:00:00 postgres: 13/main: logical replication launcher
root 24488 18929 0 20:58 pts/0 00:00:00 grep --color=auto postgres
root@farao:~# cat /tmp/pg_hba.UabjBQ.conf
local all postgres ident
root@farao:~# pg_upgradecluster -V -v 13 main /srv/local/postgresql/data/14
Use of uninitialized value $newversion in string eq at /usr/bin/pg_upgradecluster line 398.
Use of uninitialized value $_[0] in concatenation (.) or string at /usr/share/perl5/PgCommon.pm line 1049.
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Use of uninitialized value $argv[10] in system at /usr/bin/pg_upgradecluster line 461.
Error: invalid version ''
Error: Could not create target cluster
root@farao:~# pg_upgradecluster
Usage: /usr/bin/pg_upgradecluster [OPTIONS] <old version> <cluster name> [<new data directory>]
root@farao:~#
没有-V
参数,结果是一样的。我做错了什么?我需要安装 PERL 模块吗?
备注我只记得我只安装了 postgresql-13 并使用了仍然存在的数据库和配置。PostgreSQL 是否在某处存储有关它创建的集群的信息initdb
?不合逻辑,因为pg_lsclusters
可以找到它。
根据我在 的
man
页面中阅读的内容pg_upgradecluster
,您的命令中可能存在拼写错误。以下是手册页的概要:
保留
-v
并明确添加新版本号:或
-v
完全删除(将默认为最新的可用版本):