12
I have the following problem, every time I turn on my machine, I go to the terminal and give sudo service postgresql status
, always appears 9.3/main (port 5432): down
.
On other machines I have installed, it starts together with Ubuntu, and when I run the same command appears 9.3/main (port 5432): online
, I didn’t do anything different, but it seems that in my machine is missing some configuration.
Every time I use the database for the first time, you need to start the service.
At the time of installation, the following message was displayed, I do not know if it has anything to do with the error: No PostgreSQL clusters exist; see "man pg_createcluster"
I’m using Ubuntu 14.04 and Postgresql 9.3
Filing cabinet postgresql.conf:
# - Connection Settings -
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
When installing Postgres the following information appears:
Removing obsolete dictionary files:
* No PostgreSQL clusters exist; see "man pg_createcluster"
Processing triggers for ureadahead (0.100.0-16) ...
Configurando postgresql-9.3 (9.3.4-1) ...
Creating new cluster 9.3/main ...
config /etc/postgresql/9.3/main
data /var/lib/postgresql/9.3/main
locale pt_BR.UTF-8
port 5432
update-alternatives: a usar /usr/share/postgresql/9.3/man/man1/postmaster.1.gz para disponibilizar /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) em modo automático
* Starting PostgreSQL 9.3 database server
Thank you.
Friend, thanks for the reply, however, it did not work, when I executed the command, appeared the following message
System start/stop links for /etc/init.d/postgresql already exist.
And while rebooting the computer, continued the service as down.– Anderson Pierok
@Andersonpierok do you use any firewalls? also try to post the config file of your postgre with the IP it was assigned and port.
– Olimon F.
@Andersonpierok Do it too
sudo update-rc.d postgresql enable
.– stderr
I don’t work @Sunstreaker, where do I find this @Olimonf.? Firewall is not, because it was just formatted at the same time as another, and the other worked normally the start of the database on boot, only the one that does not want to work.
– Anderson Pierok
@Andersonpierok Try then at the terminal,
insserv postgresql
as root.– stderr
@Andersonpierok for what I saw the config file (in debian distros) is on /etc/postgresql/9.4/main/postgresql.conf but 9.4 must be replaced by its current version
– Olimon F.
@Sunstreaker
sudo: insserv: command not found
... @Olimonf. is in question the settings you requested. Thank you both for your efforts.– Anderson Pierok