【问题标题】:Ignite thin client auto reconnect doesn't work点燃瘦客户端自动重新连接不起作用
【发布时间】:2019-01-08 17:10:58
【问题描述】:

单机配置: 我有一个服务器节点

<ignite xmlns="http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection" gridName="myGrid1">
<clientConnectorConfiguration port="10800"/>    
<discoverySpi type="TcpDiscoverySpi" localPort='48500' localPortRange='1'>
  <ipFinder type="TcpDiscoveryStaticIpFinder">
    <endpoints>
      <string>127.0.0.1:48500</string>
    </endpoints>
  </ipFinder>
</discoverySpi>
<communicationSpi type='TcpCommunicationSpi' localPort='48100' />

和瘦客户端节点:

Ignition.StartClient(new IgniteClientConfiguration { Host = "127.0.0.1", Port = 10800})

所以我正在尝试进行下一个测试: 1) 关闭服务器节点 2)再次启动服务器节点 3) 检查客户端节点到服务器节点的连接

问题是在我调用方法的 2 步之后

ignite.GetCache<long,Entity>("cacheName").TryGet(id, out item)

我遇到了异常

System.IO.IOException:无法将数据写入传输连接:现有连接被远程主机强行关闭。 ---> System.Net.Sockets.SocketException: 远程主机在 System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) 处强行关闭了现有连接 --- 内部异常堆栈跟踪结束 --- 在 System.Net.Sockets.NetworkStream.Write(Byte[] 缓冲区,Int32 偏移量,Int32 大小 在 Apache.Ignite.Core.Impl.Client.ClientSocket.SendRequest(RequestMessage& reqMsg) 在 Apache.Ignite.Core.Impl.Client.ClientSocket.DoOutInOp[T](ClientOp opId, Action1 writeAction, Func2 readFunc, Func3 errorFunc) at Apache.Ignite.Core.Impl.Client.Cache.CacheClient 2.DoOutInOp[T](ClientOp opId, Action1 writeAction, Func2 readFunc 在 Apache.Ignite.Core.Impl.Client.Cache.CacheClient`2.TryGet(TK key, TV& value)

【问题讨论】:

    标签: c# ignite


    【解决方案1】:

    恐怕.Net瘦客户端不支持自动重新连接。

    从源代码来看,Client 是立即创建的,它会立即进行 Handshake 一次。看不到重新连接代码。在 Apache Ignite JIRA 中有一个关于故障转移功能的 issue filed:不仅仅是重新连接,而是尝试不同的节点地址。

    这意味着您必须手动检查断开连接并重新连接。

    【讨论】:

      猜你喜欢
      • 2023-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-13
      相关资源
      最近更新 更多