私は以下のコマンドを実行するたびにRHEL7で常に失敗します。私は別の同様のOS(Newer)で試してみましたが、これはやっておらず、うまく動作します。Postgresql 9.6 InitDBが失敗する
ディレクトリのパーミッションを調べ、selinuxを無効にして、ロケールを調べましたが、これらの設定は他のサーバーの設定と一致します。
/usr/pgsql-9.6/bin/postgresql96-setup initdb
ログ出力:
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/pgsql/9.6/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 64MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... < 2017-10-23 20:13:54.035 BST > LOG: invalid value for parameter "lc_messages": "en_US.UTF-8"
< 2017-10-23 20:13:54.035 BST > LOG: invalid value for parameter "lc_monetary": "en_US.UTF-8"
< 2017-10-23 20:13:54.035 BST > LOG: invalid value for parameter "lc_numeric": "en_US.UTF-8"
< 2017-10-23 20:13:54.035 BST > LOG: invalid value for parameter "lc_time": "en_US.UTF-8"
< 2017-10-23 20:13:54.035 BST > FATAL: configuration file "/var/lib/pgsql/9.6/data/postgresql.conf" contains errors
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/pgsql/9.6/data"
/usr/lib/locale 'ディレクトリにシンボリックリンク(またはコピー)を作成できます。 'initdb --locale = LOCALE'を使ってあなたのロケール設定を上書きすることができます。 '--no-locale'や' --locale = C'を使って、システムに何も仮定させないようにすることもできます。 – joop