Restarting Aerospike server deletes all data

After I run the command sudo service aerospike restart all the data in the namespaces gets deleted.

I am running on a Ubuntu 14.04 machine with Aerospike Community Edition build 3.6.2.

Is your namespace defined as storage-engine memory? By default that’s what it is, and without persistence, so unless you modified your default aerospike.conf that’s the expected behavior. Useful for development.

Please share your config, if not.

This is the config I am using. I am storing data in-memory alongside with in a file.

service {
        user root
        group root
        paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
        pidfile /var/run/aerospike/asd.pid
        service-threads 4
        transaction-queues 4
        transaction-threads-per-queue 4
        proto-fd-max 15000
}

logging {
        # Log file must be an absolute path.
        file /var/log/aerospike/aerospike.log {
                context any info
        }
}

network {
        service {
                address any
                port 3000
        }

        heartbeat {
                mode multicast
                address 239.1.99.222
                port 9918

               interval 150
                timeout 10
        }

        fabric {
                port 3001
        }

        info {
                port 3003
        }
}

    namespace polls {
            replication-factor 2
            memory-size 4G
            default-ttl 0 # 30 days, use 0 to never expire/evict.

            #storage-engine memory

            # To use file storage backing, comment out the line above and use the
            # following lines instead.
           storage-engine device {
                   file /opt/aerospike/data/polls.dat
                   filesize 16G
                   data-in-memory true # Store data in memory in addition to file.
    #              scheduler-mode noop
           }

Will there be an issue if I delete the storage backing file, in my cases polls.dat and then restore from a backup?

Because I noticed that this issue occurs only when I manually delete the .dat file and restore.

Wait, you stopped the server, removed the dat file, then tried to restart? If you take away the file it has no copy of the data. DRAM is volatile, obviously.

No no.

I removed the file while the server was running then restored Aerospike(the file is automatically created here) and then restarted the server. Now, the data goes off.

Well, you can’t remove the persistence file while the server is running.

1 Like

Okay. Got that.

The way I got into this issue is one of the machines got restarted which had a single node Aerospike cluster running. When the server came back on, all the data was missing.

What I did next is delete the namespace file and asrestore from an old backup. After backing up and restarting the machine did not delete the data this time,