-
Notifications
You must be signed in to change notification settings - Fork 276
Neo4j::ha cluster
Neo4j.rb (any of the neo4j-core, neo4j-wrapper and neo4j gems) can be used in a HA Cluster. The Neo4j HA Cluster can also be useful as a development tool. By using HA cluster you can have write support for the rails console, or use the Neo4j Server Admin UI to monitoring and debugging the graph database.
More info: Neo4j HA documentation HA Cluster for example of Neo4j::Config configuration. Also check the license for neo4j-enterprise (different to neo4j-community).
The rails console will start up in read-only mode if you already have a running rails application since Neo4j does not allow write access to the database from several processes.
As a workaround you can use Neo4j HA which will replicate databases between processes. To enable write access from a rails console using Neo4j HA:
- Add development dependencies to your Gemfile:
neo4j-advanced
andneo4j-enterprise
, example:
gem 'neo4j-community', '1.9.M03'
gem 'neo4j-advanced', '1.9.M03'
gem 'neo4j-enterprise', '1.9.M03'
- in your application/config.rb, add
require 'neo4j/rails/ha_console/railtie' if Rails.env.development?
- in config/application.rb :
config.neo4j.storage_path = ... unless Rails.env.development?
This is needed since the ha_console/railties will set the location of the database (rails console and rails server will have different databases which will be synchronized).
This works in neo4j version 2.2.3
Follow the instruction above for using rails console with write support.
- Download the neo4j-enterprise from here.
- Unpack the file.
- Edit the
conf/neo4j.properties
file
ha.server_id=3
ha.initial_hosts=localhost:5001,localhost:5002,localhost:5003
ha.server=localhost:6003
ha.cluster_server=localhost:5003
ha.pull_interval=1
- Edit the
conf/neo4j-server.properties
# Uncomment this line:
org.neo4j.server.database.mode=HA
Notice its possible to use both the rails console using Neo4j HA and at the same time use the Neo4j Server UI using Neo4j HA.
WARNING: Much of the information in this wiki is out of date. We are in the process of moving things to readthedocs
- Project Introduction
- Neo4j::ActiveNode
- Neo4j::ActiveRel
- Search and Scope
- Validation, Uniqueness, and Case Sensitivity
- Indexing VS Legacy Indexing
- Optimized Methods
- Inheritance
- Core: Nodes & Rels
- Introduction
- Persistence
- Find : Lucene
- Relationships
- Third Party Gems & extensions
- Scaffolding & Generators
- HA Cluster