Remove nodes/relationships from Neo4j Cluster

62 views
Skip to first unread message

Tiago Sequeira

unread,
Jun 5, 2013, 6:05:34 AM6/5/13
to ne...@googlegroups.com

I am using the 1.9 M03 version of Neo4j and the neo4j.rb gem for jruby and I have Neo4j HA mode active with 3 machines configured:

Instance 1 is responsible to create nodes/relationships through neo4j.rb gem for jruby

load.rb

machine_id = 1

Neo4j.config['enable_ha'] = true
Neo4j.config['ha.server_id'] = machine_id
Neo4j.config['ha.server'] = "localhost:600#{machine_id}"
Neo4j.config['ha.pull_interval'] = '50ms'
Neo4j.config['ha.discovery.enabled'] = false
other_machines = [1,2,3].map{|id| "localhost:500#{id}"}.join(',')
puts "ha.initial_hosts: #{other_machines}"
Neo4j.config['ha.initial_hosts'] = other_machines
Neo4j.config['ha.cluster_server'] = "localhost:500#{machine_id}"
Neo4j.config[:storage_path] = "db/neo#{machine_id}"
Neo4j.config['keep_logical_logs'] = true

Neo4j::Transaction.run do
   #create nodes and relationships
end

Instance 2 is the web server, basically would be the front-end for Neo4j data.

neo4j-server.properties

org.neo4j.server.database.location=data/graph.db
org.neo4j.server.webserver.address=127.0.0.1
org.neo4j.server.webserver.port=7474
org.neo4j.server.webserver.https.enabled=true
org.neo4j.server.webserver.https.port=7473
org.neo4j.server.database.mode=HA

neo4j.properties

keep_logical_logs=true
online_backup_enabled=true
online_backup_port=6362
ha.server_id=2
ha.initial_hosts=localhost:5001,localhost:5002,localhost:5003
ha.server=localhost:6002
ha.cluster_server=:5002
ha.pull_interval=1

Instance 3 is responsible for nodes/relationships deletion through neo4j.rb gem for jruby.

remove.rb

machine_id = 3

Neo4j.config['enable_ha'] = true
Neo4j.config['ha.server_id'] = machine_id
Neo4j.config['ha.server'] = "localhost:600#{machine_id}"
Neo4j.config['ha.pull_interval'] = '50ms'
Neo4j.config['ha.discovery.enabled'] = false
other_machines = [1,2,3].map{|id| "localhost:500#{id}"}.join(',')
puts "ha.initial_hosts: #{other_machines}"
Neo4j.config['ha.initial_hosts'] = other_machines
Neo4j.config['ha.cluster_server'] = "localhost:500#{machine_id}"
Neo4j.config[:storage_path] = "db/neo#{machine_id}"
Neo4j.config['keep_logical_logs'] = true

Neo4j::Transaction.run do
Neo4j._query("START n = node(*)
            MATCH n-[r?]->() 
            WHERE id(n) <> 0
            DELETE n,r")
end
 

The load process (nodes/relationships creation) seems fine but the big problem is that I am not able to remove the nodes and relations with the script remove.rb (but cypher query runs OK in Neo4j WebAdmin). It also seems that data synchronization is not being done well among the various local cluster machines, what am I doing wrong? Am I doing something wrong in the cluster configuration?

Tiago Sequeira

unread,
Jun 6, 2013, 6:03:18 PM6/6/13
to ne...@googlegroups.com
Hi guys, someone to give some hint about that?

Thanks in advance.

Message has been deleted

Peter Neubauer

unread,
Jun 8, 2013, 7:08:41 AM6/8/13
to Neo4j User

Not totally sure but are you able to insert data so it is visible on all 3 instances? It might be that there are actually 2 clusters established?

Do you have the logs? Also, could you please upgrade to 1.9 GA?

/peter

Sent from mobile device.

On Jun 7, 2013 12:03 AM, "Tiago Sequeira" <tiagomanu...@gmail.com> wrote:
Hi guys, someone to give some hint about that?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply all
Reply to author
Forward
0 new messages