如果一个单机存储方案,例如Berkley DB提供的,不能满足您的需要,还有一些其它的方案,它们提供了水平扩展和高可用。阿帕奇Cassandra就是其中之一。选择哪种存储方案取决于多种因素,这超出了本书的范围。然而如果您已经在您的组织或数据中心布署了Cassandra,人们已经知道如何去管理和配置它,它将是您的杰森图的后端存储需要的一个明智的选择。和其它的大数据系统一样,Cassandra需要根据您的负载的类型进行调优和维护。这需要发展新的技术和做一些实践。Cassandra是使用java语言编写的,重要的是要关注运行您的Cassandra实例的虚机所发生的垃圾回收的总量。过度的垃圾回收会明显地影响到您的图的性能。有很多种方式可以布署Cassandra,从在本地电脑的单实例运行到多节点聚簇。如何布署它,取决于您的扩缩容的需求。注意Cassandra和Berkley DB 一样,如果需要的话,也可以运行在嵌入式模式。
If a single machine storage solution, such as that offered by Berkley DB, is insufficient for your
needs then there are several other choices that offer horizontal scaling and high availability.
Apache Cassandra is one such choice. Which storage solution you chose will depend on many
factors that go beyond the scope of this book. However, if you already have Apache Cassandra
deployed in your organization or data center and have people that know how to manage and
configure it, it might be the right choice for your JanusGraph back end storage needs. Like any big
data system Apache Cassandra requires tuning and maintenance to get the best performance for
your workload type. That potentially requires developing new skills and doing some
experimentation. Apache Cassandra is written in Java and it is important to keep a careful eye on
the amount of garbage collection taking place within the virtual machines that are running your
Cassandra instances. Excessive garbage collection can significantly impact your graph’s
performance. There are many ways that Cassandra can be deployed ranging from a single instance
on your local machine to a multi node cluster. How you deploy it will depend on your scalability
and redundancy needs. Note that Cassandra, like Berkley DB can, if needed, also run in embedded
mode.
详细的配置信息您可以参阅杰森图的官方文档,在这http://docs.janusgraph.org/latest/storage-backends.html.
For detailed configuration information you should refer to the official JanusGraph
documentation located at http://docs.janusgraph.org/latest/storage-backends.html.
稍后在“使用Docker进行Cassandra和杰森图的实验”这一节中, 我们将会看使用Docker容器来布署单节点的Cassandra实例。 Docker容器提供了一种有好的开发和测试的环境。
A bit later, in the "Using Docker to experiment with Cassandra and JanusGraph" section, we will
take a look at deploying a single node instance of Cassandra using Docker containers which
provides a nice environment for development and testing.
杰森图/conf文件包含了多个属性文件,它可以用来处理Cassandra。您使用哪一个取瘊于您布署Cassandra的方式。稍后我们会了解在使用外部的索引时,如何再进一步配置您的环境。如果您使用的是没有外部索引的Cassandra,您可以像下面这样连接它。
The JanusGraph /conf directory contains several property files that can be used when working with
Apache Cassandra. Which one you use will depend on the way you chose to deploy Cassandra. Later
on we will look at the additional steps you need to take to configure your environment when
external indexes are used. However, if you were using Cassandra without an external index being
needed you might connect to it as follows.

 您可能需要编辑属性文件从而包含您的Cassandra系统的主机名和IP地址。在属性文件中,默认为我们配置的是localhost.Cassandra可以从下面的URL,阿帕奇的网站下载。

You will need to edit the properties file to contain the host name and IP address of your Cassandra
system. By default the properties file is configured for use with localhost.
Apache Cassandra can be downloaded from the Apache web site from the following URL.
http://cassandra.apache.org/
6.8.3. 斯库拉 数据库 ScyllaDB
ScyllaDB 是一个可以与 Cassandra兼容的API,但是它是用C++实现的,您在处理Cassandra时的配置文件也可以用在处理ScyllaDB时。
ScyllaDB is API compatible with Apache Cassandra but implemented in C++. The same
configuration files that you use when working with Apache Cassandra should also work with
ScyllaDB.
ScyllaDB可以从下面的URL下载http://www.scylladb.com/
ScyllaDB can be downloaded from the following URL. http://www.scylladb.com/
6.8.4. Apache HBase
如果您已经启动了Hadoop和HDFS 的环境或者计划布署,那么 HBase 会是您的杰森图数据存储的一个不错的方案。 HBase 和Cassandra一样,是一处支持超大表的数据库。在/conf目录中有多个属性文件可以连接一个杰森图到HBase存储。
If you already have a Hadoop and HDFS environment setup or are planning to deploy one, then
Apache HBase may be a good choice for your JanusGraph data store. Apache HBase, like Apache
Cassandra, is a database that supports very large tables. There are several properties files in the
/conf directory that can be used to connect JanusGraph to an Apache HBase store.
详细配置信息您可以参阅杰森图的官方文档,位置在 http://docs.janusgraph.org/latest/storage-backends.html. 您将使用哪个属性文件取决于您是否需要一个外部索引。然而,如果您使用没有外部索引的HBase,您可以像下面这样连接它。
For detailed configuration information you should refer to the official JanusGraph
documentation located at http://docs.janusgraph.org/latest/storage-backends.html.
Which properties file you use will depend on whether or not you need to use an external index.
However, if you were using HBase without an external index being needed you might connect to it
as follows.

 

 和 Cassandra属性文件一样,HBase的属性文件也预备置为连接到localhost. 如果您想要连接到不同的机器,在调用开始前,您需要编辑和更新合适的主机名和IP地址。HBase 可以从阿帕奇网站下面的URLhttps://hbase.apache.org/中下载。

As with the Cassandra properties file, The HBase properties file is preconfigured to connect to
localhost. You will need to edit it and update the hostname and IP address as appropriate before
calling open if you want to connect to a different machine.
Apache HBase can be downloaded from the Apache web site at the following URL.
https://hbase.apache.org/
 
6.8.5. 谷歌 Google Bigtable
到目前为目介绍的方案都是开源的方案,您可以下载并运行。出于完整性考虑, 笔者也包括了需要一些付费的方案,它们可以保存您的杰森图的数据。 Google Bigtable是与HBase兼容的API。它提供了存储您自己的Hbase 聚簇供您的杰森图使用的存储主机的方案。当然,您可以决定:使用一个付费的数据库主机服务是您想要的方式,或者在内部管理您的数据,或者在您选择中的主机服务上配置您自己的环境。您可以从下面这个URLhttps://cloud.google.com/bigtable/阅读更多关于谷歌Bigtable的内容。
All of the options discussed so far are open source alternatives that you could download and run in
house. For the sake of completeness I am including a few pointers to some "for fee" alternatives to
hosting your JanusGraph data in house. Google Bigtable is API compatible with Apache HBase. It
offers a hosted alternative to hosting your own HBase cluster for use with JanusGraph. Of course
you will have to decide if paying for a hosted database service is the way you want to go versus
hosting your graph data in house or setting up your own environment that you manage on a
hosting service of your choice.
You can read more about Google Bigtable at the following URL. https://cloud.google.com/bigtable/
 
6.8.6. IBM Compose for JanusGraph
IBM通过它的Compose平台提供了一个管理杰森图的环境。在这个环境中,IBM为您管理了整个环境,包括了以ScyllaDB聚簇为后端的杰森图。和谷歌的Bigtable一样, 这是一个您需要付费的主机服务。如果自己管理一个Cassandra 兼容的聚簇用于杰森图的使用不是理想的方案,那么您需要考虑一下IBM Compose这个方案。
IBM offers a hosted and managed JanusGraph environment via its Compose platform. In this
environment IBM manages the whole environment for you which includes JanusGraph backed by a
ScyllaDB cluster. As with Google Bigtable this is a hosted service that you pay to use. If the idea of
managing a Cassandra compatible cluster for use with JanusGraph yourself is not something you
want to take on this is an option you can consider.
您可以从下面的URL读到更多关于这个服务的内容。
You can read more about this service at the following URL. https://www.ibm.com/cloud/compose/
janusgraph
6.8.7. 其它TinkerPop 兼容的产品和服务 Other TinkerPop compatible products and services
现在还有一些其它的产品和云主机环境它们还没有提供了杰森图的支持,但是它们提供了由其它存储做后端的对于TinkerPop和小精灵的支持。这是一些可以选择做主机和内部方案的选项。阿帕奇TinkerPop 项目维护了一张TinkerPop兼容的图存储的列表。您可以从这找到这张列表。http://tinkerpop.apache.org/providers.html.
There are now several other products and cloud hosted environments that do not offer JanusGraph
support per-se but do offer TinkerPop and Gremlin support backed by other stores. There are a
selection of both hosted and in-house options to choose from. The Apache TinkerPop project
maintains a list of TinkerPop compatible graph stores. You can find that list here
http://tinkerpop.apache.org/providers.html.
很高兴看到的是:阿帕奇Tinkerpop,特别是小精灵查询和遍历语言已成为一种非常重要的方式,人们可以用它来构建图并与图数据库交互。
What is really good to see is that ApacheTinkerpop, and in particular the Gremlin query and
traversal language, has become one of the primary ways that people are building and interacting
with, graph databases.
posted on 2022-05-04 13:06  bokeyuannicheng0000  阅读(64)  评论(0)    收藏  举报