How to have multiple replicated nodes

I have .1 server where I write data

Also have .2 and .3 servers which should be replicas of .1 data

It’s easier with Redis having .1 as Master and .2 and .3 as Slaves

I am not sure how to configure this on Aerospike as Document don’t this

Please help

Thanks in advance,

Abhi

You should start by reading the data distribution and clustering sections of the overview. It seems you’re missing some basic concepts.

Redis was not designed to be a distributed database, so whatever replication it may have must be provided by a module on the application side or middleware. Aerospike was designed as a distributed database, and takes care of creating replica copies at the server layer according to your namespace definition. It also automatically handles nodes joining or leaving the cluster, rebalancing the data when that happens, to be in compliance with your namespace config.

In your case, it seems you want to have 3 copies of the data, one in a master partition, and two replica partitions. That would be replication-factor 3 in that namespace. There is no ‘master’ node and ‘slave’ nodes. Each node in Aerospike has an even share of the master partitions (there are 4096 partitions per-namespace), and if you set a replication factor greater than 1 each node also has an even number of replica partitions. This means that no node in Aerospike is special, there’s no signle point of failure. All the nodes take an even load of reads and writes thanks to this distribution.

By default the Aerospike client reads from the node with the master partition of the record. The replica copies are there for durability, so data doesn’t become unavailable if you lose a node (or 2 nodes in this case). You can modify the read replica policy from MASTER to ANY allowing the client to distribute the reads across the nodes.

One more thing, Redis doesn’t have persistent storage out of the box. If you want to similarly use Aerospike as a distributed cache, configure the storage engine of your namespace to be data in memory without persistence.

1 Like

hi Ronen

Thanks very much for the info

Do I need to add replication-factor 3 to namespace for all nodes configs

I added below config to all 3 nodes as there is no master in this case… is this the correct way?

heartbeat {
                mode mesh
                address 10.10.1.154
                port 3002

                mesh-seed-address-port 10.10.1.154 3002
                mesh-seed-address-port 10.10.1.150 3002
                mesh-seed-address-port 10.10.1.153 3002

                interval 150
                timeout 10
        }

and

namespace MyTest {
        memory-size 10G
        replication-factor 3

        storage-engine device {
                device /dev/sdd1
                scheduler-mode noop
                write-block-size 128K
                max-write-cache 1024M
        }
}

Thanks

Abhijit

Yes.

Looks good to me.

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.