2017-01-26 12 views
3

私はarch linux(4.8.13-1-ARCH)を使用しています。私は指示通りにPostgreSQLを設定しようとしていますherepostgresql.serviceを開始できませんか?

成功し

[[email protected] ~]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/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 text search configuration will be set to "english". 

Data page checksums are disabled. 

fixing permissions on existing directory /var/lib/postgres/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: 

pg_ctl -D /var/lib/postgres/data -l logfile start 

を行った後、私は、exitコマンドを使用して、私の通常のユーザーに返されます。その後

[[email protected] ~]$ exit 
logout 

、postgresql.serviceを開始しようとしている間、私は次のエラーました:

[[email protected] ~]$ sudo systemctl start postgresql.service 
Failed to start postgresql.service: Unit postgresql.service not found. 

私もサービスの状態が届かないが:

[[email protected] ~]$ sudo systemctl status postgresql.service 
Unit postgresql.service could not be found. 

I私は立ち往生した!

+0

postgresqlのインストールに使用したコマンドは何ですか? –

+0

ありがとう@ MarkStosberg。それは今解決されました... –

答えて

6

最後に、私はこれを考え出しました。だから、現在のファイル

/usr/lib/systemd/system/postgresql-9.6.service 

がすでにありました、私はpostgresql.serviceを開始することができませんでした、このファイルの存在に起因する可能性があります。その後、私は次のようにPostgreSQLの-9.6.serviceを開始しようとしました:あなたは出力を見ることができるよう、

[[email protected] ~]$ sudo systemctl start postgresql-9.6.service 
Failed to start postgresql-9.6.service: Unit postgresql-9.6.service not found. 

そして、再び、それは失敗しました。

postgresql.serviceファイルがこのファイルの存在により関連するプログラムによって作成されていない可能性があるため、sudoを使用してファイルを単に削除しました。その後、私はシステムを再起動しました。私は確かに同じ問題を持つすべての人々に警告したい

[[email protected] ~]$ sudo systemctl status postgresql.service 
[sudo] password for code_master5: 
● postgresql.service - PostgreSQL database server 
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor p 
Active: active (running) since Sat 2017-01-28 09:31:30 IST; 7h ago 
Main PID: 342 (postgres) 
Tasks: 6 (limit: 4915) 
CGroup: /system.slice/postgresql.service 
     ├─342 /usr/bin/postgres -D /var/lib/postgres/data 
     ├─358 postgres: checkpointer process 
     ├─359 postgres: writer process 
     ├─360 postgres: wal writer process 
     ├─361 postgres: autovacuum launcher process 
     └─362 postgres: stats collector process 

Jan 28 09:31:26 BitBox systemd[1]: Starting PostgreSQL database server... 
Jan 28 09:31:28 BitBox postgres[340]: FATAL: the database system is starting up 
Jan 28 09:31:28 BitBox postgres[340]: LOG: database system was shut down at 201 
Jan 28 09:31:29 BitBox postgres[340]: FATAL: the database system is starting up 
Jan 28 09:31:29 BitBox postgres[340]: LOG: MultiXact member wraparound protecti 
Jan 28 09:31:29 BitBox postgres[340]: LOG: database system is ready to accept c 
Jan 28 09:31:29 BitBox postgres[340]: LOG: autovacuum launcher started 
Jan 28 09:31:30 BitBox systemd[1]: Started PostgreSQL database server. 

:あなたは以下の出力を見ることができるように、それは、それ以来、正常に動作しています。あなた自身の責任で行ったことを何でもしてください。これらはシステムファイルなので。あなたの週末を台無しにすることができます!

私はまだこれに少し混乱しています。説明は歓迎です!

関連する問題