@1234567890
2018-03-23T13:05:35.000000Z
字数 1873
阅读 1493
Aerospike
//server
wget http://www.aerospike.com/artifacts/aerospike-server-community/3.6.2/aerospike-server-community-3.6.2.tar.gz
//tools
wget -O aerospike-tools.tgz 'http://www.aerospike.com/artifacts/aerospike-server-community/3.6.2/aerospike-server-community-3.6.2-el6.tgz'
//AMC 控制台
wget https://www.aerospike.com/artifacts/aerospike-amc-community/3.6.2/aerospike-amc-community-3.6.2.tar.gz
yum install gcc
yum install autoconf libtool
yum install openssl-devel openssl-static
yum install lua-devel lua-static lua
tar -zxvf aerospike-server-community-3.6.2.tar.gz && cd aerospike-server
bin/aerospike init
tar -zxvf aerospike-tools.tgz
cd aerospike-server-community-3.6.2-el6/
rpm -Uvh aerospike-tools-3.6.2.2-1.el6.x86_64.rpm
tar -xvf aerospike-amc-community-3.6.2.tar.gz && cd aerospike-amc-community-3.6.2
./install
#AeroSpike服务启动
bin/aerospike start
#AeroSpike服务重启
bin/aerospike restart
#AeroSpike服务停止
bin/aerospike stop
#启动amc
/etc/init.d/amc start
#停止amc
/etc/init.d/amc stop
#重启amc
/etc/init.d/amc restart
#查看amc状态
/etc/init.d/amc status
#查看amc启动报错日志
/var/log/amc/error.log
#查看server日志
/var/log/aerospike/aerospike.log
http://host:8081
<dependencies>
<dependency>
<groupId>com.aerospike</groupId>
<artifactId>aerospike-client</artifactId>
<version>3.6.2</version>
</dependency>
</dependencies>
其中multicast表示在同一网段中广播,所有使用相同address和port的Aerospike会自动组合成集群。但在Aerospike集群中,如果namespace名称相同,配置不同则会报错。解决方法可以把IP地址换成其他的,如139.1.99.222。
在Monitor下查看Aerospike集群信息,如节点个数、内存使用情况等:
info
在asadm下查看集群节点情况
i net
进入aql命令模式下就可以使用如图SQL语句中DDL和DML语句进行创建命名空间。这里的命名空间相当于数据库中的表。
show namespaces;
select * from test
insert into test(pk,id,name,age) values('key1','101','AAA','21');
delete from test where pk='key2'
//备份
-d为导出需要保存的文件
-n为需要导出的namespace
高优先级 -f 3,
如果集群失败了(即你希望数据是正确的),终止备份 -c。
提供详细的信息到控制台-v
asbackup -h 10.0.0.9 -p 3000 -d backup_01_23_2013 -n test -f3 -c -v
//还原
asrestore -h 127.0.0.1 -p 3000 -d /home/aerospike/backup_10_23_2011