加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 在升级9.5到9.6期间无法创建目标群集

发布时间:2020-12-13 16:02:50 所属栏目:百科 来源:网络整理
导读:我在ubuntu 16.04上,并在其上安装postgres 9.5 然后我将postgres 9.5升级到9.6,然后按照postgresql offical download page安装9.6: 然后我运行apt install postgresql-9.6,安装完成后,运行以下命令进行升级 # stop the 9.6 $sudo pg_dropcluster 9.6 main -
我在ubuntu 16.04上,并在其上安装postgres 9.5

然后我将postgres 9.5升级到9.6,然后按照postgresql offical download page安装9.6:

enter image description here

然后我运行apt install postgresql-9.6,安装完成后,运行以下命令进行升级

# stop the 9.6 
$sudo pg_dropcluster 9.6 main --stop

# upgrade 9.5 to latest version
$sudo pg_upgradecluster 9.5 main

sudo pg_upgradecluster 9.5 main
Stopping old cluster...
Notice: extra pg_ctl/postgres options given,bypassing systemctl for stop operation
Disabling connections to the old cluster during upgrade...
Restarting old cluster with restricted connections...
Redirecting start request to systemctl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en_US:en",LC_ALL = (unset),LC_CTYPE = "UTF-8",LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Error: The locale requested by the environment is invalid.
Error: Could not create target cluster

然后我尝试使用psql命令连接旧集群.但是错误:

$psql -U postgres -h localhost
psql: FATAL:  no pg_hba.conf entry for host "::1",user "postgres",database "postgres",SSL on
FATAL:  no pg_hba.conf entry for host "::1",SSL off

似乎pg_hba.conf是错误的,然后我在/etc/postgresql/9.5/main/pg_hba.conf检查pg_hba.conf,但看起来很好:

local   all             postgres                                peer

解决方法

我能找到解决此问题的唯一解决方案是运行以??下命令:

export LC_CTYPE=en_US.UTF-8 export LC_ALL=en_US.UTF-8

在继续sudo pg_upgradecluster 9.5 main之前

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读