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
● 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
● 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