小编ras*_*ide的帖子

AeroSpike在我的记录中创建了TTL

我很难从AeroSpike文档中了解以下内容:

http://www.aerospike.com/docs/client/python/usage/kvs/record-structure.html

记录还有两个与之关联的元数据值 - 记录生成(已修改的次数)及其ttl.可以将ttl设置为剩余的第二个数,直到它被认为已过期,或者设置为0(对于"永不过期"和默认值).ttl已过期的记录将由服务器进行垃圾收集.每次写入或触摸记录时(使用touch()),其ttl将重置.

我最初的想法是,如果命名空间策略默认ttl设置为0,那么记录将不会过期.

我的Aerospike命名空间配置如下:

namespace brand {
        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.
        set twitter {
                set-disable-eviction true
        }

        storage-engine device {
                file /opt/aerospike/data/bar.dat
                filesize 16G
                data-in-memory true # Store data in memory in addition to file.
        }
}
Run Code Online (Sandbox Code Playgroud)

我在数据库中做了一些插入,然后当我检索数据时,我得到了以下内容:

{ name: 'test',
  twitter: 'test',
  domain: 'test.com',
  description: 'Your …
Run Code Online (Sandbox Code Playgroud)

aerospike

3
推荐指数
1
解决办法
1336
查看次数

标签 统计

aerospike ×1