Last active
September 10, 2018 08:36
-
-
Save fpopic/233bc5ca50fcd2abfab3ec8c51da6e65 to your computer and use it in GitHub Desktop.
Fast Aerospike setup to start debugging on localhost (aerospike server, asinfo, aql, acm)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SETUP AEROSPIKE NAMESPACE (to use hdd) | |
sudo gedit /etc/aerospike/aerospike.conf | |
``` | |
namespace test-namespace { | |
replication-factor 2 # Each element has one copy | |
memory-size 1G # Maximum memory allocation for primary and secondary indexes. | |
default-ttl 30d # Bin expiration | |
# storage-engine memory # a) Configure the storage-engine to use in-memory only | |
storage-engine device { # b) Configure the storage-engine to use persistence hdd | |
file /opt/aerospike/data/test-namespace.dat | |
filesize 16G | |
} | |
# data-in-memory true # b*) Indicates that all data should also be in memory. | |
} | |
``` | |
# START SERVICE | |
sudo service aerospike start; sudo tail -f /var/log/aerospike/aerospike.log | grep cake | |
# UI TOOL | |
sudo /etc/init.d/amc start | |
# GO TO | |
http://localhost:8081 | |
# CMD TOOL | |
aql -h localhost | |
# TO SEE RECORD METADATA {ttl, generation, digest of the PK} | |
aql> SET RECORD_PRINT_METADATA true | |
# WRITE RECORD (1 BIN) | |
aql> insert into test-namespace.test-set(PK, "test-bin") values ("ABC", 123) | |
# READ RECORD (1 BIN) | |
aql> select test-bin from test-namespace.test-set where PK = "ABC" | |
# DELETE RECORD (1 BIN) | |
aql> delete test-bin from test-namespace.test-set where PK = "ABC" | |
# TRUNCATE WHOLE BIN | |
asinfo -h localhost -v "truncate:namespace=test-namespace;set=test-set;bin=test-bin" --no-config-file | |
# WRITE MORE BINS | |
aql> insert into test-namespace.test-set(PK, "test-bin", "test-bin2") values ("ABC", 123, 456) | |
#INCREASE CACHE (have to repeat for all nodes) | |
fpopic@dell ~> asinfo -v localhost 'set-config:context=namespace;id=default;max-write-cache=128M' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment