编译安装Aerospike
下载Aerospike Server社区版
wget -O aerospike.tgz 'https://www.aerospike.com/download/server/latest/artifact/tgz'
# 解压
tar -xvf aerospike.tgz
# 初始化Aerospike服务器
cd aerospike-server
./bin/aerospike init
# 下载Aerospike工具
# Red Hat Variants (RHEL6):
wget -O aerospike-tools.tgz 'https://www.aerospike.com/download/tools/latest/artifact/el6'
# Red Hat Variants (RHEL7):
wget -O aerospike-tools.tgz 'https://www.aerospike.com/download/tools/latest/artifact/el7'
# 安装工具包
tar -xvf aerospike-tools.tgz && cd aerospike-tools-3.24.1-el7
# Red Hat Variants (RHEL6):
rpm -Uvh aerospike-tools-3.24.1-1.el6.x86_64.rpm
# Red Hat Variants (RHEL7):
rpm -Uvh aerospike-tools-3.24.1-1.el7.x86_64.rpm
# 启动Aerospike
./bin/aerospike start && \
tail -f ./var/log/aerospike/aerospike.log | grep cake
# 查看Aerospike运行状态
./bin/aerospike status
info: process running
验证Aerospike
# 使用工具包中的aql测试,仅用于基本验证。aql将为每个事务创建一个新的连接,不建议将其作为生产级客户端。
# 在默认配置的“测试”命名空间中使用键“ Aerospike”创建一个新对象,然后添加三个字段“名称”,“地址”和“电子邮件”
aql -h 127.0.0.1 -c "INSERT INTO test.demo (PK, name, address, email) VALUES ('Aerospike', 'zlh', '中国-浙江', 'info@aerospike.com')"
运行信息:INSERT INTO test.demo (PK, name, address, email) VALUES ('Aerospike', 'zlh', '中国-浙江', 'info@aerospike.com')
OK, 1 record affected.
# 查询
aql -h 127.0.0.1 -c "select * from test.demo where PK='Aerospike'"
运行信息:select * from test.demo where PK='Aerospike'
+-------+-----------------+----------------------+
| name | address | email |
+-------+-----------------+----------------------+
| "zlh" | "中国-浙江" | "info@aerospike.com" |
+-------+-----------------+----------------------+
1 row in set (0.003 secs)
OK
# 删除
aql -h 127.0.0.1 -c "DELETE FROM test.demo where PK='Aerospike'"
运行信息:DELETE FROM test.demo where PK='Aerospike'
OK, 1 record affected.
# 清空
truncate table test.demo
aql语法:
aql --help
来源:oschina
链接:https://my.oschina.net/zlhblogs/blog/4268693