0

I am using Linux Mint 17. I installed postgres with apt-get. I got postgres user account, I didn't have to create it. Then I login as postgres and followed these steps:

$ 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

Then I issued these 2 commands:

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

I didn't get any response.

Then I tried createdb and createuser but I can't. Her you can see some informations, I hope it helps.

darko@darko-Lenovo-G570 ~ $ 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
darko@darko-Lenovo-G570 ~ $ sudo -u postgres -i
[sudo] password for darko: 
postgres@darko-Lenovo-G570 ~ $ createuser darko
createuser: could not connect to database postgres: FATAL:  role "postgres" does not exist
Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228
piga
  • 13
  • 1
  • 6
  • The install created a postgres user on the _system_ to run the cluster, but not a corresponding database user. It may have created a 'darko' user if that's who you installed the package as. Try `psql` from your own session and see if that gets you anywhere. – dmfay Dec 26 '16 at 18:40
  • I tried, take a look. – piga Dec 26 '16 at 20:06
  • I tried this: darko@darko-Lenovo-G570 ~ $ psql psql: FATAL: role "darko" does not exist – piga Dec 26 '16 at 20:07
  • Why did you install Postgres-XC if you only want Postgres? –  Jan 24 '17 at 18:29
  • I didn't know what I was doing. – piga Jan 26 '17 at 21:27

1 Answers1

0

I was confused with roles, databases and privilegies so I decided to remove postgresql and install it again. Actually I think that I didn't install it correctly at first because first installation was $ sudo apt-get install postgresql and nothing worked for me, as I described in question. So I decided to kill all postgres processes: $ sudo pkill postgres remove postgresql $ sudo apt-get remove postgresql and build postgresql form source as described in manual postgresql-9.6-A4.pdf (you can download it from internet). This manual is great, you can find everything there. MAYBE SOME OF MY COMMANDS ARE NOT 100% CORRECT BECAUSE IT HAS PASSED FEW DAYS SINCE I SOLVED MY PROBLEM.

piga
  • 13
  • 1
  • 6