Titan Graph DataBase 研究 (一)----环境搭建
from:http://blog.csdn.net/q2365921/article/details/54616249
[-]
- 弹性和线性可伸缩性的增长数据和用户群
- 数据分布和复制和容错性能
- 多数据中心的高可用性和热备份
- 支持 ACID事务和 最终一致性
- 支持各种 存储后端
- 支持全球 图表数据分析 报告和ETL通过集成与大数据平台
- 支持地理数值范围并通过全文搜索
- Titan本身集成 TinkerPop 图堆栈
- 开源与自由 Apache 2 许可证
- 解压titanzip并且校验gremlin
- 下面的示例将打开一个Titan图实例并且载入众神关系数据集
- 问题1
- 问题2
- 问题3
- 问题4
最近有个与腾讯朋友里二度人脉相关的需求,发觉Titan貌似可以解决这种人际关系相关的数据存储。
反正将近年末,手头也没有什么工作不如研究研究,以下为Titan的一些特性
弹性和线性可伸缩性的增长数据和用户群。
数据分布和复制和容错性能。
多数据中心的高可用性和热备份。
支持 ACID事务和 最终一致性 。
支持各种 存储后端 :
- Apache Cassandra
- Apache HBase
- Oracle BerkeleyDB
支持全球 图表数据分析 、报告和ETL通过集成与大数据平台:
- Apache Spark
- Apache Giraph
- Apache Hadoop
支持地理,数值范围,并通过:全文搜索
- ElasticSearch
- Solr
- Lucene
Titan本身集成 TinkerPop 图堆栈:
- Gremlin图查询语言
- Gremlin图服务器
- Gremlin应用程序
开源与自由 Apache 2 许可证。
话不多说,开始进行环境搭建。
本文编写时Titan的最新版本更新到1.0.0。
如果有对Titan还不是很明白的请查看Titan官网
http://titan.thinkaurelius.com/
我认为不管如何学习一门新技术都应该先去了解它的安装,下载链接如下
https://github.com/thinkaurelius/titan/wiki/Downloads
我下载的是titan-1.0.0-hadoop2.zip,这个zip包。查看官网Titan最低要求为jdk1.8,如不是1.8的jdk则去下载一个。
在安装开始说明一下环境配置
OS:Centos6.4
jdk:1.8.0_111
storage:hbase
index.search:solr5.3.1
下面是安装及配置过程
1. 解压titan.zip并且校验gremlin
unzip titan-1.0.0-hadoop2.zip
cd titan-1.0.0-hadoop2/lib
wget http://search.maven.org/remotecontent?filepath=com/thinkaurelius/titan/titan-hadoop/1.0.0/titan-hadoop-1.0.0.jar
- 1
- 2
- 3
如果使用hadoop2的安装包需要引入titan-hadoop-1.0.0.jar否则报如下异常
Invalid import definition: 'com.thinkaurelius.titan.hadoop.MapReduceIndexManagement'; reason: startup failed:
script14719348643282042298222.groovy: 1: unable to resolve class com.thinkaurelius.titan.hadoop.MapReduceIndexManagement@ line 1, column 1.import com.thinkaurelius.titan.hadoop.MapReduceIndexManagement^1 error
- 1
- 2
- 3
- 4
- 5
- 6
- 7
启动gremlin
cd titan-1.0.0-hadoop2/bin
./gremlin.sh
#启动gremlin shell 本文作者也不了解gremlin如有兴趣的可自行百度,把他当做一个模拟shell就好了,可以执行一些Titan命令,创建一些图实例。
gremlin> 100-10
==>90
gremlin> "Titan:" + " The Rise of Big Graph Data"
==>Titan: The Rise of Big Graph Data
gremlin> [name:'aurelius', vocation:['philosopher', 'emperor']]
==>name=aurelius
==>vocation=[philosopher, emperor]
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
2. 下面的示例将打开一个Titan图实例并且载入众神关系数据集
Titanfactory提供了一组静态开放的方法,其中每个需要配置的参数并返回一个图实例,由于官网上提供的实例是以BerkeleyDB 为数据后端,以 Elasticsearch为索引后端,但笔者并没有这两种环境,恰好Titan支持Hbase数据后端与Solr索引后端的配置方式,那么就以这两种组件做为后端进行配置,修改$TITAN_HOME/conf/titan-hbase-solr.properties文件如下,由于配置文件中注释过多,只把主要配置贴了出来
storage.backend=hbasestorage.hostname=hadoop1,hadoop2,hadoop3,hadoop4,hadoop5index.search.backend=solrindex.search.solr.mode=cloudindex.search.solr.configset=titanindex.search.solr.zookeeper-url=solr1:2181,solr2:2181,solr3:2181,solr4:2181,solr5:2181
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
Titan所有支持的配置请参考下文
http://s3.thinkaurelius.com/docs/titan/1.0.0/titan-config-ref.html
Storage BackEnds的安装及配置请参考下文
http://s3.thinkaurelius.com/docs/titan/1.0.0/storage-backends.html
配置好数据端后则开始导入众神关系数据集
gremlin> graph = TitanFactory.open('../conf/titan-hbase-solr.properties')
==>standardtitangraph[hbase:[hadoop1, hadoop2, hadoop3, hadoop4, hadoop5]]
#在执行下面语句之前需要以$TITAN_HOME/conf/solr文件,建立solrCollection,并且在titan-hbase-solr.properties中添加index.search.solr.configset=titanconfigset配置
gremlin> GraphOfTheGodsFactory.load(graph)
==>null
gremlin> g = graph.traversal()
==>graphtraversalsource[standardtitangraph[berkeleyje:../db/berkeley], standard]
- 1
- 2
- 3
- 4
- 5
- 6
- 7
问题1
在执行过程中报出如下错误
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:623)... 59 more
Caused by: java.lang.UnsupportedOperationException: Not implemented by the DistributedFileSystem FileSystem implementationat org.apache.hadoop.fs.FileSystem.getScheme(FileSystem.java:214)at org.apache.hadoop.fs.FileSystem.loadFileSystems(FileSystem.java:2559)at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2569)at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2586)at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89)at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2625)at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2607)at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368)at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:167)at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:352)at org.apache.hadoop.fs.Path.getFileSystem(Path.java:296)at org.apache.hadoop.hbase.util.DynamicClassLoader.<init>(DynamicClassLoader.java:104)at org.apache.hadoop.hbase.protobuf.ProtobufUtil.<clinit>(ProtobufUtil.java:232)... 64 more
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
该错误解决方法是将Titan中的hadoop-core.jar替换为对应Hadoop backends的core.jar,我替换的是hadoop-mapreduce-client-core-2.6.0-cdh5.8.0.jar
问题2
如solrCloud中不包含jts-*.jar,则将$TITAN_HOME/lib/jst-1.13.jar复制到solr的lib目录中,并且重启solr集群
问题3
如Solr版本不是solr5.2.1,则按实际情况修改源码,笔者的solr版本为5.3.1,当将solr-solrj-5.2.1.jar替换为solr-solrj-5.3.1.jar后抛出异常,由于5.3.1中
zkStateReader.updateClusterState不存在有参函数故报错,我又替换为solrj-solr5.2.1.jar 经测试通过
titan/titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java
/*** Checks if the collection has already been created in Solr.*/private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {ZkStateReader zkStateReader = server.getZkStateReader();zkStateReader.updateClusterState(true);ClusterState clusterState = zkStateReader.getClusterState();return clusterState.getCollectionOrNull(collection) != null;}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
问题4
如报如下异常
com.thinkaurelius.titan.core.SchemaViolationException: Adding this property for key [~T$SchemaName] and value [rtname] violates a uniqueness constraint [SystemIndex#~T$SchemaName]
- 1
将hbase中的titan表的数据清理,该异常为多次构建backend造成的
Stack Overflow 的说明如下
http://stackoverflow.com/questions/32938486/error-while-trying-to-use-indexes-in-titan-graph-db
Titan Graph DataBase 研究 (一)----环境搭建相关推荐
- 【网络安全学习】渗透测试篇01-DVWA靶场环境搭建教程
渗透测试:通过经授权的模拟攻击,发现存在的漏洞,并以此对网络.主机.应用及数据的安全性进行评估. 靶场作用:在合法的环境下进行网络安全学习与演练 目录 为什么写这篇文章? 介绍及注意事项 环境搭建 1 ...
- Microsoft NLayerApp案例理论与实践 - 项目简“.NET研究”介与环境搭建
项目简介 Microsoft – Spain团队有一个很不错的面向领域多层分布式项目案例:Microsoft – Domain Oriented N-Layered .NET 4.0 App Samp ...
- 家用路由器研究详解入门(内含仿真环境搭建)
家用路由器研究介绍 soho路由器 常见路由器品牌 家用路由器漏洞主要四个方面 WI-FI常见加密认证方式3种 WPS一键加密技术(Wi-Fi Protected Setup) 路由器密码 后门|溢出 ...
- JanusGraph环境搭建实战
JanusGraph环境搭建实战 最近工作一直在做关于图数据的开发工作,正在开发图计算相关的功能,图数据库的内核还是基于TinkerPop3的,TinkerPop3提供了一套完整的图数据模型建模,标准 ...
- Mycat源码篇 : 起步,Mycat源码阅读调试环境搭建
在研究mycat源码之前必须先把环境搭建好.这篇文章的目标就是搭建mycat源码调试环境.环境主要包括: git jdk maven eclipse mysql 这里假设你知道上面的知识点.我们搭建的 ...
- Oracle dataguard一主两备环境搭建
Oracle dataguard一主两备环境搭建 测试环境说明: 主 库:Reahat 6.5 x64 + Oracle 11.2.0.3 x64 单机(IP:192.168.6.10 db) D ...
- 自动化测试练习项目环境搭建
对于小白而言,搭建测试环境首选的有tpshop.shopxo.iwebshop这类php开发的电商网站,虽然部署方便,但是却跟企业实际的架构相差太远,不利于我们更好的了解和学习软件测试. 那么,对于自 ...
- Neo4j ① <图论>图,节点,关系,属性<知识图谱和图库>图谱,图库,优势<基础>模块,应用场景,环境搭建,浏览器
目录 第一部分 图 和 Neo4j 1.1 图论 1.1.1 图论起源 --- 柯尼斯堡(Konigsberg)七桥问题 1.1.2 图 和 节点 1.1.3 节点关系表达 1.1.4 属性图模型规则 ...
- SQL审核 | SQLE 二次开发环境搭建
作者:Jason 就职于捷信消费金融有限公司,担任 DBA 工作.先后从事过 oracle .mongo .mysql 的 DBA ,以及大数据 ETL 的开发工作.对 NEWSQL 以及云原生分布式 ...
最新文章
- Android Camera设置setPreviewCallback实现onPreviewFrame接口实时截取每一帧视频流数据
- 牛顿法求根号数(Python)
- TrimPath - Js模板引擎
- [USACO] Beef McNuggets
- 取 GridView 里 点击当前行的 行数
- overflow encountered in ubyte_scalars像素加减运算溢出异常
- 如何基于TensorFlow使用LSTM和CNN实现时序分类任务
- 第一章 为什么我们对机器学习感兴趣?(六)
- 中小企业上云多地域办公组网(SAG)解决方案
- 进程、线程、协程基本概念理解
- 计算机在材料研究的应用,计算机在材料工程中的应用
- 制作自己的个人博客网站
- MS08_067漏洞复现
- 软通动力华为外包_软通动力外包到百度?
- AtCoder ABC237题解
- 关于算法学习的总结和感悟
- CIAA 网络安全模型 — 数据传输安全
- bsl是计算机术语吗,一种BSL的确定方法、BIER-TE控制器和计算机存储介质与流程...
- 肖秀荣8套卷2018pdf下载|2018肖秀荣冲刺8套卷pdf下载电子版
- CentOS安装图形界面
热门文章
- axure设计出的原型打开自动跳转的问题_Axure原型设计中你不得不知道的技巧(二)...
- java土豪笑话_调侃土豪的段子 土豪笑话段子大全
- Error:(12,29) java: 程序包com.suwell.api.custom不存在
- linux外接光驱下载文件,Linux 从光驱拷贝文件以及加载新的硬盘
- Ubuntu19安装Nvidia显卡驱动
- 基因数据处理118之SSW运行
- Kotlin在Android开发中那些让人舒适的地方,flutter项目实战
- H5多图片压缩加水印上传
- for循环中各语句的执行顺序
- Tensorflow实现kaggle猫狗识别(循序渐进进行网络设计)