命名空间存储配置(Namespace Storage Configuration)

来源:互联网 发布:移动通信网络发展历程 编辑:程序博客网 时间:2024/06/05 07:31
aerospike决定在哪里存储数据的存储引擎配置是基于命名空间的,这些引擎确定数据将被保存到磁盘,驻留在内存或者基于磁盘和内存的混合存储。这些决定将会影响持久性,成本和集群的性能。



Support for Multi-Bin(支持多个bin)
Supports full Aerospike data Model (支持所有的Aerospike数据模型)
Survive a Power Outage(停电时保持数据)
Fast Restarts(快速重启)
Support for XDR(支持跨数据中心复制)
Index in Memory(在内存中索引)

存储引擎配置方法
下面的方法需要修改Aerospike在/etc/aerospike/aerospike.conf的服务器的配置文件。
开始,在您喜欢的编辑器中打开配置文件并做相应的更改。

SSD存储引擎的方法
namespace <namespace-name> {    memory-size <SIZE>G         # Maximum memory allocation for primary# and secondary indexes.(最大内存分配给主索引和二级索引)    storage-engine device {     # Configure the storage-engine to use persistence(配置存储引擎使用的持久性)        device /dev/<device>    # raw device. Maximum size is 2 TiB(原始设备,最大的大小为2TB)# device /dev/<device>  # (optional) another raw device.可选,其它设备        write-block-size 128K   # adjust block size to make it efficient for SSDs.(调整block大小使SSD使用更高效)    }}


磁盘存储和内存存储的方法
namespace <namespace-name> {    memory-size <SIZE>G             # Maximum memory allocation for data and# primary and secondary indexes.
(最大内存分配给主索引和二级索引)

storage-engine device { # Configure the storage-engine to use# persistence. Maximum size is 2 TiB(配置存储引擎使用的持久性。最大尺寸是2 TiB file /opt/aerospike/<filename> # Location of data file on server.(数据文件在服务器中的位置)# file /opt/aerospike/<another> # (optional) Location of data file on server. filesize <SIZE>G # Max size of each file in GiB. data-in-memory true# Indicates that all data should also be# in memory.(表明所有数据也应该在内存中) }}



磁盘存储引擎和数据索引引擎的方法
namespace <namespace-name> {    memory-size <N>G                # Maximum memory allocation for data and# primary and secondary indexes.    single-bin true# Required true by data-in-index.    data-in-index true# Enables in index integer store.    storage-engine device {         # Configure the storage-engine to use# persistence.    file /opt/aerospike/<filename>  # Location of data file on server.# file /opt/aerospike/<another> # (optimal) Location of data file on server.# device /dev/<device>          # Optional alternative to using files.    filesize <SIZE>G               # Max size of each file in GiB. Maximum size is 2TiB    data-in-memory true# Required true by data-in-index.    }}


数据在内存中没有持久化的方法
namespace <namespace-name> {    memory-size <SIZE>G   # Maximum memory allocation for data and primary and# secondary indexes.    storage-engine memory # Configure the storage-engine to not use persistence.(配置存储引擎为不使用持久化)}


命名空间数据保留策略
namespace <namespace-name> {    default-ttl <VALUE>             # How long (in seconds) to keep data after# it is written    high-water-disk-pct <PERCENT>   # How full may the disk become before the# server begins eviction (expiring records# early)    high-water-memory-pct <PERCENT> # How full may the memory become before the# server begins eviction (expiring records# early)    stop-writes-pct <PERCENT>       # How full may the memory become before# we disallow new writes    ...}


set的数据保持
namespace <namespace-name> {    ...    set <set-name> {        set-evict-hwm-count <COUNT>   # How many records may reside in this set# before the server begins evicting# records from this setset-stop-writes-count <COUNT> # How many records may be in this set# before the server begins rejecting# writes to this set    }}


Intracluster Replication

namespace <namespace-name> {    ...    replication-factor 2 ...}




服务器要求
Dell PowerEdge 12G R720 :
2 *  CPU Xeon E5-2650 V2 ;
24 * 内存为:ECC 8G (单条):
1 * SSD 商用240G
7 * 硬盘为: 3.5 SAS 15K 600G, 硬盘做RAID5;
RAID卡为:PERC H710P ; 
Intel四端口千兆网卡 ;
iDRAC6远程管理卡;
电源: 双电 750W;
操作系统版本:centos 6.7 liunx内核3.1以上



single-bin

设置为true时将不允许有多个bin的记录

data-in-index

优化单个bin的情况,将只允许整数存储在索引空间


cluster {
    mode static #static:node-id必须是静态分配,dynamic:node-id基于本地ip地址动态选择,none:不要使用机架感应
    self-node-id  101 #识别单个节点,在同一个组内必须是唯一的
    #self-node-id  301
    self-group-id 201 #确定节点的集合,同一个组里面的节点将没有副本
}
集群背景下需要paxos-protocol v4。

logging {
  # Log file must be an absolute path.
  file /data/server/aerospike-server/bin/var/log/aerospike.log {
    context any info
  }
}
logging {    file /var/log/aerospike/aerospike.log {        context any info    }    file /var/log/aerospike/aerospike_debug.log {        context any debug    }}

mod-lua {
  system-path /data/server/aerospike-server/bin/share/udf/lua #系统默认函数
  user-path /data/server/aerospike-server/bin/var/udf/lua #用户自定义函数
}

namespace test {
  replication-factor 2
  #memory-size 8G
  #default-ttl 30d # 30 days, use 0 to never expire/evict.
  #storage-engine memory
  memory-size 8G
  storage-engine device {
  file /opt/aerospike/data.bat
  filesize 20G
  data-in-memory true #永远保持一份所有数据在内存中。默认为false
  }
}






0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 婴儿下巴口水藓怎么办 婴儿嘴边长癣怎么办 婴儿脸上口水癣怎么办 嘴巴旁边长癣怎么办 美团机票不出票怎么办 东方航空会员锁定怎么办 大众车烧机油怎么办 大众cc烧机油怎么办 叫外卖给差评被打怎么办 发现宿舍被盗后怎么办 知了猴变黑了怎么办 婴儿仙人掌的刺怎么办 仙人掌刺扎进皮肤里怎么办 被仙人掌的小细绒刺扎到怎么办 值机截止了怎么办 社保卡消磁了怎么办 住宾馆没身份证怎么办 社保卡电话错误怎么办 没住过酒店怎么办 上海合规网约车证件怎么办 取票没有身份证怎么办 买车票没有身份证怎么办 登机身份证丢了怎么办 飞机没带身份证怎么办 上飞机没带身份证怎么办 机场没带身份证怎么办 儿童坐飞机没有户口本怎么办 不需要行李托运化妆品怎么办 坐飞机被限制了怎么办 坐飞机没买保险怎么办 飞机起飞时难受怎么办 婴儿坐飞机没座位怎么办 转机行李不直达怎么办 儿童自己坐飞机怎么办手续 两岁宝宝发烧怎么办 网上购票待核验怎么办 老人坐飞机找不到登机口怎么办 儿童不能值机怎么办 飞机上旅客刁难怎么办 飞机上婴儿哭闹怎么办 飞机上婴儿啼哭怎么办