Aerospike入坑导读

简介:

    Aerospike是一个以分布式为核心,T级别大数据高并发的结构化数据存储解决方案,读写操作达微妙级,索引内存化数据固态化,自动感知集群状态,节点间数据强一致性,平滑扩展以及丰富的开发语言支持,和redis相比aql介入的更有亲和力,对RDBMS的支持更好,熟悉sql的小哥哥小姐姐表示毫无压力,不过稳定性和普及率还有相当的差距,据说许多互联网广告相关业务都用它存储中间数据,难道我这些年混的都是假的互联网广告公司吗,有用的请举个爪儿。

Aerospike MySQL
namespace db
set table
bin column
key primary key
record row

    下载地址:https://www.aerospike.com/artifacts/aerospike-server-community/,解压执行asinstall,service aerospike [start|stop|status]管理服务,/etc/aerospike/aerospike.conf服务端配置文件中network块中heartbeat部分配置了集群的组播地址与端口,namespace块定义自己的业务命名空间;/etc/aerospike/astools.conf为aql端配置文件,其中aql块中timeout项被屏蔽默认1000毫秒,实操经验显示太短,建议改为2000以上;

(解压缩)
[root@localhost ~]# tar xvf aerospike-server-community-4.2.0.5-el7.tgz 
aerospike-server-community-4.2.0.5-el7/
aerospike-server-community-4.2.0.5-el7/SHA256SUMS
aerospike-server-community-4.2.0.5-el7/aerospike-tools-3.15.3.8-1.el7.x86_64.rpm
aerospike-server-community-4.2.0.5-el7/LICENSE
aerospike-server-community-4.2.0.5-el7/asinstall
aerospike-server-community-4.2.0.5-el7/aerospike-server-community-4.2.0.5-1.el7.x86_64.rpm

(进入安装目录)
[root@localhost ~]# cd aerospike-server-community-4.2.0.5-el7/

(安装)
[root@localhost aerospike-server-community-4.2.0.5-el7]# ./asinstall 
Installing tools
rpm -Uvh aerospike-tools-3.15.3.8-1.el7.x86_64.rpm
准备中...                          ################################# [100%]
	软件包 aerospike-tools-3.15.3.8-1.el7.x86_64 已经安装
Installing server
rpm -Uvh aerospike-server-community-4.2.0.5-1.el7.x86_64.rpm
准备中...                          ################################# [100%]
	软件包 aerospike-server-community-4.2.0.5-1.el7.x86_64 已经安装

(启动服务)
[root@localhost aerospike-server-community-4.2.0.5-el7]# service aerospike start
/bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
/bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
Redirecting to /bin/systemctl start  aerospike.service

(查看服务状态)
[root@localhost aerospike-server-community-4.2.0.5-el7]# service aerospike status
/bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
/bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
Redirecting to /bin/systemctl status  aerospike.service
● aerospike.service - Aerospike Server
   Loaded: loaded (/usr/lib/systemd/system/aerospike.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/aerospike.service.d
           └─aerospike.conf
   Active: active (running) since 一 2018-07-23 16:25:21 CST; 17s ago
  Process: 7452 ExecStartPre=/bin/systemctl start aerospike_telemetry (code=exited, status=0/SUCCESS)
  Process: 7444 ExecStartPre=/usr/bin/asd-systemd-helper (code=exited, status=0/SUCCESS)
 Main PID: 7455 (asd)
   CGroup: /system.slice/aerospike.service
           └─7455 /usr/bin/asd --config-file /etc/aerospike/aerospike.conf --fgdaemon

7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:291)    in-progress: tsvc-q 0 info-q 0 nsup-delete-q 0 rw-hash 0 proxy-hash 0 tree-gc-q 0
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:313)    fds: proto (0,3,3) heartbeat (0,0,0) fabric (0,0,0)
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:322)    heartbeat-received: self 67 foreign 0
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:353)    fabric-bytes-per-second: bulk (0,0) ctrl (0,0) meta (0,0) rw (0,0)
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:408) {test} objects: all 0 master 0 prole 0 non-replica 0
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:469) {test} migrations: complete
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:488) {test} memory-usage: total-bytes 0 index-bytes 0 sindex-bytes 0 data-bytes 0 used-pct 0.00
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:408) {3gu} objects: all 0 master 0 prole 0 non-replica 0
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:469) {3gu} migrations: complete
7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:488) {3gu} memory-usage: total-bytes 0 index-bytes 0 sindex-bytes 0 data-bytes 0 used-pct 0.00

(客户端接入)
[root@localhost aerospike-server-community-4.2.0.5-el7]# aql 
Seed:         127.0.0.1
User:         None
Config File:  /etc/aerospike/astools.conf /root/.aerospike/astools.conf 
Aerospike Query Client
Version 3.15.3.8
C Client Version 4.3.12
Copyright 2012-2017 Aerospike. All rights reserved.
aql> show namespaces
+------------+
| namespaces |
+------------+
| "test"     |
| "myns"      |
+------------+
[127.0.0.1:3000] 2 rows in set (0.003 secs)

OK

(查看接入配置)
aql> get all
ECHO = false
VERBOSE = false
OUTPUT = TABLE
OUTPUT_TYPES = true
TIMEOUT = 3000
LUA_USERPATH = /opt/aerospike/usr/udf/lua
LUA_SYSPATH = /opt/aerospike/sys/udf/lua
USE_SMD = false
RECORD_TTL = 0
RECORD_PRINT_METADATA = false
REPLICA_ANY = false
KEY_SEND = false
DURABLE_DELETE = false
FAIL_ON_CLUSTER_CHANGE = true
SCAN_PRIORITY = AUTO
NO_BINS = false
LINEARIZE_READ = false

(执行插入操作)
aql> insert into myns(pk,id,name,host,port,info) values('key1','001','AAA','192.168.0.1','10001','设备一')
OK, 1 record affected.

(执行查询操作)
aql> select * from myns
+-------+-------+---------------+---------+-------------+
| id    | name  | host          | port    | info        |
+-------+-------+---------------+---------+-------------+
| "001" | "AAA" | "192.168.0.1" | "10001" | "设备一" 	|
+-------+-------+---------------+---------+-------------+
1 row in set (1.311 secs)

(执行删除操作)
aql> delete from myns where pk='key1'
OK, 1 record affected.

(执行查询操作)
aql> select * from myns
0 rows in set (1.269 secs)

OK

    Aerospike从安装到启动到操作上面都逐一演示了一遍,下一篇文章打算选择一个开发语言来实现远程连接和执行上述操作,为使用Aerospike的研发小伙伴抛砖引玉。

    前几天失联了,回来发现被预防针的新闻刷屏了,这群瘪犊子们该好好管管了,别让老百姓日子过得太糟心,哎~~~

相关文章
|
存储 NoSQL 关系型数据库
赶紧收藏起MongoDB面试题轻松面对BAT灵魂式的拷问(上)
MongoDB是基于分布式文件存储的数据库,由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案,且MongodDB是一个介于关系数据库与非关系数据库之间的产品,是非关系型数据库中功能最丰富,最像关系数据库。
1746 0
|
4月前
|
架构师 Linux Shell
Linux环境下要想事半功倍,少不了这4个技巧!
Linux环境下要想事半功倍,少不了这4个技巧!
|
4月前
|
测试技术 数据安全/隐私保护 网络虚拟化
干货 | 如何用python实现每天定时备份交换机配置文件? 真香~
干货 | 如何用python实现每天定时备份交换机配置文件? 真香~
|
7月前
|
数据库 数据安全/隐私保护
Greenplum【问题 03】6.13.0单机版重启实录(5次报错问题及解决的避坑指南+日志文件查看方法)
Greenplum【问题 03】6.13.0单机版重启实录(5次报错问题及解决的避坑指南+日志文件查看方法)
82 0
|
SQL JSON NoSQL
MongDB学习笔记(一) 初遇篇
MongDB学习笔记(一) 初遇篇
MongDB学习笔记(一) 初遇篇
|
存储 数据管理 Linux
计算机原理探险系列(四)-- 磁盘存储探秘
计算机原理探险系列(四)-- 磁盘存储探秘
310 0
|
SQL 存储 NoSQL
Mongodb数据库常用指令归纳整理(详解)
Mongodb数据库常用指令归纳整理(详解)
373 0
|
存储 监控 NoSQL
赶紧收藏起MongoDB面试题轻松面对BAT灵魂式的拷问(下)
MongoDB是基于分布式文件存储的数据库,由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案,且MongodDB是一个介于关系数据库与非关系数据库之间的产品,是非关系型数据库中功能最丰富,最像关系数据库。
270 0
|
运维 安全 Java
很重要但常被忽视的几个Linux指令--《我的linux初体验》
服务崩溃、CPU跑满、通信错误、服务卡死等等各种各样的常见问题,其实用几个常常被忽视的Linux系统管理指令就可以解决或定位问题。本文仅用于给新手抛砖引玉,会涉及top、ps、free、echo等。
204 0
很重要但常被忽视的几个Linux指令--《我的linux初体验》