ITPub博客

首页 > 数据库 > 数据库开发技术 > 【巨杉数据库Sequoiadb】【咨询】【SequoiaFS】

【巨杉数据库Sequoiadb】【咨询】【SequoiaFS】

原创 数据库开发技术 作者:CherylRAnthony 时间:2019-07-02 10:17:17 0 删除 编辑


【 问题详细 描述】
如何挂 载 目 录 并指定手工 创 建的元数据集合,且集合 为 分区集合?  

【解决方法】
1.
在手工 创 建了目 录 和文件的元数据的分区集合后(假 设 目 录 元数据集合 为 : "sequoiafs.metadir_cl" ,文件元数据集合 为 : "sequoiafs.metafile_cl" ,分区 键为 "_id" ),需要 创 建如下三个索引:
  1
)在目 录 元数据表中 创 建复合索引 "NameIndex" :
  db.sequoiafs.metadir_cl.createIndex( "NameIndex", { Name:1, Pid:1, _id:1 },{ Unique: true, Enforced :true } ); 

  2 )在文件元数据表中 创 建复合索引 "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.
在挂 载 目 录时 使用 -d 和 -f 指定自己手工 创 建的元数据集合,不要指定 --autocreate 默 认 生成元数据集合即可。
  $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
【 备 注】
创建索引时需要注意复合索引字段中的顺序问题,需要把分区键字段放在最后,如将分区键字段放在最前面创建了索引,在后续查找目录时可能会因为无法使用此索引而导致写入目录速度慢等问题。  

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69935160/viewspace-2649272/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-06-25

  • 博文量
    71
  • 访问量
    55600