GremlinServers 具有高可用性

There are high availability on the GremlinServers

看了Janusgraph的文档,了解到高可用只存在于存储系统或者后端。 (卡桑德拉)。 但是,GremlinServers 是否具有高可用性?

例如模式16.3。使用 Gremlin 服务器的远程服务器模式。 我明白带齿的轮子是我的应用

architecture image

如果我的 Gremlin 服务器断电,连接到 gremlin 服务器的两台服务器将无法提供服务。 gremlinserver 中没有故障转移或容错功能吗?

我使用带有两个参数的 属性 文件:

GremlinServerHost = 127.0.0.1
GremlinServerPort = 8182

用 DI

设置 spring
<bean id="gremlinCluster" class="[FQDN].pool.GremlinCluster" scope="singleton" destroy-method="destroy">
    <constructor-arg name="server"><value>${GremlinServerHost}</value></constructor-arg>
    <constructor-arg name="port"><value>${GremlinServerPort}</value></constructor-arg>
</bean>

private Cluster init() {
..
..
        Cluster cluster = Cluster.build(server).port(port)
..
;

..

和一个实现

Cluster cluster = gremlinCluster.getCluster();
        Client client = null;
        try {
            client = cluster.connect();
            String gremlin = "[Query Gremlin ...   ]"

Gremlin Server 实例彼此不了解,但是根据您在应用程序中配置 TinkerPop 驱动程序的方式,您将获得某种程度的故障转移,即如果驱动程序发现死服务器,它将记下这一点,然后只向您配置的其他可用服务器发送请求。在后台,它会不断尝试重新连接到死掉的服务器,如果它重新上线,它将把它包含在它要向其发送请求的服务器池中。

因此,在您提出的场景中,只要有可用的服务器,您的应用程序就不会知道其中的区别。当然,这意味着剩余的活动服务器将承担应用程序其他部分的负载。

请注意,如果您正在使用与您的驱动程序的会话,那么对于已关闭的服务器,会话将会丢失。 Gremlin 服务器实例之间不共享会话信息。因此,要获得任何形式的高可用性,您需要确保使用无会话通信。