Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nosql 调用塔兰托碎片_Nosql_Sharding_Tarantool - Fatal编程技术网

Nosql 调用塔兰托碎片

Nosql 调用塔兰托碎片,nosql,sharding,tarantool,Nosql,Sharding,Tarantool,我有塔兰托尔和碎片模块,空间配置如下: local h_box = box.schema.create_space('hotbox') h_box:create_index('one', {type = 'hash', parts = {1, 'string'}}) h_box:create_index('two', {type = 'tree', parts = {2, 'string'}}) h_box:create_index('three', {type = 'tree', parts

我有塔兰托尔和碎片模块,空间配置如下:

local h_box = box.schema.create_space('hotbox')
h_box:create_index('one', {type = 'hash', parts = {1, 'string'}})
h_box:create_index('two', {type = 'tree', parts = {2, 'string'}})
h_box:create_index('three', {type = 'tree', parts = {3, 'unsigned'}})
h_box:create_index('four', {type = 'tree', parts = {4, 'boolean'}})
h_box:create_index('five', {type = 'tree', parts = {5, 'unsigned'}})
h_box:create_index('six', {type = 'tree', parts = {6, 'boolean'}})
说:

T:没有主键的select{}请求将搜索所有碎片

但当我试着调用这个时,我看到了错误

shard.h_box:select{}
---
- error: 'builtin/digest.lua:138: Usage digest.crc32(string)'
...
另外,当我调用
shard.h_box:secondary_select{2,{limit=10},'foo'}
Tarantool时抛出了一个错误:

---
- error: '/usr/share/tarantool/shard/init.lua:1015: attempt to index field ''conn''
    (a nil value)'
...
如何从所有碎片中获取所有数据并将选择调用到辅助索引?

shard.T:select()
无法在没有主键的情况下执行。我对文件小组提起诉讼

关于第二次选择:

  • 似乎与至少一个存储的连接已断开。值得一看的是front tarantool的日志文件(其中使用了shard模块)

  • 为了以防万一,需要检查您是否可以使用net.box连接到存储,并使用指定用户从空间中进行选择

  • 使用括号而不是大括号(函数接受多个参数,而不是单个表)

  • 您使用的是切分模块的e75d2c7a版本,但尝试使用更新版本的API。e75d2c7a的正确请求是,比如说,
    shard.space\u name:secondary\u select(index\u no\u或\u name,index\u key,opts)
    。或者尝试更新到最新的碎片版本

  • 索引是从零开始计数的,因此您尝试使用带有“string”键的“unsigned”索引“three”(顺便说一句,
    secondary\u select
    允许使用索引名)

  • 冗余设置为2,但存储计数为奇数。最后一个将不使用


  • 希望能有所帮助。

    我建议您使用vshard[1]模块,最好是碎片模块现在太过实验化。[1] 关于你的话题。你设置了碎片吗?如果是,你能显示代码吗?@VasiliySoshnikov,是我的主配置