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()
无法在没有主键的情况下执行。我对文件小组提起诉讼
关于第二次选择:
shard.space\u name:secondary\u select(index\u no\u或\u name,index\u key,opts)
。或者尝试更新到最新的碎片版本secondary\u select
允许使用索引名)冗余设置为2,但存储计数为奇数。最后一个将不使用
希望能有所帮助。我建议您使用vshard[1]模块,最好是碎片模块现在太过实验化。[1] 关于你的话题。你设置了碎片吗?如果是,你能显示代码吗?@VasiliySoshnikov,是我的主配置