Aerospike是一款分布式NoSQL数据库,专为高性能应用设计。Aerospike支持键值和文档数据模型,并提供多种数据类型,包括List、Map、HyperLogLog、GeoJSON和Blob。Aerospike的专利混合内存架构可在大规模部署时提供可预测的高性能,并实现每节点高数据密度。
!aerospike_square_logo
Aerospike企业版需要功能密钥文件才能启动,并解锁数据库中的某些功能(如压缩)。企业客户可使用其生产或开发密钥。
任何人都可以注册获取评估版功能密钥文件,用于全功能的单节点Aerospike企业版。
shdocker run -d -v DIR:/opt/aerospike/etc/ -e "FEATURE_KEY_FILE=/opt/aerospike/etc/features.conf" --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server-enterprise
shdocker run -d -v DIR:/opt/aerospike/etc/ -e "FEATURE_KEY_FILE=/opt/aerospike/etc/features.conf" --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server-enterprise
上述命令中,DIR是您机器上放置功能密钥文件的目录。确保Docker Desktop具有文件共享权限,以便将其绑定挂载到Docker容器中。
shFEATKEY=$(base64 ~/Desktop/evaluation-features.conf) docker run -d -e "FEATURES=$FEATKEY" -e "FEATURE_KEY_FILE=env-b64:FEATURES" --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server-enterprise
您可以使用最新的aerospike-tools镜像连接到Aerospike容器。
shdocker run -ti aerospike/aerospike-tools:latest aql -h $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike) Seed: 172.17.0.2 User: None Config File: /etc/aerospike/astools.conf /root/.aerospike/astools.conf Aerospike Query Client Version 7.0.4 C Client Version 6.0.0 Copyright 2012-2021 Aerospike. All rights reserved. aql> show namespaces +------------+ | namespaces | +------------+ | "test" | +------------+ [172.17.0.2:3000] 1 row in set (0.002 secs) OK
shdocker run -ti aerospike/aerospike-tools:latest asadm -h $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike) Seed: [('172.17.0.2', 3000, None)] Config_file: /root/.aerospike/astools.conf, /etc/aerospike/astools.conf Aerospike Interactive Shell, version 2.10.0 Found 1 nodes Online: 172.17.0.2:3000 Admin> info ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information (2022-11-01 00:48:05 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Node| Node ID| IP| Build|Migrations|~~~~~~~~~~~~~~~~~~Cluster~~~~~~~~~~~~~~~~~~|Client| Uptime | | | | |Size| Key|Integrity| Principal| Conns| 172.17.0.2:3000|*BB9020011AC4202|172.17.0.2:3000|E-6.1.0.3| 0.000 | 1|19E628721D9A|True |BB9020011AC4202| 8|00:02:09 Number of rows: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Usage Information (2022-11-01 00:48:05 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Namespace| Node| Total|Expirations|Evictions| Stop|~~~~~~~~~~Device~~~~~~~~~~|~~~~~~~~~~Memory~~~~~~~~~|~Primary~ | |Records| | |Writes| Used|Used%|HWM%|Avail%| Used|Used%|HWM%|Stop%|~~Index~~ | | | | | | | | | | | | | | Type test |172.17.0.2:3000|0.000 | 0.000 | 0.000 |False |0.000 B | 0.0| 0| 99|0.000 B | 0.0| 0| 90|shmem test | |0.000 | 0.000 | 0.000 | |0.000 B | 0.0| | |0.000 B | 0.0| | | Number of rows: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Object Information (2022-11-01 00:48:05 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Namespace| Node|Rack| Repl| Total|~~~~~~~~~~Objects~~~~~~~~~~|~~~~~~~~~Tombstones~~~~~~~~|~~~~Pending~~~~ | | ID|Factor|Records| Master| Prole|Non-Replica| Master| Prole|Non-Replica|~~~~Migrates~~~ | | | | | | | | | | | Tx| Rx test |172.17.0.2:3000| 0| 1|0.000 |0.000 |0.000 | 0.000 |0.000 |0.000 | 0.000 |0.000 |0.000 test | | | |0.000 |0.000 |0.000 | 0.000 |0.000 |0.000 | 0.000 |0.000 |0.000 Number of rows: 1
Aerospike Docker镜像附带默认配置文件,设置了单节点、单命名空间的开发环境。您也可以提供自己的配置文件(见下文)。
您可以使用-e标志通过容器端环境变量将参数注入默认配置模板。
例如,将默认命名空间名称设置为demo:
shdocker run -d --name aerospike -e "NAMESPACE=demo" -p 3000-3002:3000-3002 -v /my/dir:/opt/aerospike/etc/ -e "FEATURE_KEY_FILE=/opt/aerospike/etc/features.conf" container.aerospike.com/aerospike/aerospike-server-enterprise
将配置参数注入配置模板与提供配置文件不兼容,您只能使用其中一种方式。
FEATURE_KEY_FILEservice上下文中的feature_key_file,仅适用于企业版,运行社区版时必须设置为空字符串。默认值:/etc/aerospike/features.conf。
LOGFILElogging上下文的file参数。默认值:"",不记录到文件。无论此处配置如何,容器都会将日志输出到stdout。
SERVICE_ADDRESSnetworking.service子上下文的绑定address。默认值:any(任意地址)。
SERVICE_PORTnetworking.service子上下文的port。默认值:3000。
单个预配置命名空间具有以下变量:
NAMESPACE命名空间名称。默认值:test。
DATA_IN_MEMORY存储引擎的data-in-memory设置。如果为false(默认),命名空间仅将索引存储在内存中,所有读写操作都从文件系统提供服务从文件系统。如果为true,命名空间存储为内存中带文件系统持久化,即读写操作从完整的内存副本进行,同步写入会持久化到磁盘。
DEFAULT_TTL命名空间的default-ttl。默认值:0。
MEM_GB命名空间的memory-size。默认值:1,单位始终为G(GB)。
NSUP_PERIOD命名空间的nsup-period。默认值:120,单位为秒;当default-ttl为0时也会禁用。
STORAGE_GB命名空间持久化file大小。默认值:4,单位始终为G(GB)。
您可以通过提供自己的aerospike.conf覆盖默认配置文件,如配置Aerospike数据库中所述。
您首先需要使用-v映射本地目录,Docker将绑定挂载该目录。然后,将您的aerospike.conf文件放入该目录。最后,使用--config-file选项告诉Aerospike容器中配置文件的位置(默认路径为/etc/aerospike/aerospike.conf)。请记住,功能密钥文件是必需的,因此在配置文件中使用feature-key-file指向挂载路径(如/opt/aerospike/etc/feature.conf)。
例如:
shdocker run -d -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server-enterprise --config-file /opt/aerospike/etc/aerospike.conf
Docker容器内的文件不会在容器生命周期外持久化。要持久化数据,您需要使用-v选项将主机目录挂载到容器的/opt/aerospike/data:
例如:
shdocker run -d -v /opt/aerospike/data:/opt/aerospike/data -v /opt/aerospike/etc:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 -e "FEATURE_KEY_FILE=/opt/aerospike/etc/features.conf" container.aerospike.com/aerospike/aerospike-server-enterprise
上述示例使用配置模板,其中单个定义的命名空间是内存中带文件持久化的。只需挂载预定义的/opt/aerospike/data目录即可在主机上持久化数据。
或者,您的自定义配置文件中可以将file设置为挂载的/opt/aerospike/data中的文件,如下配置片段所示:
plaintextnamespace test { # : storage-engine device { file /opt/aerospike/data/test.dat filesize 4G data-in-memory true } }
在此示例中,我们使用类似的方式挂载数据目录,并使用自定义配置文件:
shdocker run -d -v /opt/aerospike/data:/opt/aerospike/data -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server-enterprise --config-file /opt/aerospike/etc/aerospike.conf
Docker提供了将主机块设备暴露给运行中容器的能力。--device选项可用于在容器内映射主机块设备。
更新自定义Aerospike配置文件中命名空间的storage-engine device部分:
plaintextnamespace test { # : storage-engine device { device /dev/xvdc write-block-size 128k } }
现在将主机驱动器/dev/sdc映射到容器的/dev/xvdc:
shdocker run -d --device '/dev/sdc:/dev/xvdc' -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server-enterprise --config-file /opt/aerospike/etc/aerospike.conf
重启后,Lua缓存将被清空。要持久化缓存,您需要使用-v选项将主机目录挂载到容器的/opt/aerospike/usr/udf/lua:
shdocker run -d -v /opt/aerospike/lua:/opt/aerospike/usr/udf/lua -v /opt/aerospike/data:/opt/aerospike/data --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server-enterprise --config-file /opt/aerospike/etc/aerospike.conf
为方便起见,此镜像默认未启用安全功能,但这是Aerospike企业版的核心功能。知识库文章如何保护Aerospike数据库服务器详细介绍了该主题。
安全提醒:安全问题可能发生在任何人身上。
另请参见知识库文章如何保护Aerospike数据库服务器。
使用Aerospike企业版单节点评估的开发人员,以及大多数在其机器上使用Docker Desktop进行开发的用户,无需为集群配置节点。如果您有兴趣使用集群,且功能密钥文件没有单节点限制,或者使用社区版,请阅读以下部分。
为使Aerospike节点能够正确向集群和应用程序广播其地址,需要在配置文件中设置access-address配置参数。如果未设置
来自真实用户的反馈,见证轩辕镜像的优质服务
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像加速服务
在 Docker Desktop 配置镜像加速
Docker Compose 项目配置加速
Kubernetes 集群配置 Containerd
在宝塔面板一键配置镜像加速
Synology 群晖 NAS 配置加速
飞牛 fnOS 系统配置镜像加速
极空间 NAS 系统配置加速服务
爱快 iKuai 路由系统配置加速
绿联 NAS 系统配置镜像加速
QNAP 威联通 NAS 配置加速
Podman 容器引擎配置加速
HPC 科学计算容器配置加速
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名加速
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429