Why my aerospike cluster can't do replication even I set replication-factor 2?

Aerospike version:C-7.0.0.10 Server OS: Ubuntu22.04 There are 2 node in the cluster, and they can find each other. Node1 config:/etc/aerospike/aerospike.conf: #####################################################################

# Aerospike database configuration file for use with systemd.

service {
        user root
        group root
        pidfile /var/run/aerospike/asd.pid
        service-threads 20 # Should be 5 times number of vCPUs for 4.7+ and
                           # at least one SSD namespace, otherwise number of vCPUs

        proto-fd-max 15000
        node-id-interface ens34f0np0
        cluster-name cakery
}

logging {
        file /var/log/aerospike/aerospike.log {
                context any info
        }
}

network {
        service {
                address any
                access-address 109.105.118.39
                port 3000
        }

        heartbeat {
                mode mesh
                address 109.105.118.39
                port 3002
                mesh-seed-address-port 109.105.118.129 3002
                mesh-seed-address-port 109.105.118.39 3002

                interval 150
                timeout 10
        }

        fabric {
                port 3001
        }

        info {
                port 3003
        }
}


namespace wyf_test_39 {
        replication-factor 2

        storage-engine device {
                 # Use one or more lines like those below with actual device paths.
                device /dev/nvme2n1

                max-write-cache 2048M
                write-block-size 1M
        }

}
##################################################################################

Node2 config:/etc/aerospike/aerospike.conf:

# Aerospike database configuration file for use with systemd.

service {
        user root
        group root
        pidfile /var/run/aerospike/asd.pid
        service-threads 20 # Should be 5 times number of vCPUs for 4.7+ and
                           # at least one SSD namespace, otherwise number of vCPUs
        proto-fd-max 15000
        node-id-interface eno8303
        cluster-name cakery
}

logging {
        file /var/log/aerospike/aerospike.log {
                context any info
        }
}

network {
        service {
                address any
                access-address 109.105.118.129
                port 3000
        }

        heartbeat {
                mode mesh
                address 109.105.118.129
                port 3002
                mesh-seed-address-port 109.105.118.39 3002
                mesh-seed-address-port 109.105.118.129 3002

                interval 150
                timeout 10
        }

        fabric {
                port 3001
        }

        info {
                port 3003
        }
}

namespace test_129 {
        replication-factor 2
       storage-engine device {
                 # Use one or more lines like those below with actual device paths.
                device /dev/nvme0n1
                max-write-cache 2048M
                write-block-size 1M
       }
}

I load some data with YCSB on node1: ./bin/ycsb.sh load aerospike -s -P /myworkloadconfig -threads 16。 The data can be load successfully on node1, but NOT replica on node 2. Below is the “info” command result through asadm on node 1:

base) root@testpc11839:/home/czm/YCSB# asadm
Seed:        [('127.0.0.1', 3000, None)]
Config_file: /root/.aerospike/astools.conf, /etc/aerospike/astools.conf
Aerospike Interactive Shell, version 2.22.0

Found 2 nodes
Online:  109.105.118.39:3000, 109.105.118.129:3000

Admin> info
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information (2024-06-20 06:10:36 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          Node|         Node ID|                  IP|     Build|Migrations|~~~~~~~~~~~~~~~~~Cluster~~~~~~~~~~~~~~~~~~|Client|  Uptime
                              |                |                    |          |          |Size|        Key|Integrity|      Principal| Conns|
testpc118129:3000             |*BB9EC404C722AEC|109.105.118.129:3000|C-7.0.0.10|   0.000  |   2|5C7231310C1|True     |BB9EC404C722AEC|     7|00:37:52
testpc11839.samsungds.net:3000| BB9508EAFF22314|109.105.118.39:3000 |C-7.0.0.10|   0.000  |   2|5C7231310C1|True     |BB9EC404C722AEC|     7|00:31:50
Number of rows: 2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Usage Information (2024-06-20 06:10:36 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Namespace|                          Node|Evictions|  Stop|~System Memory~|~Primary Index~|~~Secondary~~|~~~~~~~~~~~~~~~~~~~Storage Engine~~~~~~~~~~~~~~~~~~
           |                              |         |Writes| Avail%| Evict%| Type|     Used|~~~~Index~~~~|  Type|      Used| Used%|Evict%|  Used|Avail%|Avail
           |                              |         |      |       |       |     |         |Type|    Used|      |          |      |      | Stop%|      |Stop%
test_129   |testpc118129:3000             |  0.000  |False |     92|      0|mem  | 0.000 B |mem |0.000 B |device|  0.000 B | 0.0 %| 0.0 %|70.0 %|99.0 %|5.0 %
test_129   |                              |  0.000  |      |       |       |     | 0.000 B |    |0.000 B |      |  0.000 B | 0.0 %|      |      |      |
wyf_test_39|testpc11839.samsungds.net:3000|  0.000  |False |     54|      0|mem  | 2.980 GB|mem |0.000 B |device|193.715 GB|9.46 %| 0.0 %|70.0 %|90.0 %|5.0 %
wyf_test_39|                              |  0.000  |      |       |       |     | 2.980 GB|    |0.000 B |      |193.715 GB|9.46 %|      |      |      |
Number of rows: 2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Object Information (2024-06-20 06:10:36 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Namespace|                          Node|Rack|  Repl|Expirations|   Total|~~~~~~~~~~Objects~~~~~~~~~~~|~~~~~~~~~Tombstones~~~~~~~~|~~~~Pending~~~~
           |                              |  ID|Factor|           | Records|  Master|  Prole|Non-Replica| Master|  Prole|Non-Replica|~~~~Migrates~~~
           |                              |    |      |           |        |        |       |           |       |       |           |     Tx|     Rx
test_129   |testpc118129:3000             |   0|     1|    0.000  | 0.000  | 0.000  |0.000  |    0.000  |0.000  |0.000  |    0.000  |0.000  |0.000
test_129   |                              |    |      |    0.000  | 0.000  | 0.000  |0.000  |    0.000  |0.000  |0.000  |    0.000  |0.000  |0.000
wyf_test_39|testpc11839.samsungds.net:3000|   0|     1|    0.000  |50.000 M|50.000 M|0.000  |    0.000  |0.000  |0.000  |    0.000  |0.000  |0.000
wyf_test_39|                              |    |      |    0.000  |50.000 M|50.000 M|0.000  |    0.000  |0.000  |0.000  |    0.000  |0.000  |0.000
Number of rows: 2

It seems like no replica did. Because the size of storage device on node2 didn’t change any. Why the “Rel Factor” here is 1? I got the log from /var/log/aerospike/aerospike.log, it shows the replication factor is 1 too. Can anyone tell me why?

Jun 20 2024 05:38:48 GMT: INFO (partition): (partition_balance.c:800) {wyf_test_39} is on 1 of 2 nodes
Jun 20 2024 05:38:48 GMT: INFO (partition): (partition_balance.c:1038) {wyf_test_39} replication factor is 1
Jun 20 2024 05:38:48 GMT: INFO (partition): (partition_balance.c:1011) {wyf_test_39} rebalanced: expected-migrations (0,0,0) fresh-partitions 4096

You need to have the namespace on all nodes. Currently each node has one namespace with different names.

This line is telling you how many of the nodes have a particular namespace:

Jun 20 2024 05:38:48 GMT: INFO (partition): (partition_balance.c:800) {wyf_test_39} is on 1 of 2 nodes

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