Redis DB Master Slave set up -


i have installed redis nodejs application , configured slave instance of redis db running on different server. can have same instance (different db) of redis (running slave) act master locally installed application?

thanks in advance

yes, can, big caveat.

any slave instance can master of 1 or several other instances. can imagine daisy chaining slaves , build hierarchical replication system.

now, understanding don't need slave feed redis instance, allow application perform read/write operations in database of slave instance.

to allow it, need set value of slave-read-only parameter "no" in slave configuration:

# can configure slave instance accept writes or not. writing against # slave instance may useful store ephemeral data (because data # written on slave deleted after resync master) # may cause problems if clients writing because of # misconfiguration. # # since redis 2.6 default slaves read-only. # # note: read slaves not designed exposed untrusted clients # on internet. it's protection layer against misuse of instance. # still read slave exports default administrative commands # such config, debug, , forth. limited extend can improve # security of read slaves using 'rename-command' shadow # administrative / dangerous commands. slave-read-only no 

now, write operations run on instance ephemeral. if link lost between master , slave, slave synchronize again master. data have set on slave will lost. if stop , restart slave, loose ephemeral data.

it may or may not suit needs.

there no way parameter synchronization (or persistence options) @ database level. cannot tell redis synchronize given database, , not one. configuration applies @ instance level.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -