Aerospike error 22

I am using aerospike server version and run it over k8s i an using java client version 4.1.2 I am trying to write to aerospike cache with ttl

  • when I tried to write to aerospike server without configured ttl on the client-side it worked but when I added experiation to the write policy (120 seconds) and changed the namespace configuration on the server to be as follows:
namespace test {
    replication-factor 2
    memory-size 1G
    nsup-period 600
    default-ttl 120

I sometimes managed to write but most of the times failed with the 22 error

what am I doing wrong?

  • How many nodes are in this cluster?
  • Did you update the configuration in aerospike.conf and also either dynamically or via restart? (Note: you had capital letters in your original post for “Nsup” and “Default”, I assume that was a formatting error and not actually from your config - it would be illegal in the config.)
    • To set dynamically across the entire cluster:
      asadm -h <aerospike_node_ip> -e "set-config:context=namespace;id=test;nsup-period=600"
      asadm -h <aerospike_node_ip> -e "set-config:context=namespace;id=test;defualt-ttl=120"

as you mentioned my problem was that I edited manually the namespace config in aerospike.conf in each of my pods - and for some reason, the restart didn’t really affect the config. when dynamically setting the config, things are working. tnx!

This likely indicates a problem with your procedure. If the config changes were present in the config file, then the server would have picked them up.

© 2021 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.