Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Connecting confluence to Postgres database error Edited

Have hosted Confluence on Docker container and Postgres on another container. Both the containers are up and running. When I try to test the connection it says '

Can't reach database server or port

SQLState - 08001
org.postgresql.util.PSQLException: The connection attempt failed.'

The IP address is correctly entered


I have exposed port 5432

Anything that I have missed?

3 answers

Hi @Ranga vittal ,

Are you running Confluence and Postgres from the same Docker, meaning that they are on the same box session? If so, Confluence should be able to connect to PostgreSQL when providing its container's name.

As a suggestion, you could create a Network in docker so you do not face issues of getting a different IP every time your containers are started. Without a static IP, when starting a container, you may get a different IP address depending on the order of events.

# create a Docker network
docker network create \
--driver bridge \
--subnet=10.10.0.0/16 \
myNetwork

For PostgreSQL and Confluence you could do the following:

# create a PostgreSQL docker container
docker run -d \
--restart=unless-stopped \
--network myNetwork \
--ip 10.10.1.2 \
--name postgres96 \
--hostname postgres \
-p 5432:5432 \
-e POSTGRES_PASSWORD=mysecretpassword \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v /path/postgres/9.6:/var/lib/postgresql/data/pgdata \
-d postgres:9.6
# create a Confluence docker container
docker run -d --init \
--network myNetwork \
--ip 10.10.2.2 \
--name confluence667 \
--hostname confluence \
-p 8090:8090 \
-v /path/confluence/6.6.7:/var/atlassian/application-data/confluence \
atlassian/confluence-server:6.6.7

 Then connect Confluence by providing the PostgreSQL name parameter (e.g postgres96)

<property name="hibernate.connection.url">
jdbc:postgresql://postgres96:5432/confluence667
</property>

Hope the above helps.

Kind regards,
Rafael

Any luck? 

Can't reach database server or port

SQLState - 08001
org.postgresql.util.PSQLException: The connection attempt failed.

So strange failed again here with PostgreSQL too while failed all time MSSQL 

SQLState - 08001
org.postgresql.util.PSQLException: The connection attempt failed.

 

i have the same issue~

there is no problem for my jira, bitbucket jira service desk to connect the postgres. 

i'm using the postgres paas service on Azure cloud.  

Any resolution?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

156 views 0 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you