rpc.conf配置

EMQX 客服发表于:2022年03月25日 10:54:42更新于:2022年03月25日 10:55:43

rpc.mode

## Value: sync | async
rpc.mode = async

说明:rpc模式,可选同步或异步模式。

rpc.async_batch_size

## Value: Integer
## Zero or negative value disables rpc batching.
##
## NOTE: RPC batch won't work when rpc.mode = sync
rpc.async_batch_size = 256

说明:异步模式下最大的批量发送消息数。注意此配置在同步模式下不起作用。

rpc.port_discovery

## Value: Enum
## - manual: discover ports by `tcp_server_port` and `tcp_client_port`.
## - stateless: discover ports in a stateless manner.
##   If node name is `emqx<N>@127.0.0.1`, where the `<N>` is an integer,
##   then the listening port will be `5370 + <N>`
##
## Defaults to `stateless`.
rpc.port_discovery = stateless

说明:rpc端口发现方式

  • manual:手动通过tcp_server_porttcp_client_port发现端口

  • stateless:以无状态的方式发现端口

如果节点名为emqx<N>@127.0.0.1,其中<N>是一个整数,则侦听端口为5370 + <N>

rpc.tcp_server_port

## Value: Port [1024-65535]
#rpc.tcp_server_port = 5369

说明:设置 RPC 本地服务使用的监听 port。 注意,该配置仅在 rpc.port_discovery 设置成 manual 时有效

注:集群中的所有节点都应该统一相同的配置。

rpc.tcp_client_num

## Value: Interger [0-256]
## Default = 1
#rpc.tcp_client_num = 0

说明:设置由本节点发起,通往每个远程节点的 RPC 通信通道数量。设置为 1 可保证消息顺序。保持默认值(CPU 核心数的一半)可提高 RPC 的吞吐能力。

rpc.connect_timeout

## Value: Seconds
rpc.connect_timeout = 5s

说明:建立 RPC 连接超时时间。建立连接时若远程节点无响应,多久之后放弃尝试。

rpc.send_timeout

## Value: Seconds
rpc.send_timeout = 5s

说明:发送超时时间。发送消息多久之后放弃。

rpc.authentication_timeout

## Value: Seconds
rpc.authentication_timeout = 5s

说明:RPC 认证超时时间。尝试认证若远程节点无响应,多久之后放弃。

rpc.call_receive_timeout

## Value: Seconds
rpc.call_receive_timeout = 15s

说明:RPC 同步模式的超时时间。RPC 同步调用若收不到回复,用多久之后放弃。

rpc.socket_keepalive_idle

## Value: Seconds
rpc.socket_keepalive_idle = 900s

说明:在最近一次数据包发送多久之后,发送 keepalive 探测报文。

rpc.socket_keepalive_interval

## Value: Seconds
rpc.socket_keepalive_interval = 75s

说明:发送 keepalive 探测报文的间隔。

rpc.socket_keepalive_count

## Value: Integer
rpc.socket_keepalive_count = 9

说明:连续多少次 keepalive 探测报文都收不到回复的情况下,认为 RPC 连接已丢失。

rpc.socket_sndbuf

## Value: Bytes
rpc.socket_sndbuf = 1MB

说明:TCP 调优参数。TCP 发送缓冲区大小。

rpc.socket_recbuf

## Value: Seconds
rpc.socket_recbuf = 1MB

说明:TCP 调优参数。TCP 接收缓冲区大小。

rpc.socket_buffer

## Value: Seconds
rpc.socket_buffer = 1MB

说明:TCP 调优参数。用户态的 Socket 缓冲区大小。


    您需要登录后才可以回复