Primary Indexes are lost for Aerospike container after it is relaunched

Hi, I am running an Aerospike container in “In-Memory with Persistence” mode with following command:

docker run -d -e “REPL_FACTOR=1” -v :/opt/aerospike/etc -v /opt/aerospike/data:/opt/aerospike/data --name aerospike -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3003:3003 aerospike/aerospike-server

I can see a .dat file being created under /opt/aerospike/data/ as expected. I create some data and primary indexes using aql and then stop and remove the container

docker stop aerospike docker rm aerospike

Now when I start a new container again with the docker run command exactly same as the first one above, I see that the data gets restored back but not the indexes.

Why is that? If it can restore data correctly why can it not rebuild the primary indexes? Is there some config I am missing? Thank you!

If I remember correctly the indexes are defined in the smd folder. If you map that to the host it can use those to rebuild. Give it a shot.

Worked like a charm! Thanks @Albot

1 Like