2016-11-13 10 views
1

SQL Server의 장애 조치로 서버를 추가하려고하는데 포트 1443을 사용하지 않고 포트 2776을 사용하고 있습니다. 나는 그것을 지정하려고 노력하고 있지만, 내가 시도한 모든 것은 작동하지 않았다. 내가 어떻게 할 수 있니?SQL Server에서 failoverPartner 서버의 JDBC 연결 URL을 지정하는 방법

private String url = "jdbc:sqlserver://server1:2776;DatabaseName=db;failoverPartner=server2"; 

다음 설정을 시도했지만 그 중 아무 것도 작동하지 않았습니다. ...failoverPartner=server2,2776

  • ...failoverPartner=server2:2776
    1. ...failoverPartner=server2\\db

    하지만 매번 나는 예외를 얻을. 문서 Connecting to SQL Server with the JDBC Driver - Setting the Connection Properties 문서에서

    1. com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host server2, port 1433 has failed. Error: "connect timed out. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".

    2. com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host server2:2776, port 1433 has failed. Error: "null. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".

    3. com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host server2, 2776, port 1433 has failed. Error: "null. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".

  • +0

    태그를 추가했습니다. 'failover' 및'database-mirroring' 태그를 추가했습니다. 올바른 작업은 ... 올바른 것입니까? –

    +0

    [이 답변] (http://stackoverflow.com/a/12378514/243373)이 도움이됩니까? 동일한 질문은 아니지만 'failoverPartner'이름에서 누락 된 인스턴스 이름과 관련이있을 수 있습니다. –

    +0

    또한 [데이터베이스 미러링 (JDBC) 사용] 링크 (https://msdn.microsoft.com/en-us/library/aa342332 (v = sql.110) .aspx)를 읽었습니까? 어쩌면 거기에 몇 가지 포인터가 있을까요? –

    답변

    1

    , 재산 failoverPartner :

    Note: The driver does not support specifying the server instance port number for the failover partner instance as part of the failoverPartner property in the connection string. However, specifying the serverName, instanceName and portNumber properties of the principal server instance and failoverPartner property of the failover partner instance in the same connection string is supported.

    매우 혼동하게 표현하지만, 장애 조치 서버의 포트 번호를 지정할 수 없습니다 것 같습니다.

    ( Applications cannot connect to a mirror partner server when using port number in the failoverPartner attribute of the connection string) Microsoft에서 KB-2284190에서

    나는 거의 동일하게 읽고 있어요 : 결론적으로

    CAUSE

    Both the error messages occur due to the fact that SQL Server JDBC drivers (all versions) do not support parsing of port number for FailoverPartner connection string attribute and rely on DNS and SQL Server Browser service (for named instances only) to resolve the connection information for the partner server. In environments wherein the conditions discussed in the Symptoms sections are met, the JDBC driver is not able to resolve the partner server information and hence you get the error message discussed above.

    This behavior of SQL mirroring infrastructure is by design. For this reason, Microsoft JDBC Driver version 3.0 supports failover partner attribute value only in the format <server_name>[\<SQL_Server_instance_name>].

    RESOLUTION

    To work around this problem, use one of the following methods in environments where database mirroring is involved:

    • For default instances of SQL server that are part of mirroring configuration ensure that they are listening on the default port 1433 for TCP connections.

    • For named instances, ensure that SQL browser service is running and port 1434 is not blocked on the network and server B is not configured as a hidden instance.


    , 다음 중 하나를 수행합니다

    • 을 TCP에 대해 포트 1433에서 수신 대기 할 장애 조치 서버를 지정하십시오.
    • 명명 된 인스턴스를 만들고 failoverPartnerserver_name\instance_name으로 지정하십시오. SQL Server Browser 서비스가 실행 중이고 포트 1434가 차단되어 있지 않은지 확인하십시오.
    +0

    도움 주셔서 감사합니다. 앞에서 말했듯이, 장애 조치 포트를 변경하는 방법은 없지만 작동 한 instanceName을 추가합니다. 해결책으로 추가 할 수 있도록 답변에 추가해 주시겠습니까? – davis

    +0

    @davis Done .... –