web-dev-qa-db-ja.com

サーバーPostgreSQL 11を起動できません:「pg_ctl:サーバーを起動できませんでした」

私はCentOS Linuxリリース7.5.1804(コア)にいます

postgresとしてログインして実行すると、次のようになります。

bash-4.2$ /usr/pgsql-11/bin/initdb -D /var/lib/pgsql/11/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

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.

creating directory /var/lib/pgsql/11/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-Host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/pgsql-11/bin/pg_ctl -D /var/lib/pgsql/11/data -l logfile start

bash-4.2$

それから私は走ります

bash-4.2$ /usr/pgsql-11/bin/pg_ctl start -l logfile -D /var/lib/pgsql/11/data
waiting for server to start..../bin/sh: logfile: Permission denied
 stopped waiting
pg_ctl: could not start server
Examine the log output.
bash-4.2$ date
Wed Oct 24 01:50:44 -05 2018
bash-4.2$

GOOGLEで「サーバーの起動を待機しています.../bin/sh:logfile:Permission denied」を検索しましたが、このエラーはMACでのみ発生し、解決策は表示されません...

また走る

bash-4.2$ postgres --version;postmaster --version;
postgres (PostgreSQL) 11.0
postgres (PostgreSQL) 11.0
bash-4.2$

postgreSQL 11は問題なくインストールされていると思いますが、サーバーを起動できません。

私はこの行でインストールします:

yum install postgresql-jdbc.noarch postgresql-jdbc-javadoc.noarch postgresql-unit11.x86_64 postgresql-unit11-debuginfo.x86_64 postgresql11.x86_64 postgresql11-contrib.x86_64 postgresql11-debuginfo.x86_64 postgresql11-devel.x86_64 postgresql11-docs.x86_64 postgresql11-libs.x86_64 postgresql11-odbc.x86_64 postgresql11-plperl.x86_64 postgresql11-plpython.x86_64 postgresql11-pltcl.x86_64 postgresql11-server.x86_64 postgresql11-tcl.x86_64 postgresql11-test.x86_64

[postgresql11-llvmjit.x86_64]は、多くの依存関係が必要なため、追加しませんでした。

CentOS Linuxリリース7.5.1804 + PostgreSQL 11?

追加のソフトウェアをインストールする必要がありますか?

4
VyR

logfileは文字どおりに解釈されるものではなく、PostgreSQLサーバープロセスが書き込み権限を持つファイルに置き換える必要があります。

通常はそのようにはせず、postgresql.confを編集してlog_destinationlogging_collectorlog_directoryおよびlog_filenameを構成します。次に、-lオプションなしでPostgreSQLを起動します。

systemctlでPostgreSQLを起動する試みはおそらく成功しました。あなたはチェックすることができます

systemctl status postgresql-11
5
Laurenz Albe

それで、私は同じ問題に直面しました。まず、次のコマンドを使用して、マシン上ですべてのサーバーがアクティブかどうか、およびどのサーバーがアクティブであるかを確認しました。

brew services list

次に、いくつかのサーバーをアクティブにしていたため、posgresqlサーバーを機能させるためにサーバーを停止する必要があるため、サーバーを停止しました。

brew services stop < name of the server/s active >

次に、新しいデータベースを作成しました

initdb /usr/local/var/postgres2

を使用してサーバーを起動しました

 pg_ctl -D /usr/local/var/postgres2 -l logfile start

私のためにうまくいきました! ここに画像の説明を入力

0
smriti