Skip to content

Projects JGroups Mongo provides an implementation of mongo.MONGO_PING discovery protocol using MongoDB as a cluster information store.

License

Notifications You must be signed in to change notification settings

jgroups-extras/jgroups-mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JGroups Mongo – mongo.MONGO_PING

Warning
This is an incubating project.

Projects JGroups Mongo provides an implementation of mongo.MONGO_PING discovery protocol using MongoDB as a cluster information store. It uses the official MongoDB driver for Java.

Maven Coordinates

<dependency>
    <groupId>org.jgroups.mongo</groupId>
    <artifactId>jgroups-mongo</artifactId>
    <version>1.0.0.Final</version>
</dependency>

Protocol Configuration

This library implements a JGroups discovery protocol which replaces protocols such as MPING or TCPPING.

<mongo.MONGO_PING connection_url="mongodb://localhost:27017/test"
                  remove_all_data_on_view_change="true"
                  return_entire_cache="false"
/>

Configuration Properties

This protocol extends JDBC_PING2 and inherits its configuration properties (e.g., connection_url, remove_all_data_on_view_change, register_shutdown_hook).

The following properties are specific to MONGO_PING:

Attribute Default Description

collection_name

jgroups-ping

Name of the MongoDB collection used to store cluster member information

Example Stack

<!--
Based on default tcp.xml with discovery replaced with mongo.MONGO_PING.
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="urn:org:jgroups"
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups-5.5.xsd">
    <include file="${transport-config:tcp-default.xml}"/>
    <mongo.MONGO_PING connection_url="mongodb://localhost:27017/test"
                      remove_all_data_on_view_change="true"
                      return_entire_cache="false"
    />
    <MERGE3 min_interval="10s"
            max_interval="30s"/>
    <FD_SOCK2/>
    <FD_ALL3 timeout="40s"
             interval="5s"/>
    <VERIFY_SUSPECT2 timeout="1.5s"/>
    <BARRIER/>
    <pbcast.NAKACK2 use_mcast_xmit="false"/>
    <UNICAST3/>
    <pbcast.STABLE desired_avg_gossip="50s"
                   max_bytes="4M"/>
    <pbcast.GMS print_local_addr="true"
                join_timeout="2s"/>
    <MFC max_credits="10M"
         min_threshold="0.4"/>
    <UFC max_credits="10M"
         min_threshold="0.4"/>
    <FRAG2 frag_size="60K"/>
    <pbcast.STATE_TRANSFER/>
</config>

Testing

Running the automated tests requires a functioning podman or Docker environment.

./mvnw verify

Reporting Issues

Project JGroups Mongo uses GitHub Issues for tracking:

Support Matrix

Version/Branch JGroups Version MongoDB Version Base JDK Version

1.x

5.5.x

5.6

17

About

Projects JGroups Mongo provides an implementation of mongo.MONGO_PING discovery protocol using MongoDB as a cluster information store.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages