Amazon EC2 PostgreSQL and Traccar Server

amjvr8 years ago

Hello!

I have both the Traccar server and a PostgreSQL database on Amazon EC2. Is it possible to connect the PostgreSQL database? I followed these steps (applying my own credentials, of course) but failed:

Example:

<entry key='database.driver'>org.postgresql.Driver</entry>
<entry key='database.url'>jdbc:postgresql://postgresql-instance1.cg034hpkmmjt.us-east-1.rds.amazonaws.com/dataBaseNameHere</entry>
<entry key='database.user'>[USER]</entry>
<entry key='database.password'>[PASSWORD]</entry>

Amazon JDBC tutorial for PostgreSQL: https://aws.amazon.com/getting-started/tutorials/create-connect-postgresql-db/

Other notes:

  1. The DB instance is working, I can connect to it
  2. The Traccar server is working because I can connect to it.
  3. The Traccar web console doesn't open up if I apply the JDBC changes above. I receive the error from Chrome: "This site can’t be reached".

Thanks!

amjvr8 years ago

Some additional info:

I am running Traccar server 3.7 (traccar-linux-64-3.7.zip) and Java 7 (openjdk-7-jre) on an Ubuntu 14.04 amd64 server. Both Traccar server and PostgreSQL 9.5.4 database are on the same Amazon VPC.

Everything ran perfectly until I tried to use PostgreSQL.

Anton Tananaev8 years ago

If something doesn't work, you should check logs.

It is definitely possible to connect PostgreSQL:

https://www.traccar.org/postgresql/

amjvr8 years ago

Anton,

Thanks for your reply. My attempts to fix this have failed.

If anybody out there has PostgresSQL working please let me know how did you edited the configuration file. I followed the steps here: https://www.traccar.org/postgresql/ but it doesn't work for me.

Thanks in advance!

amjvr8 years ago

Ok, I solved my problem. Don't know what I was doing wrong, I just re-edited the configuration file xml to connect to PostgreSQL following this: https://www.traccar.org/postgresql/. Then sudo /opt/traccar/bin/traccar stop, then sudo /opt/traccar/bin/traccar start, and it worked.

Now comes the fun part, checking how good PostgreSQL works with Traccar.

Thanks!