我想将数据从MySQL(或mongodb)迁移到Aerospike,任何人都知道是否有任何工具可以做到这一点?
假设我在bin1和bin2上创建了二级索引。
我使用Java客户端查询为:
Statement stmt = new Statement();
stmt.setNamespace("test");
stmt.setSetName("myDemoSet");
stmt.setBinNames("bin1", "bin2", "bin3", "bin4", "bin5");
stmt.setFilters(Filter.equal("bin1", Value.get("sherlock")));
RecordSet rs = null;
try {
rs = client.query(null, stmt);
} catch (AerospikeException e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
这有效。但是如果我添加另一个过滤器:
stmt.setFilters(Filter.equal("bin1", Value.get("sherlock")), Filter.equal("bin2", Value.get("stackoverflow")));
Run Code Online (Sandbox Code Playgroud)
它似乎对输出没有任何影响。
那么 Aerospike Java 客户端当前是否支持多个过滤器?
如果是这样,如何?
有没有办法从命名空间(Aerospike)从aql或CLI中删除一个集合?
我的套装还包含Ldts.
请建议我从LDT删除整个Set的方法
我正在使用Aerospike 3.40.没有出现具有浮点值的Bin.我正在使用python客户端.请帮忙.
我已经创建了一个聚合函数,可以在ASP中使用的aerospike中运行:
AGGREGATE filter2.check_teamId('123', 0, 1456499994597) ON analytics.tracking
WHERE teamId = '123'
Run Code Online (Sandbox Code Playgroud)
这会返回结果.然后我尝试在NodeJS中使用相同的UDF:
var statement = {
aggregationUDF: {module: 'filter2', funcname: 'check_teamId',
arg:['123', 0, 1456499994597]}
};
var query = client.query('analytics', 'tracking', statement);
var stream = query.execute();
Run Code Online (Sandbox Code Playgroud)
结果是一个看似无效的错误:
{ code: 100,
message: 'UDF: Execution Error 1',
func: 'as_query_aggregate',
file: 'src/main/aerospike/aerospike_query.c',
line: 903 }
Run Code Online (Sandbox Code Playgroud)
服务器记录状态:
2016年2月28日22:33:58 GMT:INFO(扫描):( scan.c :: 933)开始聚合扫描作业1201452721893048027 {analytics:tracking} priority 2
2016年2月28日22:33:58 GMT:INFO(扫描):( scan.c :: 1026)完成聚合扫描作业1201452721893048027(0)
有没有人有任何关于让UDF与NodeJS一起使用的技巧?或者任何想法如何诊断错误?
我在配置中设置了用户UDF位置,这不会影响结果.
更新:这是lua代码:
local function map_profile(record)
return map {interaction=record.interaction,
teamId=record.teamId, datetime=record.datetime,
timestamp=record.timestamp, version=record.version,
interactions=record.interactions}
end …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用client.get()在Aerospike node.js客户端中检索主键.我已经使用client.put()通过将策略更改为Aerospike.policy.key.SEND来插入记录,如此处和此处所述.
现在我想要检索记录和主键.我尝试像Aerospike文档中提到的那样做,但似乎没有用.
var key = aerospike.key(aerospikeDBParams.defaultNamespace,aerospikeDBParams.defaultSet,count);
var readpolicy = {
key: aerospike.policy.key.SEND
}
client.get(key, readpolicy, function(err, rec, meta){}
Run Code Online (Sandbox Code Playgroud)
我得到所有的箱子,但不是主键.我在这里错过了什么吗?
提前致谢.
我有一个场景,对于每个请求,我要批量获取至少1000个密钥.
目前我每分钟收到2000个请求,预计会有所增加.
另外,我已经阅读了批量获取的aerospike内部同时/顺序向服务器发出个别请求.
我使用aerospike作为集群(在SSD上运行).因此,在lua中编写UDF(用户定义的方法)来进行批量请求,并在服务器级别聚合结果而不是从客户端多次点击
请建议,如果默认批量获取aerospike将是有效的,或者我要做其他事情.
我在异步模式下执行Lua函数,并使用NIOEventLoops。当我尝试获取下一个事件循环并执行Lua函数时,我有一些异常:
com.aerospike.client.AerospikeException$Connection: Error -7 from BB967EF43270008 127.0.0.1 3000: Node BB967EF43270008 127.0.0.1 3000 event loop 5 max connections 100 would be exceeded.
at com.aerospike.client.cluster.Node.getAsyncConnection(Node.java:657) ~[aerospike-client-4.2.2.jar:?]
at com.aerospike.client.async.NioCommand.executeCommand(NioCommand.java:184) [aerospike-client-4.2.2.jar:?]
at com.aerospike.client.async.NioCommand.run(NioCommand.java:146) [aerospike-client-4.2.2.jar:?]
at com.aerospike.client.async.NioEventLoop.registerCommands(NioEventLoop.java:211) [aerospike-client-4.2.2.jar:?]
at com.aerospike.client.async.NioEventLoop.runCommands(NioEventLoop.java:173) [aerospike-client-4.2.2.jar:?]
at com.aerospike.client.async.NioEventLoop.run(NioEventLoop.java:156) [aerospike-client-4.2.2.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Run Code Online (Sandbox Code Playgroud)
那是我获取下一个事件循环的方法:
private synchronized EventLoop getNextEventLoop() {
EventLoop next;
do {
next = eventLoops.next();
} while (next.getProcessSize() >= maxConnectionsPerEventLoop);
return next;
}
Run Code Online (Sandbox Code Playgroud)
这就是我执行Lua函数的方式:
as.execute(getNextEventLoop()
, new ExecuteListener() {
@Override
public void onSuccess(Key key, Object obj) {
...
}
@Override …Run Code Online (Sandbox Code Playgroud) 在进行AQL选择时如何包含PK?
例:
从test.users中选择SELECT*
返回:
FirstName,LastName等
我真正想知道的是PK或密钥,所以我可以删除一行.如何在SELECT AQL语句中包含PK.
我想要有一个 aerospike-server 节点的多个实例,以便实现负载平衡,因为我向服务器发出了如此多的请求,我收到一条错误消息“错误代码 22:此时不允许操作”。
我假设拥有更多 aerospike 服务器节点,我可以减轻一个节点上的负载,从而完成更多操作?我只是不知道从哪里开始。
我需要这些节点全部位于一台主机本地。任何帮助都会很棒。
我的网络知识不是很好所以请原谅我
我的 Docker 文件:
FROM aerospike/aerospike-server
MAINTAINER "xxxx"
ADD aerospike.conf /etc/aerospike/
Run Code Online (Sandbox Code Playgroud)
docker-compose.yml
version: "3"
services:
aerospike-server:
image: amc
container_name: aerospike-server
ports:
- "3000:3000"
- "3001:3001"
- "3002:3002"
- "3003:3003"
aerospike-amc:
image: mrbar42/aerospike-amc
container_name: aerospike-amc
ports:
- "8081:8081"
Run Code Online (Sandbox Code Playgroud)
aerospike.conf 网络节
network {
service {
address any
port 3000
# Uncomment the following to set the `access-address` parameter to the
# IP address of the Docker host. This will the allow the server to …Run Code Online (Sandbox Code Playgroud)