首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我不能和postgres做任何事?

为什么我不能和postgres做任何事?
EN

Stack Overflow用户
提问于 2016-12-26 18:01:58
回答 1查看 303关注 0票数 0

我使用Linux 17,我用apt-get安装了postgres。我有postgres用户帐户,我不需要创建它。然后,我以postgres的身份登录,并遵循以下步骤:

代码语言:javascript
复制
$ 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

然后我发出了以下两个命令:

代码语言:javascript
复制
$ pg_ctl start -D /usr/local/pgsql/data -Z coordinator -l logfile
$ pg_ctl start -D /usr/local/pgsql/data -Z datanode -l logfile

我没有得到任何回应。

然后我试着创作和创作,但是我做不到。她你可以看到一些信息,我希望它能有所帮助。

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-24 16:51:08

我被角色、数据库和特权混淆了,所以我决定删除postgresql并重新安装它。实际上,我认为我一开始没有正确地安装它,因为第一次安装是$ sudo apt-获取安装postgresql,没有什么对我有效,正如我所描述的。因此,我决定终止所有postgres进程:$ sudo删除postgresql $ sudo获取、删除postgresql和构建postgresql表单源,如手动PostgreSQL9.6-A4.pdf所述(您可以从互联网下载它)。这本手册很好,你可以在那里找到所有的东西。也许我的一些命令不是100%正确的,因为我解决问题已经过了几天了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41334723

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档