postgresql.service [RESOLVIDO]

1. postgresql.service [RESOLVIDO]

Sergio Penteado
srpenteado

(usa Ubuntu)

Enviado em 26/06/2019 - 15:57h

Boa tarde, instalei o postgresql 10 no Ubuntu Server 18.04 LTS e estou com dificuldade para conectar uma aplicacao local.

Quando digito o comando: service postgresql status

exibe: Active: active (exited). Isso é normal"pergunto sobre o exited"




  


2. Re: postgresql.service [RESOLVIDO]

Luiz Santos
luiztux

(usa Gentoo)

Enviado em 26/06/2019 - 21:34h

srpenteado escreveu:

Boa tarde, instalei o postgresql 10 no Ubuntu Server 18.04 LTS e estou com dificuldade para conectar uma aplicacao local.

Quando digito o comando: service postgresql status

exibe: Active: active (exited). Isso é normal"pergunto sobre o exited"



Sim. A saída abaixo é do server (Debian) que gerencio:


postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2019-06-26 21:18:16 -03; 2min 22s ago
Process: 554 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 554 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/postgresql.service

#Saída do service --status-all
[ + ] postgresql



Esta saída é parecida com a do comando systemctl status postgresql.service.
-----------------------------------''----------------------------------

Larry, The Cow, uses Gentoo GNU/Linux

^__^
(oo)
(__)

"If it moves, compile it."




3. Re: postgresql.service [RESOLVIDO]

Giovani
giovanit

(usa Ubuntu)

Enviado em 27/06/2019 - 09:26h

A aplicação que vc quer conectar ao banco fica hospedada no próprio servidor do banco ou na rede?


4. Re: postgresql.service [RESOLVIDO]

Sergio Penteado
srpenteado

(usa Ubuntu)

Enviado em 27/06/2019 - 09:48h

giovanit escreveu:

A aplicação que vc quer conectar ao banco fica hospedada no próprio servidor do banco ou na rede?


Fica no próprio server.

Criei a role, dei direito superuser e createdb, defini uma senha, criei DB com mesmo nome da role (que tambem é o mesmo nome do superuser do ubuntu server).

Segue script da aplicacao:

Esse 1o é padrao da aplicacao e opera com DB H2 (funciona perfeitamente)

<entry key='database.driver'>org.h2.Driver</entry> <entry key='database.url'>jdbc:h2:/home/user/Documents/traccar/target/database</entry> <entry key='database.user'>sa</entry> <entry key='database.password'></entry>

Esse 2o é q aponta pro postgres (onde a aplicacao nao sobe [falha no sevice]

Configuration parameters for PostgreSQL (replace [DATABASE], [USER], [PASSWORD] with appropriate values):

<entry key='database.driver'>org.postgresql.Driver</entry> <entry key='database.url'>jdbc:postgresql://127.0.0.1:5432/[DATABASE]</entry> <entry key='database.user'>[USER]</entry> <entry key='database.password'>[PASSWORD]</entry>
(Claro q adequei os campos destacados pela documentacao USER DATABASE PASS)

LOG da aplicacao:

S2019-06-27 09:26:21 INFO: HikariPool-1 - Starting... 2019-06-27 09:26:21 INFO: HikariPool-1 - Starting... 2019-06-27 09:26:23 ERROR: HikariPool-1 - Exception during pool initialization. - Received fatal alert: handshake_failure - SSLHandshakeException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...) 2019-06-27 09:26:23 ERROR: Main method error - Received fatal alert: 2019-06-27 09:26:21 INFO: HikariPool-1 - Starting... 2019-06-27 09:26:23 ERROR: HikariPool-1 - Exception during pool initialization. - Received fatal alert: handshake_failure - SSLHandshakeException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...) 2019-06-27 09:26:23 ERROR: Main method error - Received fatal alert: handshake_failure - SSLHandshakeException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)



STATUS POSTGRES

service postgresql status
&#9679; postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.servi Active: active (exited) since Thu 2019-06-27 09:24:5 Main PID: 528 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 3538)
CGroup: /system.slice/postgresql.service

jun 27 09:24:54 ubuntu systemd[1]: Starting PostgreSQL jun 27 09:24:54 ubuntu systemd[1]: Started PostgreSQL Rlines 1-9/9 (END)

SERVICO DA APLICACAO TRACCAR


&#9679; traccar.service - traccar
Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-06-27 09:26:23 -03; 19min ago
Process: 760 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code= Main PID: 760 (code=exited, status=1/FAILURE)

jun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.Alert$AlertConsumer.conjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.TransportContext.dispatjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLTransport.decode(SSLjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLSocketImpl.decode(SSjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLSocketImpl.readHandsjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLSocketImpl.startHandjun 27 09:26:23 ubuntu traccar[760]: at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:40jun 27 09:26:23 ubuntu traccar[760]: ... 19 more
jun 27 09:26:23 ubuntu systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAIjun 27 09:26:23 ubuntu systemd[1]: traccar.service: Failed with result 'exit-code'.
~

Ubuntu 18.04 LTS
Postgres 10




5. Re: postgresql.service [RESOLVIDO]

Giovani
giovanit

(usa Ubuntu)

Enviado em 27/06/2019 - 16:29h

srpenteado escreveu:

giovanit escreveu:

A aplicação que vc quer conectar ao banco fica hospedada no próprio servidor do banco ou na rede?


Fica no próprio server.

Criei a role, dei direito superuser e createdb, defini uma senha, criei DB com mesmo nome da role (que tambem é o mesmo nome do superuser do ubuntu server).

Segue script da aplicacao:

Esse 1o é padrao da aplicacao e opera com DB H2 (funciona perfeitamente)

<entry key='database.driver'>org.h2.Driver</entry> <entry key='database.url'>jdbc:h2:/home/user/Documents/traccar/target/database</entry> <entry key='database.user'>sa</entry> <entry key='database.password'></entry>

Esse 2o é q aponta pro postgres (onde a aplicacao nao sobe [falha no sevice]

Configuration parameters for PostgreSQL (replace [DATABASE], [USER], [PASSWORD] with appropriate values):

<entry key='database.driver'>org.postgresql.Driver</entry> <entry key='database.url'>jdbc:postgresql://127.0.0.1:5432/[DATABASE]</entry> <entry key='database.user'>[USER]</entry> <entry key='database.password'>[PASSWORD]</entry>
(Claro q adequei os campos destacados pela documentacao USER DATABASE PASS)

LOG da aplicacao:

S2019-06-27 09:26:21 INFO: HikariPool-1 - Starting... 2019-06-27 09:26:21 INFO: HikariPool-1 - Starting... 2019-06-27 09:26:23 ERROR: HikariPool-1 - Exception during pool initialization. - Received fatal alert: handshake_failure - SSLHandshakeException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...) 2019-06-27 09:26:23 ERROR: Main method error - Received fatal alert: 2019-06-27 09:26:21 INFO: HikariPool-1 - Starting... 2019-06-27 09:26:23 ERROR: HikariPool-1 - Exception during pool initialization. - Received fatal alert: handshake_failure - SSLHandshakeException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...) 2019-06-27 09:26:23 ERROR: Main method error - Received fatal alert: handshake_failure - SSLHandshakeException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)



STATUS POSTGRES

service postgresql status
&#9679; postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.servi Active: active (exited) since Thu 2019-06-27 09:24:5 Main PID: 528 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 3538)
CGroup: /system.slice/postgresql.service

jun 27 09:24:54 ubuntu systemd[1]: Starting PostgreSQL jun 27 09:24:54 ubuntu systemd[1]: Started PostgreSQL Rlines 1-9/9 (END)

SERVICO DA APLICACAO TRACCAR


&#9679; traccar.service - traccar
Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-06-27 09:26:23 -03; 19min ago
Process: 760 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code= Main PID: 760 (code=exited, status=1/FAILURE)

jun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.Alert$AlertConsumer.conjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.TransportContext.dispatjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLTransport.decode(SSLjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLSocketImpl.decode(SSjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLSocketImpl.readHandsjun 27 09:26:23 ubuntu traccar[760]: at java.base/sun.security.ssl.SSLSocketImpl.startHandjun 27 09:26:23 ubuntu traccar[760]: at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:40jun 27 09:26:23 ubuntu traccar[760]: ... 19 more
jun 27 09:26:23 ubuntu systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAIjun 27 09:26:23 ubuntu systemd[1]: traccar.service: Failed with result 'exit-code'.
~

Ubuntu 18.04 LTS
Postgres 10



Pelo que vi no log, a aplicação está tentando conectar ao banco usando ssl. No postgres vc precisa configurar o ssl para receber esse tipo de conexão.


6. Re: postgresql.service [RESOLVIDO]

Sergio Penteado
srpenteado

(usa Ubuntu)

Enviado em 29/06/2019 - 14:57h

Chequei as permissões ssl e estavam ok.

Era um problema de compatibilidade da aplicação que foi reaolvido fazendo um ajuste na aplicacao.service.

Obrigado a todos.






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner
Linux banner
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts