Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

430
Visualizações
Installing postgres on EC2 (Amazon Linux)

Trying to install postgreSQL, and looks liked I have messed something up. I first delete postgres using commands below.

[ec2-user@ip-10-183-130-45 /]$ rm -rf /var/lib/pgsql/data
[ec2-user@ip-10-183-130-45 /]$ sudo rm -rf /var/pgsql

then try initdb, which for some reason fails,

[ec2-user@ip-10-183-130-45 /]$ sudo service postgresql initdb
Initializing database:                                     [FAILED]

but when I check though, the initdb does create pgsql folder,

[ec2-user@ip-10-183-130-45 var]$ ls -l
total 80
drwxr-xr-x  2 root     root     4096 May  9  2013 account
drwxr-xr-x  9 root     root     4096 Sep 18 09:54 cache
drwxr-xr-x  3 root     root     4096 May  9  2013 db
drwxr-xr-x  3 root     root     4096 May  9  2013 empty
drwxr-xr-x  3 root     root     4096 Nov  8 06:34 ftp
drwxr-xr-x  2 root     root     4096 Jan  6  2012 games
drwxr-xr-x 20 root     root     4096 Oct 14 07:34 lib
drwxr-xr-x  2 root     root     4096 Jan  6  2012 local
drwxrwxr-x  5 root     lock     4096 Jan 21 04:36 lock
drwxr-xr-x  7 root     root     4096 Jan 21 09:31 log
lrwxrwxrwx  1 root     root       10 May  9  2013 mail -> spool/mail
drwxr-xr-x  2 root     root     4096 Jan  6  2012 nis
drwxr-xr-x  2 root     root     4096 Jan  6  2012 opt
**drwx------  3 postgres postgres 4096 Jan 21 13:26 pgsql**
drwxr-xr-x  2 root     root     4096 Jan  6  2012 preserve
drwxr-xr-x  2 root     root     4096 Mar 14  2013 racoon
drwxr-xr-x 16 root     root     4096 Jan 21 13:23 run
drwxr-xr-x  9 root     root     4096 May  9  2013 spool
drwxrwxrwt  3 root     root     4096 Jan 20 06:00 tmp
drwxrwsr-x  7 root     www      4096 Nov 17 14:38 www
drwxr-xr-x  2 root     root     4096 Jan  6  2012 yp

so I try to start the postgresql, which fails too

[ec2-user@ip-10-183-130-45 var]$ sudo service postgresql start

/var/pgsql is missing. Use "service postgresql initdb" to initialize
the cluster first.
                                                           [FAILED]

Can someone help, ID what I am doing wrong? Using postgresql-9.2-1.19.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Try:

sudo yum remove postgresql postgresql-server
sudo rm -rf /var/lib/psql
sudo yum install postgresql postgresql-server
over 4 years ago · Santiago Trujillo Relatório

0

I think there is a misunderstanding. Did you say that you deleted some postgres files, and then are wondering why it doesn't work?

I recommend:

  • Repairing the original install of postgres.
  • Removing it gracefully. With the package manager perhaps?
  • Installing your new postgres with a package manager.
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda