8.11. 钉枪服务器

GeoMesa可以使用持久服务器来消除为每个命令引导JVM的开销,这可以使命令的启动速度更快。必须通过设置环境变量来启用服务器 GEOMESA_NG_ENABLED=true

警告

钉枪服务器不提供安全性,只能在受信任的环境中使用。默认情况下,它将绑定到所有主机地址,从而允许来自同一网络上的任何客户端的未经身份验证的连接。

启用时,钉枪服务器将根据需要自动启动,并在一段时间(默认情况下为一小时)不活动后终止。在运行时,服务器不会获取任何类路径或环境更改。这个 ng 命令子集可用于启动、停止和查询服务器状态。

以下环境变量控制服务器的行为,可以在中进行配置 conf/geomesa-env.sh

GEOMESA_NG_ENABLED # enable the Nailgun server
GEOMESA_NG_SERVER # the host to use to connect to the server, or to bind the server on startup
GEOMESA_NG_PORT # the port to use to connect to the server, or to bind the server on startup
GEOMESA_NG_TIMEOUT # client heartbeat timeout
GEOMESA_NG_IDLE # amount of time before the server will terminate due to inactivity
GEOMESA_NG_POOL_SIZE # number of threads in the server available for running commands

请注意,可以在与客户端不同的主机上运行钉枪服务器。