溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

【巨杉數(shù)據(jù)庫(kù)Sequoiadb】【咨詢】【SequoiaFS】

發(fā)布時(shí)間:2020-08-10 18:57:04 來源:ITPUB博客 閱讀:131 作者:CherylRAnthony 欄目:數(shù)據(jù)庫(kù)


問題詳細(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)致寫入目錄速度慢等問題。  

向AI問一下細(xì)節(jié)

免責(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)容。

AI