您好,登錄后才能下訂單哦!
【
問題詳細(xì)
描述】
如何掛
載
目
錄
并指定手工
創(chuàng)
建的元數(shù)據(jù)集合,且集合
為
分區(qū)集合?
【解決方法】
1.
在手工
創(chuàng)
建了目
錄
和文件的元數(shù)據(jù)的分區(qū)集合后(假
設(shè)
目
錄
元數(shù)據(jù)集合
為
:
"sequoiafs.metadir_cl"
,文件元數(shù)據(jù)集合
為
:
"sequoiafs.metafile_cl"
,分區(qū)
鍵為
"_id"
),需要
創(chuàng)
建如下三個(gè)索引:
1
)在目
錄
元數(shù)據(jù)表中
創(chuàng)
建復(fù)合索引
"NameIndex"
:
db.sequoiafs.metadir_cl.createIndex( "NameIndex", { Name:1, Pid:1, _id:1 },{ Unique: true, Enforced :true } );
2
)在文件元數(shù)據(jù)表中
創(chuàng)
建復(fù)合索引
"NameIndex"
和
"LobOidIndex"
:
db.sequoiafs.metafile_cl.createIndex( "NameIndex", { Name:1, Pid:1, _id:1 },{ Unique: true, Enforced :true } );
db.sequoiafs.metafile_cl.createIndex( "LobOidIndex", { LobOid:1, _id:1 },{ Unique: true, Enforced :true } );
2.
在掛
載
目
錄時(shí)
使用
-d
和
-f
指定自己手工
創(chuàng)
建的元數(shù)據(jù)集合,不要指定
--autocreate
默
認(rèn)
生成元數(shù)據(jù)集合即可。
$sequoiafs /opt/sequoiadb/mountpoint -i localhost:11810 -l foo.bar -c /opt/sequoiafs/conf/foo_bar/001/ --diagpath /opt/sequoiafs/log/foo_bar/001/ -o big_writes -o auto_unmount -o max_write=131072 -o max_read=131072 -d sequoiafs.metadir_cl -f sequoiafs.metafile_cl
詳情參考:
掛
載
目
錄
:
http://doc.sequoiadb.com/cn/sequoiadb-cat_id-1525956060-edition_id-302
【
備
注】
創(chuàng)建索引時(shí)需要注意復(fù)合索引字段中的順序問題,需要把分區(qū)鍵字段放在最后,如將分區(qū)鍵字段放在最前面創(chuàng)建了索引,在后續(xù)查找目錄時(shí)可能會(huì)因?yàn)闊o法使用此索引而導(dǎo)致寫入目錄速度慢等問題。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。