Skip to main content
Solved

Indicium connect to Database on another port


Freddy
Forum|alt.badge.img+16
  • Thinkwise Local Partner Brasil
  • 529 replies

I'm setting up our new server and we are running databases as containers on different ports. 

How do I define this in the indicium app settings.. I'm connected via SMSS but I get indicum error that no connection can be made. 

Is below correct?

 "Server": "Localhost,1510",
 

 

 System.AggregateException: One or more errors occurred. (A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server))

Best answer by Leon Kroon

Hi @Freddy, when referring to Localhost, the Indicium container will try to connect with itself on port 1433. Each container you run has its own internal IP address. To connect to a database, you will need to specify the correct hostname or IP address. If these containers are run on Docker, the internal DNS of Docker could be used for this to avoid hardcoded IP addresses (in case of connecting from one container to another).

For example, a service defined with the name “container1” in a Docker Compose file can be resolved (and pinged) by all other services with containers defined in this same Docker Compose file, because Docker Compose automatically puts all defined services in the file into the same custom network.
The same can be achieved by manually putting all created containers into the same custom Docker network.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

2 replies

  • 18 replies
  • Answer
  • March 17, 2023

Hi @Freddy, when referring to Localhost, the Indicium container will try to connect with itself on port 1433. Each container you run has its own internal IP address. To connect to a database, you will need to specify the correct hostname or IP address. If these containers are run on Docker, the internal DNS of Docker could be used for this to avoid hardcoded IP addresses (in case of connecting from one container to another).

For example, a service defined with the name “container1” in a Docker Compose file can be resolved (and pinged) by all other services with containers defined in this same Docker Compose file, because Docker Compose automatically puts all defined services in the file into the same custom network.
The same can be achieved by manually putting all created containers into the same custom Docker network.


Forum|alt.badge.img+17
  • Moderator
  • 761 replies
  • April 3, 2023

@Freddy  did Leon's answer help you to implement this? 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings