CREATE keyspace dennis WITH replication = {‘class’:’SimpleStrategy’, ‘replication_factor’ : 1}; DESCRIBE keyspaces; drop keyspace dennis;
use dennis; DESC tables;
CREATE TABLE student( id int, name varchar, PRIMARY KEY(id) ); INSERT INTO student (id,name) VALUES (1,’Naruto’); select * from student where id=2; DESC table student;
nodetool describering keyspace nodetool gossipinfo nodetool describecluster nodetool ring
// volatile-lru -> Evict using approximated LRU among the keys with an expire set. // allkeys-lru -> Evict any key using approximated LRU. // volatile-lfu -> Evict using approximated LFU among the keys with an expire set. // allkeys-lfu -> Evict any key using approximated LFU. // volatile-random -> Remove a random key among the ones with an expire set. // allkeys-random -> Remove a random key, any key. // volatile-ttl -> Remove the key with the nearest expire time (minor TTL) // noeviction -> Don’t evict anything, just return an error on write operations. maxmemory-policy noeviction maxmemory-samples 5
LAZY FREEING
lazyfree-lazy-eviction no lazyfree-lazy-expire no lazyfree-lazy-server-del no slave-lazy-flush no
APPEND ONLY MODE
appendonly no appendfilename “appendonly.aof” //no、always、everysec appendfsync everysec //当正在rewrite的时候不刷盘 no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb //redis在恢复时,会忽略最后一条可能存在问题的指令 aof-load-truncated yes //混合持久化 aof-use-rdb-preamble no
每个node都会接收publish message,然后ack这个message,但是不会应用这个更新. 如果master没有在discovery.zen.commit_timeout指定的时间内(默认是30s),从至少discovery.zen.minimum_master_nodes个节点获取ack响应,那么这次cluster state change事件就会被reject,不会应用.