绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
Aerospike入坑导读
2022-06-21 15:37:28

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

AerospikeMySQL
namespacedb
settable
bincolumn
keyprimary key
recordrow

    下载地址: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以上;

  1. (解压缩)
  2. [root@localhost ~]# tar xvf aerospike-server-community-4.2.0.5-el7.tgz
  3. aerospike-server-community-4.2.0.5-el7/
  4. aerospike-server-community-4.2.0.5-el7/SHA256SUMS
  5. aerospike-server-community-4.2.0.5-el7/aerospike-tools-3.15.3.8-1.el7.x86_64.rpm
  6. aerospike-server-community-4.2.0.5-el7/LICENSE
  7. aerospike-server-community-4.2.0.5-el7/asinstall
  8. aerospike-server-community-4.2.0.5-el7/aerospike-server-community-4.2.0.5-1.el7.x86_64.rpm
  9. (进入安装目录)
  10. [root@localhost ~]# cd aerospike-server-community-4.2.0.5-el7/
  11. (安装)
  12. [root@localhost aerospike-server-community-4.2.0.5-el7]# ./asinstall
  13. Installing tools
  14. rpm -Uvh aerospike-tools-3.15.3.8-1.el7.x86_64.rpm
  15. 准备中... ################################# []
  16. 软件包 aerospike-tools-3.15.3.8-1.el7.x86_64 已经安装
  17. Installing server
  18. rpm -Uvh aerospike-server-community-4.2.0.5-1.el7.x86_64.rpm
  19. 准备中... ################################# []
  20. 软件包 aerospike-server-community-4.2.0.5-1.el7.x86_64 已经安装
  21. (启动服务)
  22. [root@localhost aerospike-server-community-4.2.0.5-el7]# service aerospike start
  23. /bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
  24. /bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
  25. Redirecting to /bin/systemctl start aerospike.service
  26. (查看服务状态)
  27. [root@localhost aerospike-server-community-4.2.0.5-el7]# service aerospike status
  28. /bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
  29. /bin/mountpoint: /usr/local/lib/libuuid.so.1: no version information available (required by /lib64/libblkid.so.1)
  30. Redirecting to /bin/systemctl status aerospike.service
  31. ● aerospike.service - Aerospike Server
  32. Loaded: loaded (/usr/lib/systemd/system/aerospike.service; disabled; vendor preset: disabled)
  33. Drop-In: /etc/systemd/system/aerospike.service.d
  34. └─aerospike.conf
  35. Active: active (running) since 一 2018-07-23 16:25:21 CST; 17s ago
  36. Process: 7452 ExecStartPre=/bin/systemctl start aerospike_telemetry (code=exited, status=0/SUCCESS)
  37. Process: 7444 ExecStartPre=/usr/bin/asd-systemd-helper (code=exited, status=0/SUCCESS)
  38. Main PID: 7455 (asd)
  39. CGroup: /system.slice/aerospike.service
  40. └─7455 /usr/bin/asd --config-file /etc/aerospike/aerospike.conf --fgdaemon
  41. 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
  42. 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)
  43. 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
  44. 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)
  45. 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
  46. 7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:469) {test} migrations: complete
  47. 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>
    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
  48. 7月 23 16:25:31 localhost.localdomain asd[7455]: Jul 23 2018 08:25:31 GMT: INFO (info): (ticker.c:469) {3gu} migrations: complete
  49. 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>
  50. (客户端接入)
  51. [root@localhost aerospike-server-community-4.2.0.5-el7]# aql
  52. Seed: 127.0.0.1
  53. User: None
  54. Config File: /etc/aerospike/astools.conf /root/.aerospike/astools.conf
  55. Aerospike Query Client
  56. Version 3.15.3.8
  57. C Client Version 4.3.12
  58. Copyright 2012-2017 Aerospike. All rights reserved.
  59. aql> show namespaces
  60. +------------+
  61. | namespaces |
  62. +------------+
  63. | "test" |
  64. | "myns" |
  65. +------------+
  66. [127.0.0.1:3000] 2 rows in set (0.003 secs)
  67. OK
  68. (查看接入配置)
  69. aql> get all
  70. ECHO = false
  71. VERBOSE = false
  72. OUTPUT = TABLE
  73. OUTPUT_* = true
  74. TIMEOUT = 3000
  75. LUA_USERPATH = /opt/aerospike/usr/udf/lua
  76. LUA_SYSPATH = /opt/aerospike/sys/udf/lua
  77. USE_SMD = false
  78. RECORD_TTL = 0
  79. RECORD_PRINT_METADATA = false
  80. REPLICA_ANY = false
  81. KEY_SEND = false
  82. DURABLE_DELETE = false
  83. FAIL_ON_CLUSTER_CHANGE = true
  84. SCAN_PRIORITY = AUTO
  85. NO_BINS = false
  86. LINEARIZE_READ = false
  87. (执行插入操作)
  88. aql> insert into myns(pk,id,name,host,port,info) values('key1','001','AAA','192.168.0.1','10001','设备一')
  89. OK, 1 record affected.
  90. (执行查询操作)
  91. aql> select * from myns
  92. +-------+-------+---------------+---------+-------------+
  93. | id | name | host | port | info |
  94. +-------+-------+---------------+---------+-------------+
  95. | "001" | "AAA" | "192.168.0.1" | "10001" | "设备一" |
  96. +-------+-------+---------------+---------+-------------+
  97. 1 row in set (1.311 secs)
  98. (执行删除操作)
  99. aql> delete from myns where pk='key1'
  100. OK, 1 record affected.
  101. (执行查询操作)
  102. aql> select * from myns
  103. 0 rows in set (1.269 secs)
  104. OK
wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

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

分享好友

分享这个小栈给你的朋友们,一起进步吧。

Aerospike
创建时间:2022-04-14 10:06:31
Aerospike
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

技术专家

查看更多
  • LCR_
    专家
戳我,来吐槽~