我有很難理解從塞文檔如下:塞在我的記錄創建TTL
http://www.aerospike.com/docs/client/python/usage/kvs/record-structure.html
的記錄也有兩個與之相關的元數據值 - 記錄生成(數它被修改過的次數)和它的ttl。可以將ttl設置爲剩餘的秒數,直到它被認爲過期,或者設置爲0(對於'never expire'和默認值)。 ttl已過期的記錄將被服務器垃圾收集。每次寫入或觸摸記錄(使用touch())時,它的ttl都會重置。
我最初的想法是,如果名稱空間策略默認ttl設置爲0,則記錄不會過期。
我塞式命名空間的配置如下:
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.
}
}
我做了一些插入到數據庫中,然後當我取回我得到了以下數據:
{ name: 'test',
twitter: 'test',
domain: 'test.com',
description: 'Your First Round Fund' } { ttl: 4294967295, gen: 2 }
不知怎的,一個TTL出現在記錄和其他記錄上也有ttl。我不希望我的記錄從數據庫中刪除。如何從記錄中刪除ttl,以及如何防止將來發生這種情況?
"asadm -e 'show stat like ttl'
顯示以下內容:
~~~~brand Namespace Statistics~~~~
NODE : 1
cold-start-evict-ttl: 4294967295
default-ttl : 0
max-ttl : 0
~~~~test Namespace Statistics~~~~~
NODE : 1
cold-start-evict-ttl: 4294967295
default-ttl : 2592000
max-ttl : 0
asinfo -v 'hist-dump:ns=brand;hist=ttl'
顯示以下
brand:ttl=100,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
(單獨的問題)定義了2個存儲引擎。 「存儲引擎內存」僅用於內存中的名稱空間。 – kporter
你可以運行並提供「asadm -e」展示統計信息,例如ttl'「 – kporter
用」asadm -e'顯示統計信息如ttl'更新了答案「 – rastacide