我的服务器上安装了CentOs 6.7:
bash-4.1# uname -r
2.6.32-573.18.1.el6.x86_64
服务器重新启动后,由于区域设置问题,我的PostgreSQL 9.6服务器没有启动。
下面是日志错误消息: pgstartup.log
< 2017-01-26 16:33:08.115 IST > LOG: invalid value for parameter "lc_messages": "en_US.UTF-8"
< 2017-01-26 16:33:08.123 IST > LOG: invalid value for parameter "lc_monetary": "en_US.UTF-8"
< 2017-01-26 16:33:08.123 IST > LOG: invalid value for parameter "lc_numeric": "en_US.UTF-8"
< 2017-01-26 16:33:08.123 IST > LOG: invalid value for parameter "lc_time": "en_US.UTF-8"
< 2017-01-26 16:33:08.123 IST > FATAL: configuration file "/var/lib/pgsql/9.6/data/postgresql.conf" contains errors
它期望在系统中提供地区"en_US.UTF-8“。我已经查过了,确实有。
bash-4.1# locale -a | grep en_US
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
en_US
en_US.UTF-8
en_US.iso88591
en_US.iso885915
en_US.utf8
因此,我从postgresql.conf文件中注释了以下行:
#lc_messages = 'en_US.UTF-8' # locale for system error message
# strings
#lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
#lc_numeric = 'en_US.UTF-8' # locale for number formatting
#lc_time = 'en_US.UTF-8' # locale for time formatting
在按上述注释行后,服务器将被启动,但无法登录到服务器,并发出以下错误:
bash-4.1$ psql
psql: FATAL: database locale is incompatible with operating system
DETAIL: The database was initialized with LC_COLLATE "en_US.UTF-8", which is not recognized by setlocale().
HINT: Recreate the database with another locale or install the missing locale.
现在我在系统中有postgres所要求的区域设置,然后它也在哭,不知道问题到底在哪里。
注意:此问题在服务器重新启动后生成。
发布于 2017-02-03 06:22:22
我已经找到了解决这个问题的办法。
实际上,语言环境是由Glibc库提供的。在服务器中,Glibc版本为2.12。
出于某种原因,我们需要2.14版本,不可能通过yum将2.12升级到2.14,因为yum表示它的最新版本。
因此,我们手动编译了2.14源代码并创建了二进制文件。
改变了2.12到2.14的链接,造成了混乱。
解决方案:将sym链接恢复到原来的2.12版本。
寓意:永远不要与glibc搞混,而不是通过将sym链接指向不同的版本。
https://serverfault.com/questions/828737
复制相似问题