Skip to content

Instantly share code, notes, and snippets.

@lnoering
Last active January 4, 2016 16:27
Show Gist options
  • Select an option

  • Save lnoering/b85c032de0d381ad9c30 to your computer and use it in GitHub Desktop.

Select an option

Save lnoering/b85c032de0d381ad9c30 to your computer and use it in GitHub Desktop.
[Postgre] - Solutions

Problema ao iniciar o servidor do postgre

  • Comando utilizado para tentar inicializar.
su -c '/usr/pgsql-9.3/bin/pg_ctl start -D /var/lib/pgsql/9.3/data' postgres
  • Resultado

    < 2016-01-04 12:02:49.775 BRST >LOG: could not bind IPv4 socket: Cannot assign requested address
    < 2016-01-04 12:02:49.775 BRST >HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
    < 2016-01-04 12:02:49.775 BRST >WARNING: could not create listen socket for "localhost"
    < 2016-01-04 12:02:49.775 BRST >FATAL: could not create any TCP/IP sockets

  • Causa

    Na definição de hosts do servidor o localhosts está como { 126.0.0.1 }. Para ficar { 127.0.0.1 } eu criei um outro hosts e passei a utilizá-lo.

  • Solução

vim /var/lib/pgsql/9.3/data/postgresql.conf
- Procurar por ( listen_addresses )
- Trocar por ( listen_addresses = 'urldosite.com' )
- Criar um hosts ( 127.0.0.1       urldosite.com )
- Editar a aplicação para utilizar a ( urldosite.com )
  • Iniciar novamente passando o diretório de LOG.
su -c '/usr/pgsql-9.3/bin/pg_ctl start -l /var/log/pgsql -D /var/lib/pgsql/9.3/data' postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment