microsoft / mssql-docker

Official Microsoft repository for SQL Server in Docker resources
MIT License
1.72k stars 758 forks source link

How to put instance name #515

Open buster95 opened 4 years ago

buster95 commented 4 years ago

I want to put instance name for my sql server for example 192.168.1.10\rh 192.168.1.10\finance 192.168.1.10\users

banerjeeamit commented 4 years ago

There is no concept of a named instance. Every container can have a unique name. See Getting started with SQL Sever on Linux container images

buster95 commented 4 years ago

I know each container have your own name, but I refer to this word-image-25 green is container name, red is instance name

Sql Server Installation Assistant 0336 120611_0136_Pasoapasopa22

banerjeeamit commented 4 years ago

Containers don't have a concept of running multiple SQL Server instances. So there is no option of running more than one instance name. Could you please share the scenario that you are trying to achieve in a container?

buster95 commented 4 years ago

yes that's true, containers can only run one sql server instance, but in my work the database production server has 3 personalized instances, for example 192.168.1.10\rrhh 192.168.1.10\finanzas 192.168.1.10\admin

we have sql server enterprise licensed all systems in my work make references to respective instance, we want hold on same configuration for all systems,

I want to configure 3 containers each one with a personalized instance and 1 container with the default instance name

buster95 commented 4 years ago

actually we are migrating from a conventional services configuration to kubernetes

blakhani-msft commented 4 years ago

You can configure each instance inside container listening on different port. You can workaround this by creating client aliases or directly using port number in the application.

buster95 commented 4 years ago

You can configure each instance inside container listening on different port. You can workaround this by creating client aliases or directly using port number in the application.

Hi,we want hold on aliases because all systems having the aliases in connections strings and we won't modify all systems, How can I make client alias in the container??

blakhani-msft commented 4 years ago

Hi,we want hold on aliases because all systems having the aliases in connections strings and we won't modify all systems, How can I make client alias in the container??

Well, client alias needs to be created on clients not inside containers. There is no need to change connection string. Lets say you create 3 containers on 192.168.1.10 listening on port 2433, 3433 and 4433. On client, you would create alias where "192.168.1.10\rrhh" would map to 192.168.1.10. port 2433 and so on.

ghost commented 3 years ago

Is it possible toncreate client aliases in Linux machines? Most of the solutions I have seen is using SQL Server's GUI client, but this won't available in Linux. A lot of apps are deployed on Docker/Linux these days, so a solution world help. I think this is solution is better than changing the connection strings.

Sorry for posting in this old thread. This is the one of the top results that came up when I searched for client aliases in Linux.

dudeNumber4 commented 3 years ago

Well, client alias needs to be created on clients not inside containers. There is no need to change connection string. Lets say you create 3 containers on 192.168.1.10 listening on port 2433, 3433 and 4433. On client, you would create alias where "192.168.1.10\rrhh" would map to 192.168.1.10. port 2433 and so on.

"On client, you would create alias" How? What kind of alias?

arminmoshayedi commented 10 months ago

Hello everyone,

I'm having the same issue. Since I have a local installation of Sql server on my host, I was wondering if I could have a container running on the default port(1433) and a different instance name. Based on previous conversations, I assume that this is not possible and the only way is to give the container a different port number. Am I right?