下载和启动实例
1、下载和启动Cassandra,生产环境会使用HBase作为Storage backend,但在开发环境部署HBase比较复杂
http://cassandra.apache.org/download/ 下载3.11.2
解压后 sh bin/cassandra -f, 默认绑定IP:127.0.0.1 PORT:9042
启动thrift,sh ./bin/nodetool enablethrift 默认绑定IP:127.0.0.1 PORT:9160
2、下载和启动ES
JanusGraph的发布包自带ES,sh /elasticsearch/bin/elasticsearch,默认绑定IP:127.0.0.1 PORT:9200
也可以使用独立的ES,但建议5.0以上版本。
PS:centos6下启动es5.0以上版本遇到的问题及解决方法
[1]: max file descriptors [10240] for elasticsearch process is too low, increase to at least [65536]
ulimit -n 65536
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改/etc/sysctl.conf配置文件,
cat /etc/sysctl.conf | grep vm.max_map_count
vm.max_map_count=262144
如果不存在则添加
echo "vm.max_map_count=262144" >>/etc/sysctl.conf
sysctl -p
[3]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
3、下载和安装JanusGraph
https://github.com/JanusGraph/janusgraph/releases/ 下载janusgraph-0.2.0-hadoop2.zip
编辑janusgraph-cassandra-es.properties,将es和cassandra的ip指定为步骤1,2中的IP
sh bin/gremlin.sh
graph = JanusGraphFactory.open("conf/janusgraph-cassandra-es.properties"),如提示standardjanusgraph[cassandrathrift:[127.0.0.1]],则配置成功
4、启动gremlin server
修改conf/gremlin-server/gremlin-server.yaml,确定properties文中的cassandra和es的ip正确
sh bin/gremlin-server.sh
使用gremlin.sh测试是否可以连上服务,:remote connect tinkerpop.server conf/remote.yaml
组建集群及多图
1、GremlinServer多图配置
服务器gremlin-server.yaml中可以设置多个graph的properties文件
graphs: {
graph: conf/gremlin-server/janusgraph-cassandra-es-server.properties,
pressureGraph: conf/gremlin-server/janusgraph-pressure.properties
}
janusgraph-pressure.properties中需要声明keyspace和index-name,否则会按照默认名字janusgraph建立存储和索引。多个properties指向同一个图。
storage.hostname=10.*.*.*
storage.cassandra.keyspace=pressure
index.pressure.hostname=10.*.*.*:9200
index.pressure.index-name=pressure
PS:可使用cqlsh describe keyspaces , curl -XGET 10.*.*.*:9200/_cat/indices查看存储及索引情况
scripts/empty-sample.groovy,增加traversalSource,对应不同的graph
globals << [g : graph.traversal(), p : pressureGraph.traversal()]
2、集群配置配置
客户端remote-objects.yaml,指定多实例IP,并实现负载均衡
hosts: [10.*.*.*,10.*.*.*]
jgex-remote.properties指定服务器上的traversalSource
gremlin.remote.driver.sourceName=p
索引优化及检查
1、composite索引,基于storage backend实现,仅支持相等(完全匹配),速度快
mgmt.buildIndex('copIndustryCode', Vertex.class).addKey(industryCode).buildCompositeIndex()
2、mixed索引,基于index backend实现,支持如ES的特性,速度慢于composite索引。最后一个参数为index-name。
mgmt.buildIndex('mixCompanyCode', Vertex.class).addKey(companyCode).buildMixedIndex("pressure")
3、可以使用gramlin.sh进行检索,如提示Query requires iterating over all vertices [(companyCode = 10)]. For better performance, use indexes,则表示未使用索引。
相反则代表使用了索引
gremlin> g.V().has("companyCode", textContains("1000")).valueMap()
==>[companyCode:[1000],companyName:[机构1000]]
gremlin> g.V().has("companyCode", "10").valueMap()
19:34:32 WARN org.janusgraph.graphdb.transaction.StandardJanusGraphTx - Query requires iterating over all vertices [(companyCode = 10)]. For better performance, use indexes
4.1 全剧配置
schema.default=none // 关闭自动创建vertex label,edge label, property
# Required to enable Metrics in JanusGraph
metrics.enabled = true
force-index
4.2 storage backend
4.3 index backend
参考资料:
http://docs.janusgraph.org/latest/getting-started.html 官网
https://groups.google.com/forum/#!topic/gremlin-users/yWqS6gzmoYY 配置多graph, traversalSource
分享到:
相关推荐
JanusGraph Docker映像 该存储库包含用于官方 Docker映像的构建脚本和配置文件,这些脚本和配置文件已发布在。 注意:即使以下示例和Docker Compose配置文件( *.yml )中的*.yml使用latest映像,在生产环境中运行...
OpenLdap搭建配置日志索引,自己开发过程中踩的坑记录下来的。包好使。
在使用JanusGraph过程中,微众银行发现JanusGraph本身依赖组件较多,数据存储在HBase中,索引存储在Eleasticsearch中,而因为受分布式高可用和两地三中心架构规范要求,要搭建一套完整的图数据库系统涉及技术点较多...
采用三台CentOS7.2部署Elasticsearch集群,部署Elasticsearch集群就不得不提索引分片,以下是索引分片的简单介绍。
搜索引擎solr环境配置、分词及索引操作
内置对和支持,使您可以自动管理存储在cassandra中的同步elasticsearch和janusgraph索引。 Express-cassandra使您的nodejs应用程序能够管理高度可用的分布式数据存储,该存储能够处理具有由cassandra,elastic...
matlab 中灰度图转换成索引图的一些语句。
SolrCloud是基于Solr和Zookeeper的分布式搜索方案,它的主要思想是使用Zookeeper作为集群的配置信息中心。 它有几个特色功能: 1)集中式的配置信息 2)自动容错 3)近实时搜索 4)查询时自动负载均衡 zookeeper是...
- 搭建配置集服务器(Mongod) - 搭建分片集服务器(Mongod) - 搭建路由节点服务器(Mongos) - 添加分片集到集群 - 创建数据库cqust - 在数据库cqust中创建students集合 - 自行选择片键,在cqust.students集合上...
傻瓜式部署,一看就懂,一学就会。对公司项目搜索重构,lucene升级的最好选择。 后需要相关技术的可以私信我,相关API,技术问题我这都有答案
配置本地阿里云maven索引,这样就不用每次都去阿里云官方找包,再复制配置地址了。一步步教学,让java开发者,在使用阿里云maven仓库时,也能够使用搜索jar包索引。
传奇地图索引修改,个人在用的,目前市面最好用的地图索引修改,不出错,做地图的大佬们,这个不能错过,推荐
传统数据库在数据大小比较小,索引大小适合内存,数据缓存命中率足够高的情形下能正常提供服务。但残酷的是,这种理想情形最终会随着业务的增长走到尽头,查询会变得越来越慢。你可能通过增加更多的内存,订购更快的...
Solr集群搭建:Solr提供的分布式搜索方案,当你需要大规模,容错,分布式索引和检索能力时使用 SolrCloud。当一个系统的索引数据量少的时候是不需要使用SolrCloud的,当索引量很大,搜索请求并发很高,这时需要使用...
以索引相同的顺序对磁盘上的数据进行排序可以加速数据访问速度。
matlab代码,用于图像处理放向研究。把图像变成变灰度图像,索引图像或二值图像。
Elasticsearch 6.0.1(JanusGraph的索引后端) Python Flask服务器 Vue.js d3.js v4强制布局 演示版 从任何节点(例如,通过Amanda Walker )开始探索图 安装 先决条件 Docker CE> = 1.13.0 码头工人组成> = ...
Elasticsearch是一个全文检索服务器,全文检索是一种非结构化数据的搜索方式 ,结构化数据一般存入数据库,使用sql语句即可快速查询。但由于非结构化数据的数据量大且格式不固定,... 索引分为正排索引和倒排索引。
5 MongoDB索引查询与建立.mp4 6 MongoDB数据库的监控命令.mp4 7 MongoDB副本集的搭建.mp4 8 MongoDB副本集故障自动切换.mp4 9 MongoDB副本集各实例的优先级设置.mp4 10 MongoDB副本集的伸缩.mp4 11 MongoDB数据的...