How to set slave to read only in a cluster?

71 views
Skip to first unread message

cui r

unread,
Apr 16, 2015, 4:45:14 PM4/16/15
to ne...@googlegroups.com
Hi,

What's the configuration to set slave nodes to read-only in a cluster? I couldn't find it in the doc and googling.

Any pointer is appreciated.

Rick

Sumit Gupta

unread,
Apr 17, 2015, 4:02:02 AM4/17/15
to ne...@googlegroups.com


Set this in your neo4j.properties "read_only=true"


But logically your slaves are always read-only in cluster Mode "for the clients/ end users". Though they can accept write request but they re-direct those request to Master Node.
 
All Write transactions are Handled by Master only and then data is replicated from Master to Slave nodes.

Thanks,
Sumit

cui r

unread,
Apr 17, 2015, 12:27:45 PM4/17/15
to ne...@googlegroups.com
Thanks. 

Actually, the slaves are not read-only for LOAD CSV. Somehow load csv slipped through into slaves by one of our developers.
And the change are not populated to all nodes, the first read returns 53 nodes, and the second read returns 29 nodes.

read_only=true set all nodes, including master, to read-only. But we still want master to be writable.

Sumit Gupta

unread,
Apr 17, 2015, 10:52:19 PM4/17/15
to ne...@googlegroups.com
I remember that with 2.1.5 and it respects read_only attribute for slaves too.

Though i haven't tried but in a cluster LOAD_CSV should also redirect all of its writes to Master Node unless you are connecting neo4jshell with "--path" attributes.

Let me know your Neo4j version and I can check it out.

Thanks,
Sumit

cui r

unread,
Apr 28, 2015, 11:22:55 AM4/28/15
to ne...@googlegroups.com
Hi Sumit,

Thanks for the comment.

We were not using neo4jshell at all. We run into this issue with the web console.
We use 2.2.0 enterprise.

Rick

Sumit Gupta

unread,
Apr 29, 2015, 7:27:14 AM4/29/15
to ne...@googlegroups.com
Hi Rick, 

I think you are using "shell" which is packaged with "webadmin"? Correct?

"webadmin" is obsolete and you should not use it anymore. 

Even i tried with Webadmin too and still not able to insert data (using "Load CSV") for read only nodes.

Are you able to replicate it constantly? i mean are you able to insert data repeatedly or was it just once and after that it never happened?

Thanks,
Sumit 


--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/Ok7fUgN5HKc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cui r

unread,
Apr 29, 2015, 1:37:07 PM4/29/15
to ne...@googlegroups.com
No, I am not using webadmin shell, since I am aware of the fact that it's obsolete. I just use the web interface. (/browser)

One of my colleagues did another test yesterday and was able to LOAD CSV to a read node. Separately, this is confirmed by the Neo4j support team. The issue we run into last week was, if we LOAD CSV to a slave node, then the data is not immedidately populate to other nodes so the count of the data on all nodes are different(we have a 3 node cluster). We saw this twice. I'll try to recreate this case in a small scale (since our data size is kind of large).

Appreciate Sumit.

Sumit Gupta

unread,
Apr 29, 2015, 2:07:36 PM4/29/15
to ne...@googlegroups.com
Hi Rick,

Is there any Issue logged with neo4j for this?

Thanks,
Sumit
Reply all
Reply to author
Forward
0 new messages