Matt Davis edited this page Apr 28, 2014 · 3 revisions

Setup MongoDB

Before a LuMongo cluster can be setup, a working MongoDB setup is needed. MongoDB can be sharded and replicated as needed in your environment. For more information on MongoDB please refer to the MongoDB documentation. MongoDB 2.6 is recommended but MongoDB 2.4 is supported.

Download LuMongo cluster

LuMongo cluster can be downloaded via the Releases page. After downloading, extract the contents into a directory, on each server that will make up the cluster.

Create a cluster

LuMongo cluster information is stored in a MongoDB database. Each mongo database can contains information about a single LuMongo cluster. To create a cluster first edit in the LuMongo directory on each cluster node. A sample file is shown below:

#Mongo config
#mongo database name

#mongo hostname
#mongo port number

To create a cluster a file is also needed. Edit the file on the node you wish to create the cluster from. A sample is show below:

#Cluster Configuration

#set to true to enable sharding for mongo database and collection

#index block size for new index files (not recommended to change)

#maximum number of blocks in memory allowed
#indexBlockSize*maxIndexBlock is approximately the max size used for index block cache
#There is also a index writer buffer for each segment so leave room for that
#Decreasing flushInterval for an index or commitInterval will help minimize
#this memory use per index segment at the cost of performance
#In the case of out of memory exceptions increase the JVM size, add more nodes,
#or decrease this size (at the cost of performance)
#Recommended Sizes:
#  with 128k blocks use 8000 for 2GB JVM Size
#  with 128k blocks use 20000 for 4GB JVM Size
#  with 128k blocks use 40000 for 8GB JVM Size

#max connections from node to node

#max workers for node to node connections

#max workers for client to node connections

#max wait for external connections to finish before shutting down

#max wait for internal connections to finish before shutting down

To create a cluster run the following command in the LuMongo directory:

bash --command createCluster --mongoConfig --clusterConfig

Managing Nodes

Once the cluster is create nodes need to be registered. Before creating a node edit the file. A sample is shown below:

#Node config

#hazelcast port number

#internal service port number

#external service port number

#rest port (comment out to disable)

To register a node:

bash --command registerNode --mongoConfig --nodeConfig

To register a node from a different server or to explicitly specific the address:

bash --command registerNode --mongoConfig --nodeConfig

Multiple nodes can be registered on a single server for testing. These nodes are distinguished solely by hazelcast ports for management. However, all ports must be different to avoid port conflicts

To list current nodes:

bash --command listNodes --mongoConfig

To remove local node:

bash --command removeNode --mongoConfig

To remove a node from a different server with a different hazelcast port:

bash --command removeNode --mongoConfig --address --hazelcastPort 5702

Do not remove a LuMongo node that is currently started

#Starting Nodes

To start a node run:

bash --mongoConfig

To start a node and explicity specific local server address and hazelcast port:

bash --mongoConfig --address --hazelcastPort 5702
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.