New DB cluster.

From: "Ron Watkins" <rwatki(at)gmail(dot)com>
To: "'pgsql-novice'" <pgsql-novice(at)postgresql(dot)org>
Subject: New DB cluster.
Date: 2018-02-22 18:21:15
Message-ID: 2c7401d3ac09$edecab30$c9c60190$@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I finally got postgresql working on the host.

Next, I read a web-site which said to use a different directory for your
postgres database, you would first remove the old directory then run the
init commands to create a new cluster. However, when I tried that I ran into
a problem.

Now im out of action again with no database and no server running.

postgres(at)localhost ~$ pg_ctl initdb -D /pgsql/data

The files belonging to this database system will be owned by user
"postgres".

This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /pgsql/data ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting dynamic shared memory implementation ... posix

creating configuration files ... ok

running bootstrap script ... ok

performing post-bootstrap initialization ... ok

syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections

You can change this by editing pg_hba.conf or using the option -A, or

--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

/usr/pgsql-10/bin/pg_ctl -D /pgsql/data -l logfile start

postgres(at)localhost ~$ pg_ctl -D /pgsql/data -l logfile start

waiting for server to start.... stopped waiting

pg_ctl: could not start server

Examine the log output.

postgres(at)localhost ~$ cat logfile

2018-02-22 11:18:51.702 MST [3113] LOG: listening on IPv6 address "::1",
port 5432

2018-02-22 11:18:51.702 MST [3113] LOG: listening on IPv4 address
"127.0.0.1", port 5432

2018-02-22 11:18:51.703 MST [3113] FATAL: could not create lock file
"/var/run/postgresql/.s.PGSQL.5432.lock": No such file or dire
ctory

2018-02-22 11:18:51.703 MST [3113] LOG: database system is shut down

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Laurenz Albe 2018-02-23 07:18:52 Re: New DB cluster.
Previous Message David G. Johnston 2018-02-22 16:45:57 Re: Differing data directories