2016-12-26 6 views
0

Ich benutze Linux Mint 17. Ich installierte Postgre mit apt-get. Ich habe postgres Benutzerkonto, ich musste es nicht erstellen. Dann melde ich mich als Postgres und folgte diesen Schritten:Warum kann ich mit postgres nichts anfangen?

$ 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 

Dann gab ich diese 2 Befehle:

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

ich keine Antwort bekommen habe.

Dann versuchte ich createdb und createuser, aber ich kann nicht. Sie können einige Informationen sehen, ich hoffe es hilft.

[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

Die Installation erstellt einen Postgres-Benutzer auf dem _system_ zum Ausführen des Clusters, aber kein entsprechender Datenbankbenutzer. Es hat möglicherweise einen 'Darko' Benutzer erstellt, wenn Sie das Paket als installiert haben. Versuchen Sie 'psql' aus Ihrer eigenen Sitzung und sehen Sie, ob Sie das irgendwo hinbringt. – dmfay

+0

Ich habe versucht, einen Blick darauf werfen. – piga

+0

Ich habe es versucht: Darko @ Darko-Lenovo-G570 ~ $ psql PS: Fatal: Rolle "Darko" existiert nicht – piga

Antwort

0

Ich war verwirrt mit Rollen, Datenbanken und Privilegien, also entschied ich mich, postgresql zu entfernen und erneut zu installieren. Eigentlich denke ich, dass ich es nicht richtig installiert habe, weil die erste Installation war $ sudo apt-get installieren postgresql und nichts funktionierte für mich, wie ich in Frage gestellt. Also beschloss ich, alle Postgres Prozesse zu töten: $ sudo pkill postgres entfernen postgresql $ sudo apt-get remove postgresql und build postgresql Form Quelle wie im manuellen postgresql-9.6-A4.pdf beschrieben (Sie können es herunterladen von Internet). Dieses Handbuch ist großartig, Sie können dort alles finden. VIELLEICHT MEINE BEFEHLE SIND NICHT 100% RICHTIG, WEIL SIE WENIGE TAGE VERLOREN HAT, DA ICH MEIN PROBLEM LÖSELTE.

Verwandte Themen