After SQL Server is installed on the server, due to server security requirements, it is necessary to block all unused ports and open only the ports that must be used. Let’s introduce the ports used in SQL Server 2008:
First of all, the most commonly used port is 1433. This is the port of the database engine. If we want to connect to the database engine remotely, we need to open this port. This port can be modified. Switch to "XXX Protocol" in "SQL Server Configuration Manager" and select it. The TCP port can be set in the TCP/IP protocol properties. As shown in the picture:
SSIS calls the DCOM protocol, so port 135 needs to be opened when using SSIS, and this port cannot be changed. The Service Control Manager (SCM) can only be accessed by opening TCP port 135. SCM performs the following tasks: starts and stops the Integration Services service, and transmits control requests to running services.
Next let’s talk about SSAS. The default instance of SSAS uses port 2383. If it is a named instance, then each instance will have a port specified by the administrator. This port can also be dynamically allocated. Due to the needs of network security, it is strongly recommended. Do not use dynamic port allocation schemes. If it is a dynamically allocated port, when the client connects to the server, it will connect to the server's 2382 port, which is the port used by SQL Server Browser. SQL Server Browser then tells the client through port 2382 the actual port number of the named instance that needs to be connected. (This is the official statement, but I am not sure that port 2382 is required here, but the UDP1434 port mentioned next is definitely useful.) In addition, SQL Server Browser needs to use UDP port 1434, so if you need to use this service If so, UDP1434 must be turned on. To modify the SSAS port, you need to open the SSAS service first, and then use SSMS to connect to SSAS. Right-click the instance in the Object Explorer and select Properties. The Analysis Service Properties window will pop up. Set the Port property to the required port. The default value is 0. , which means there is no setting, and then restart the SSAS service.
After restarting, if SSMS gets other clients to connect to SSAS, it needs to use the "hostname:port" method as the connection host. If it is a database engine, then it uses the "hostname, port" format. These two There is a difference.
The report service provides services through the Web, so by default the report service uses port 80. Of course, the user can also modify the port of the report service and modify the ports of the Web service and report manager in the report service configuration manager. As shown in the picture:
SSB port configuration. If SSB involves communication between computers through the network, then you need to set the endpoint (EndPoint). When setting the SSB endpoint, you need to specify the listening port. For example, we create such an endpoint:
USE master;
GO
CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP (LISTENER_PORT = 4037)
FOR SERVICE_BROKER (AUTHENTICATION = WINDOWS);
GO then we need to develop port 4037.
In the same way, if we want to configure database mirroring, SOAP access, etc., we also need to create an endpoint and open the port in the endpoint.
In addition to the ports introduced above, if you want to do database replication and so on, and you need to set up a shared folder on the database server to facilitate data transmission between multiple servers, you will also need to open Windows shared ports, such as 137, 138, 139, 445, etc.
The above introduces so many services and ports, which need to be set according to actual needs. For security reasons, you can set the default port as your own port, and do not open the SQL Server Browser service.