2015-09-04 53 views
5

我们正在使用tdspool并尝试使用本地tsql在同一台机器上连接到它。 tdspool似乎打开它的连接就好,并开始收听,但连接到池的任何客户端超时。与tdsool的连接超时tsql

pool.conf

[global] 
     min pool conn = 5 
     max pool conn = 10 
     max member age = 120 

[sampool] 
     user = [REDACTED] 
     password = [REDACTED] 
     database = [REDACTED] 
     server = [REDACTED] 
     port = 1313 ;change to a non standard port so we can see the connection details in the debug log 

当连接到127.0.0.1:1313使用TSQL的tdspool输出只是说 “接受连接”,别无其他。所述freetds.log输出如下:

dblib.c:1237:tdsdbopen: Calling tds_connect_and_login(0x2b3fec0, 0x2b40580) 
iconv.c:328:tds_iconv_open(0x2b3fec0, UTF-8) 
iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 
iconv.c:187:local name for UTF-8 is UTF-8 
iconv.c:187:local name for UCS-2LE is UCS-2LE 
iconv.c:187:local name for UCS-2BE is UCS-2BE 
iconv.c:346:setting up conversions for client charset "UTF-8" 
iconv.c:348:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion 
iconv.c:395:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion 
iconv.c:400:tds_iconv_open: done 
net.c:202:Connecting to 127.0.0.1 port 1313 (TDS version 7.3) 
net.c:274:tds_open_socket: connect(2) returned "Operation now in progress" 
net.c:313:tds_open_socket() succeeded 
util.c:165:Changed query state from DEAD to IDLE 
packet.c:740:Sending packet 
0000 12 01 00 3a 00 00 00 00-00 00 1a 00 06 01 00 20 |...:.... ....... | 
0010 00 01 02 00 21 00 0c 03-00 2d 00 04 04 00 31 00 |....!... .-....1.| 
0020 01 ff 09 00 00 00 00 00-02 4d 53 53 51 4c 53 65 |........ .MSSQLSe| 
0030 72 76 65 72 00 96 24 00-00 00     |rver..$. ..| 

util.c:322:tdserror(0x2a6b8c0, 0x2b3fec0, 20003, 115) 
dblib.c:7897:dbperror(0x2b3f3b0, 20003, 115) 
dblib.c:7965:dbperror: Calling dblib_err_handler with msgno = 20003; msg->msgtext = "Adaptive Server connection timed out (127.0.0.1:1313)" 
dblib.c:5743:dbgetuserdata(0x2b3f3b0) 
dblib.c:7987:dbperror: dblib_err_handler for msgno = 20003; msg->msgtext = "Adaptive Server connection timed out (127.0.0.1:1313)" -- returns 2 (INT_CANCEL) 
util.c:352:tdserror: client library returned TDS_INT_CANCEL(2) 
util.c:375:tdserror: returning TDS_INT_CANCEL(2) 
query.c:3769:tds_disconnect() 
util.c:165:Changed query state from IDLE to DEAD 
login.c:472:login packet rejected 
util.c:322:tdserror(0x2a6b8c0, 0x2b3fec0, 20002, 0) 
dblib.c:7897:dbperror(0x2b3f3b0, 20002, 0) 
dblib.c:7965:dbperror: Calling dblib_err_handler with msgno = 20002; msg->msgtext = "Adaptive Server connection failed (127.0.0.1:1313)" 
dblib.c:5743:dbgetuserdata(0x2b3f3b0) 
dblib.c:7987:dbperror: dblib_err_handler for msgno = 20002; msg->msgtext = "Adaptive Server connection failed (127.0.0.1:1313)" -- returns 2 (INT_CANCEL) 
util.c:352:tdserror: client library returned TDS_INT_CANCEL(2) 
util.c:375:tdserror: returning TDS_INT_CANCEL(2) 
dblib.c:1241:tdsdbopen: tds_connect_and_login failed for "127.0.0.1:1313"! 
dblib.c:1463:dbclose(0x2b3f3b0) 
dblib.c:243:dblib_del_connection(0x7fa27f9644a0, 0x2b3fec0) 
mem.c:648:tds_free_all_results() 
dblib.c:290:dblib_release_tds_ctx(1) 
dblib.c:5845:dbfreebuf(0x2b3f3b0) 
dblib.c:743:dbloginfree(0x2b3ef10) 
dblib.c:1533:dbexit(void) 
dblib.c:1533:dbexit(void) 
dblib.c:290:dblib_release_tds_ctx(1) 

TSQL -C:

Version: freetds v0.95.19 
      freetds.conf directory: /etc 
    MS db-lib source compatibility: yes 
     Sybase binary compatibility: no 
         Thread safety: yes 
         iconv library: yes 
         TDS version: 5.0 
           iODBC: no 
          unixodbc: yes 
       SSPI "trusted" logins: no 
          Kerberos: no 
          OpenSSL: no 
          GnuTLS: no 

OS:CentOS的6.5

回答

1

的软件窃听

我们去官方的邮件列表,并逐字问这个问题。答案似乎是,没有一个没有重写当前的项目。

客户端库使用和测试良好,但池和服务器是 真的不太好。

tdspool的当前状态是....它编译!我并不感到惊讶 无法正确运行。

这就是说它是开源的。任何帮助/建议/补丁是受欢迎的。

我们花了相当多的时间试图弄清楚我们做错了什么,所以这是一种痛苦。虽然我会考虑制作/修改现有的SQL Server池,但我感到失望的是,FreeTDS(一个很棒的项目)带有这样一个不稳定的游泳池

1

我有类似的问题。将尽力帮助你解决你的问题。首先,确保你的/etc/freetds.conf包含有效的配置:

[global] 
tds version = 4.2 
... 
[myserver] 
    host = <ip> 
    port = 1433 
    tds version = 4.2 < this is important 

现在,/etc/tdspool.conf

[sampool] 
user = [REDACTED] 
password = [REDACTED] 
database = [REDACTED] 
server = myserver < important 
port = 1313 

然后tdspool sampool应该开始罚款。我的错误如下: 1.我认为pool.conf中的服务器是服务器的ip或域,而实际上这是freetds.conf中的服务器引用。 2.在freetds.conf中,我使用了错误的(太高)tds版。如他们的文档中所述,Tdspool支持最高4.2版的tds版本。

现在,如果您尝试通过tsql -S 172.0.0.1:1313进行连接,您仍然会永远得到“接受连接......”。但是,如果你这样做

tsql -S 127.0.0.1:1313 -U <username> -P <password> -D <database> 

你将连接并能够通过tdspool运行对你的sql服务器的查询。

+0

这对我不起作用。无论我做什么,我永远都会“接受联系......”。 –