2016-12-26 9 views
0

私はLinux Mint 17を使用しています。私はapt-getでpostgresをインストールしました。私はpostgresユーザーアカウントを持っていましたが、作成する必要はありませんでした。その後、私はpostgresのとしてログインし、次の手順に従っ:なぜ私はポストグルで何もできませんか?

$ initdb -D /usr/local/pgsql/data 
... 
Success. 
You can now start the database server of the Postgres-XC coordinator using: 

    postgres --coordinator -D /usr/local/pgsql/data 
or 
    pg_ctl start -D /usr/local/pgsql/data -Z coordinator -l logfile 

You can now start the database server of the Postgres-XC datanode using: 

    postgres --datanode -D /usr/local/pgsql/data 
or 
    pg_ctl start -D /usr/local/pgsql/data -Z datanode -l logfile 

それから私は、これらの2つのコマンドを発行:

$ pg_ctl start -D /usr/local/pgsql/data -Z coordinator -l logfile 
$ pg_ctl start -D /usr/local/pgsql/data -Z datanode -l logfile 

私は任意の応答を取得できませんでした。

私はcreatedbとcreateuserを試しましたが、できません。彼女はあなたがいくつかの情報を見ることができる、

[email protected] ~ $ ps aux | grep postgres 
postgre+ 1332 0.0 0.3 53304 6800 ?  S 07:59 0:00 /usr/bin/postgres --datanode -D /var/lib/postgres-xc/DN1 
postgre+ 1363 0.0 0.3 53304 6808 ?  S 07:59 0:00 /usr/bin/postgres --datanode -D /var/lib/postgres-xc/DN2 
postgre+ 1372 0.0 0.0 53304 1224 ?  Ss 07:59 0:00 postgres: checkpointer process       
postgre+ 1373 0.0 0.0 53304 1456 ?  Ss 07:59 0:00 postgres: writer process         
postgre+ 1374 0.0 0.0 53304 1224 ?  Ss 07:59 0:00 postgres: wal writer process        
postgre+ 1375 0.0 0.1 53724 2220 ?  Ss 07:59 0:00 postgres: autovacuum launcher process     
postgre+ 1376 0.0 0.0 23256 1256 ?  Ss 07:59 0:00 postgres: stats collector process      
postgre+ 1419 0.0 0.0 53304 1232 ?  Ss 07:59 0:00 postgres: checkpointer process       
postgre+ 1420 0.0 0.0 53304 1464 ?  Ss 07:59 0:00 postgres: writer process         
postgre+ 1421 0.0 0.0 53304 1232 ?  Ss 07:59 0:00 postgres: wal writer process        
postgre+ 1423 0.0 0.1 53724 2228 ?  Ss 07:59 0:00 postgres: autovacuum launcher process     
postgre+ 1424 0.0 0.0 23256 1264 ?  Ss 07:59 0:00 postgres: stats collector process      
postgre+ 1440 0.0 0.3 53304 6856 ?  S 07:59 0:00 /usr/bin/postgres --coordinator -D /var/lib/postgres-xc/CN 
postgre+ 1451 0.0 0.0 53304 1224 ?  Ss 07:59 0:00 postgres: pooler process         
postgre+ 1453 0.0 0.0 53304 1712 ?  Ss 07:59 0:00 postgres: checkpointer process        
postgre+ 1454 0.0 0.0 53304 1464 ?  Ss 07:59 0:00 postgres: writer process         
postgre+ 1455 0.0 0.0 53304 1456 ?  Ss 07:59 0:00 postgres: wal writer process        
postgre+ 1456 0.0 0.5 63548 11736 ?  Ss 07:59 0:00 postgres: autovacuum launcher process      
postgre+ 1457 0.0 0.0 23256 1264 ?  Ss 07:59 0:00 postgres: stats collector process       
postgre+ 1481 0.0 0.1 16412 2716 ?  S 07:59 0:00 /usr/bin/gtm -D /var/lib/postgres-xc/GTM -l /var/log/postgres-xc/datanode.log 
darko  8426 0.0 0.0 5908 856 pts/0 S+ 18:34 0:00 grep --colour=auto postgres 
[email protected] ~ $ sudo -u postgres -i 
[sudo] password for darko: 
[email protected] ~ $ createuser darko 
createuser: could not connect to database postgres: FATAL: role "postgres" does not exist 
+0

インストールでは、クラスタを実行するために_system_にpostgresユーザーが作成されましたが、対応するデータベースユーザーは作成されませんでした。それはあなたがパッケージをインストールした人であれば、「ダークー」ユーザーを作成している可能性があります。あなた自身のセッションから 'psql'を試してみてください。 – dmfay

+0

私は試してみました。 – piga

+0

私はこれを試しました:darko-darko-Lenovo-G570〜$ psql psql:FATAL:ロール "darko"は存在しません – piga

答えて

0

私は役割、データベース、および特権と混同されていましたので、postgresqlを削除してもう一度インストールすることにしました。実際に私は最初に正しくインストールされていないと思います。最初にインストールしたのは です。sudo apt-get postgresql をインストールしてください。だから私は、すべてのpostgresプロセスを強制終了することを決定した: $ sudoのpkillはpostgresの 削除にpostgresql の$ sudoは、マニュアルのpostgresql-9.6-A4.pdfで説明したようにPostgreSQLの とビルドPostgreSQLのフォームのソースを削除apt-getは(あなたからそれをダウンロードすることができますインターネット)。このマニュアルは素晴らしいです、あなたはそこにあるすべてを見つけることができます。 MAYBE私の命令の中には、私の問題を解決してから数日を過ぎたので、100%正確ではありません。

関連する問題