【发布时间】:2015-09-20 10:07:51
【问题描述】:
我有 2 个系统:系统 1 正在运行 akka 和 HAProxy,系统 2 正在运行向 akka 发出请求的 REST 组件。
Akka 在系统 1 的 4241 端口上运行。当没有 HAProxy 时,系统 2 能够连接到系统 1。在系统 1 上安装 HAProxy 后,从系统 2 到系统 1 的请求出错,日志如下:
ERROR[deal-akka.actor.default-dispatcher-18] EndpointWriter - 丢弃 非本地消息 [class akka.actor.ActorSelectionMessage] 收件人 [Akka.tcp://akkaSystemName@Server1IP:42431/]] 到达 [akka.tcp://akkaSystemName@Server1IP:42431] 入站地址是 [akka.tcp://akkaSystemName@Server1IP:4241]
HAProxy 在 42431 上运行。
HAProxy 配置如下:
listen akka_tcp :42431
mode tcp
option tcplog
balance leastconn
server test1 Server1IP:4241 check
server test2 Server1IP:4241 check
akka 的配置是这样的:
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
netty.tcp {
hostname = "Server1IP"
port = 4241
transport-protocol = tcp
# Sets the send buffer size of the Sockets,
# set to 0b for platform default
send-buffer-size = 52428800b
# Sets the receive buffer size of the Sockets,
# set to 0b for platform default
receive-buffer-size = 52428800b
maximum-frame-size = 52428800b
}
}
任何建议将不胜感激。
【问题讨论】:
标签: tcp akka haproxy akka-cluster