11
  1. I apt-get installed Postgres 9.2.4 (using PPA).
  2. I used pg_dropcluster --stop 9.2 main to remove the default database cluster, because I intended on creating a new cluster on a separate SSD volume (a Rackspace block storage volume) that was just mounted.
  3. I created that new cluster whose data resides on my SSD volume and started it (ps shows all the normal Postgres processes running for that new cluster and I'm able to open a Postgres shell and run SQL - i.e., it's running fine). Now when I run pg_lsclusters there are none listed.

The main cluster listed just fine before I deleted it. Why won't my new cluster show up, even when it's running? I've even rebooted the server (just in case).

5
  • Well, how did you create the new cluster? Also, host OS and version? Ubuntu ... ? Debian ... ? Other? (Not many distros use pg_wrapper though) Commented Jun 6, 2013 at 3:51
  • @CraigRinger - I used initdb -D /the/dir/ - I think I just realized that I should have used pg_createcluster -d /the/dir/ shouldn't I have? Are they both the same, minus whatever extra meta data that Postgres stores about the cluster? (I'm on Ubuntu 12.04.2) Commented Jun 6, 2013 at 3:53
  • Wow, indeed that is the case - and what an awesome tool with such a simple syntax as pg_ctlcluster 9.2 mycluster start Commented Jun 6, 2013 at 3:59
  • Yep, you got it - if you want to use pg_wrapper you have to do so consistently. Commented Jun 6, 2013 at 4:10
  • @CraigRinger - thanks. If you put that into an answer (I made one, but it's not terrific), I'll accept yours and remove mine. Commented Jun 6, 2013 at 4:12

1 Answer 1

9

In order to use these postgres common tools with a cluster, they need to be used consistently. You would use pg_createcluster -d /path/to/data, instead of initdb. pg_createcluster adds the cluster to postgres-common in order to facilitate these handy operations. It is a wrapper, just like pg_ctlcluster, around the lower-level tools (e.g., initdb and pg_ctl), providing access from one place to operating on all of your clusters. It also has some defaults, such as an automatically configured log location based on the cluster name. this means you don't have to use -l /var/log/my-custom.log when you're creating or starting the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.