Postgresql 9.2 Ubuntu - is not starting

Started by Patrick Bover 9 years ago8 messagesgeneral
Jump to latest
#1Patrick B
patrickbakerbr@gmail.com

Hi guys,

I've installed potgres on a Ubuntu machine.

When I start it, it doesn't start...

/etc/init.d/postgresql status

*●* postgresql.service - PostgreSQL RDBMS

Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor
preset: enabled)
Active: *active (exited)* since Tue 2016-08-02 19:54:06 UTC; 7min ago
Process: 12963 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 12963 (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0
CGroup: /system.slice/postgresql.service

But when looking for the process:
ps fax/ps aux

... it doesn't show postgres.

Also, the logs aren't being created. the pg_log folder is empty.

It's my first time using Ubuntu....

I've done a pg_basebackup from my master and I'm trying to start this slave
server.

Do you guys know what should be going on?

Cheers
Patrick

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Patrick B (#1)
Re: Postgresql 9.2 Ubuntu - is not starting

On 08/02/2016 01:04 PM, Patrick B wrote:

Hi guys,

I've installed potgres on a Ubuntu machine.

Postgres version?

Ubuntu version?

How did you install Postgres and from where?

When I start it, it doesn't start...

Show the command you used to start it.

/etc/init.d/postgresql status

*●*postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled;
vendor preset: enabled)
Active: *active (exited)*since Tue 2016-08-02 19:54:06 UTC; 7min ago
Process: 12963 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 12963 (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0
CGroup: /system.slice/postgresql.service

But when looking for the process:
ps fax/ps aux

... it doesn't show postgres.

Also, the logs aren't being created. the pg_log folder is empty.

It's my first time using Ubuntu....

I've done a pg_basebackup from my master and I'm trying to start this
slave server.

Do you guys know what should be going on?

Cheers
Patrick

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Patrick B
patrickbakerbr@gmail.com
In reply to: Adrian Klaver (#2)
Re: Postgresql 9.2 Ubuntu - is not starting

2016-08-03 8:13 GMT+12:00 Adrian Klaver <adrian.klaver@aklaver.com>:

On 08/02/2016 01:04 PM, Patrick B wrote:

Hi guys,

I've installed potgres on a Ubuntu machine.

Postgres version?

have a look on the subjec of this email (9.2)

Ubuntu version?

Ubuntu 16.04.1 LTS

How did you install Postgres and from where?

apt-get install postgresql-9.2 postgresql-contrib-9.2
dpkg -l postgresql

When I start it, it doesn't start...

Show the command you used to start it.
<adrian.klaver@aklaver.com>

/etc/init.d/postgres start/stop/restart

#4Patrick B
patrickbakerbr@gmail.com
In reply to: Patrick B (#3)
Re: Postgresql 9.2 Ubuntu - is not starting

So, I found a log file on /var/log/postgres/

DETAIL: "max_stack_depth" must not exceed 7680kB.

HINT: Increase the platform's stack depth limit via "ulimit -s" or local
equivalent.
2016-08-02 19:54:06.293 UTC|12960|FATAL: configuration file
"/etc/postgresql/9.2/main/postgresql.conf" contains errors

I changed the max_stack_depth value on postgresql.conf.

Now, I'm getting this error:

could not open file "pg_xlog/00000002000014AB0000000B" (log file 5291,

segment 11): No such file or directory

The wal_files aren't inside pg_xlog... I store them in a different folder.
Will try to solve this.

#5Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Patrick B (#3)
Re: Postgresql 9.2 Ubuntu - is not starting

On 08/02/2016 01:17 PM, Patrick B wrote:

2016-08-03 8:13 GMT+12:00 Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>>:

On 08/02/2016 01:04 PM, Patrick B wrote:

Hi guys,

I've installed potgres on a Ubuntu machine.

Postgres version?

have a look on the subjec of this email (9.2)

Ubuntu version?

Ubuntu 16.04.1 LTS

How did you install Postgres and from where?

apt-get install postgresql-9.2 postgresql-contrib-9.2
dpkg -l postgresql

From the PGDG repos or Ubuntu?

I would suggest the PGDG repos as they seem to pick up the version
updates sooner.

When I start it, it doesn't start...

Show the command you used to start it.
<mailto:adrian.klaver@aklaver.com>

/etc/init.d/postgres start/stop/restart

Short version:

That probably should be postgresql not postgres

Long version:

https://help.ubuntu.com/community/PostgreSQL

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6John R Pierce
pierce@hogranch.com
In reply to: Patrick B (#3)
Re: Postgresql 9.2 Ubuntu - is not starting

On 8/2/2016 1:17 PM, Patrick B wrote:

Ubuntu 16.04.1 LTS

How did you install Postgres and from where?

apt-get install postgresql-9.2 postgresql-contrib-9.2
dpkg -l postgresql

When I start it, it doesn't start...

Show the command you used to start it.

/etc/init.d/postgres start/stop/restart

can you show the output of...

pg_lsclusters

?

ubuntu has this whole infrastructure to support mutliple concurrent
postgres installs... the init.d/postgres 'service' will only start
postgres clusters that are configured to autostart as shown by pg_lsclusters

--
john r pierce, recycling bits in santa cruz

#7Patrick B
patrickbakerbr@gmail.com
In reply to: Adrian Klaver (#5)
Re: Postgresql 9.2 Ubuntu - is not starting

Short version:

That probably should be postgresql not postgres

Long version:

https://help.ubuntu.com/community/PostgreSQL

<adrian.klaver@aklaver.com>

Yep.. my mistake..

/etc/init.d/postgresql start/stop/restart

#8Patrick B
patrickbakerbr@gmail.com
In reply to: John R Pierce (#6)
Re: Postgresql 9.2 Ubuntu - is not starting

This is now solved guys.

There were three problems.

1 - I was looking for the logs on /var/lib/postgresql/9.2/main/pg_log. And
it's wrong. On ubuntu, the logs are: /var/log/postgresql

2 - I just changed the max_stack_depth to the default

DETAIL: "max_stack_depth" must not exceed 7680kB.

HINT: Increase the platform's stack depth limit via "ulimit -s" or local
equivalent.
2016-08-02 19:54:06.293 UTC|12960|FATAL: configuration file
"/etc/postgresql/9.2/main/postgresql.conf" contains errors

3 - My wal_files aren't being stored into pg_xlog. I use a different folder
in a different partition, because my servers use SATA disks.
As I use centOS as Postgres Server, the recovery.conf was written for
postgres and the restore_command and cleanup weren't right.
I just had to ajust them to Ubuntu (by putting the entire path) and it
started to work.

Now, the server is restoring the wal_files and it's all good

restored log file "00000002000014AB00000063" from archive

Thanks
Patrick