在向列中插入较大值时遇到问题,值byte[]
长度是25130744(从DataSet
转换为byte[]
),并给我一个例外:IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
有人知道原因吗?小列值工作正常。在Aquiles或Cassandra服务器中是否有一些数据大小限制或请求超时限制?
Cassandra version: 1.0.2, Aquiles version: 1.0, .NET Framework 4.0
以下是详细信息:
Server Error in '/test' Application.
An existing connection was forcibly closed by the remote host
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
Source Error:
Line 482: public void recv_insert()
Line 483: {
Line 484: TMessage msg = iprot_.ReadMessageBegin();
Line 485: if (msg.Type == TMessageType.Exception) {
Line 486: TApplicationException x = TApplicationException.Read(iprot_);
Source File: D:\codeplex\Aquiles\trunk\Aquiles.Cassandra10\Apache\Cassandra\Cassandra.cs Line: 484
Stack Trace:
[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +245
[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +7768653
Thrift.Transport.TStreamTransport.Read(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TStreamTransport.cs:84
Thrift.Transport.TTransport.ReadAll(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TTransport.cs:54
Thrift.Transport.TFramedTransport.ReadFrame() in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TFramedTransport.cs:90
Thrift.Transport.TFramedTransport.Read(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TFramedTransport.cs:83
Thrift.Transport.TTransport.ReadAll(Byte[] buf, Int32 off, Int32 len) in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Transport\TTransport.cs:54
Thrift.Protocol.TBinaryProtocol.ReadI32() in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Protocol\TBinaryProtocol.cs:338
Thrift.Protocol.TBinaryProtocol.ReadMessageBegin() in d:\thrift-0.6.0\thrift-0.6.0\lib\csharp\src\Protocol\TBinaryProtocol.cs:220
Apache.Cassandra.Client.recv_insert() in D:\codeplex\Aquiles\trunk\Aquiles.Cassandra10\Apache\Cassandra\Cassandra.cs:484
DataAccessLib.CassandraAccess.<>c__DisplayClass28.<InsertCommand>b__27(Client client) in C:\TestProject\Class1.cs:746
[ExecutionBlockException: Exception 'Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.' during executing command. See inner exception for further details.]
Aquiles.Core.Cluster.Impl.DefaultCluster.Execute(Delegate executionBlock, String keyspaceName, ConnectionConfig overrideConnectionConfig) in D:\codeplex\Aquiles\trunk\Aquiles.Core\Cluster\Impl\DefaultCluster.cs:191
答案 0 :(得分:2)
cassandra.yaml中有一个设置可以控制最大的thrift消息大小。它默认为16兆字节。
thrift_max_message_length_in_mb: 16
您可以更新该设置以发送更大的邮件。请记住,该设置适用于整个消息,包括一些开销,因此您需要将其设置为高于您要发送的列的实际大小。
理论上你可以将此设置增加到千兆字节范围,但几乎肯定不是一个好主意。整个thrift消息需要适合内存,并且可能还必须更改默认的rpc超时设置。
我会考虑将您的列分块为较小的子列而不是增加该设置。