pg_lsclusters仍然列出已经被删除的集群吗?

时间:2019-01-04 02:31:30

标签: postgresql

我已经删除了几次群集,但是它仍显示在pg_lsclusters列表中。可能是什么问题?

这是我删除此群集并检查是否确实删除的操作:

  • 停止集群使用pg_ctlcluster 10 3dcitydb stop(成功完成)
  • 使用pg_dropcluster 10 3dcitydb
  • 使用sudo systemctl daemon-reload
  • 删除数据目录(/postgres,我检查它确实已删除。)

但是,无论我尝试如何,它仍然存在。任何意见将是有益的。谢谢!

这是已清除的命令历史记录...

yql@ai4ce-white-ubuntu1804:/data$ sudo pg_ctlcluster 10 3dcitydb stop
[sudo] password for yql: 

yql@ai4ce-white-ubuntu1804:/data$ pg_lsclusters
Ver Cluster  Port Status Owner    Data directory              Log file
10  3dcitydb 5433 down   postgres postgresdb                  /var/log/postgresql/postgresql-10-3dcitydb.log
10  main     5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

yql@ai4ce-white-ubuntu1804:/data$ pg_dropcluster 10 3dcitydb
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
  sudo systemctl daemon-reload

yql@ai4ce-white-ubuntu1804:/data$ pg_lsclusters
Ver Cluster  Port Status Owner     Data directory              Log file
10  3dcitydb 5433 down   <unknown> postgresdb                  /var/log/postgresql/postgresql-10-3dcitydb.log
10  main     5432 online postgres  /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

yql@ai4ce-white-ubuntu1804:/data$ sudo systemctl daemon-reload
yql@ai4ce-white-ubuntu1804:/data$ pg_lsclusters
Ver Cluster  Port Status Owner     Data directory              Log file
10  3dcitydb 5433 down   <unknown> postgresdb                  /var/log/postgresql/postgresql-10-3dcitydb.log
10  main     5432 online postgres  /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

yql@ai4ce-white-ubuntu1804:/data$ sudo ls /postgresdb
base    pg_commit_ts  pg_logical    pg_notify    pg_serial     pg_stat      pg_subtrans  pg_twophase  pg_wal   postgresql.auto.conf
global  pg_dynshmem   pg_multixact  pg_replslot  pg_snapshots  pg_stat_tmp  pg_tblspc    PG_VERSION   pg_xact  postmaster.opts

yql@ai4ce-white-ubuntu1804:/data$ sudo rm -r /postgresdb

yql@ai4ce-white-ubuntu1804:/data$ pg_lsclusters
Ver Cluster  Port Status Owner     Data directory              Log file
10  3dcitydb 5433 down   <unknown> postgresdb                  /var/log/postgresql/postgresql-10-3dcitydb.log
10  main     5432 online postgres  /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log


yql@ai4ce-white-ubuntu1804:/data$ sudo ls /postgresdb
ls: cannot access '/postgresdb': No such file or directory

yql@ai4ce-white-ubuntu1804:/data$ sudo systemctl daemon-reload

yql@ai4ce-white-ubuntu1804:/data$ pg_lsclusters
Ver Cluster  Port Status Owner     Data directory              Log file
10  3dcitydb 5433 down   <unknown> postgresdb                  /var/log/postgresql/postgresql-10-3dcitydb.log
10  main     5432 online postgres  /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

0 个答案:

没有答案