首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >土卫六BluePrints放映机

土卫六BluePrints放映机
EN

Stack Overflow用户
提问于 2014-12-17 06:52:23
回答 1查看 394关注 0票数 0

修订:

我有一个独立版本的卡桑德拉。我使用以下命令启动它:

代码语言:javascript
复制
./cassandra -f

我还安装了一个Java应用程序,安装了Titan图形库。要获得TitanGraph对象,我使用以下代码:

代码语言:javascript
复制
BaseConfiguration configuration = new BaseConfiguration();
configuration.setProperty("storage.backend", "cassandra");
configuration.setProperty("storage.hostname", "127.0.0.1");
TitanGraph graph = TitanFactory.open(configuration);

在此之后,我可以添加顶点/边并查询它们。我对本地Cassandra数据库进行了一次额外的检查,并可以验证是否生成和保存了记录。

代码语言:javascript
复制
cqlsh> select count(*) from titan.edgestore;

 count
--------
 185050

(1 rows)

当我启动rexster-server时,问题就出现了。我使用以下命令以独立模式启动:

代码语言:javascript
复制
./rexster.sh -s -c ../config/rexster.xml

然后启动rexster控制台并加载图表。问题是图表似乎不包含任何数据?我真的不知道这是怎么回事。只有一个卡桑德拉在运行。

代码语言:javascript
复制
        (l_(l
(_______( 0 0
(        (-Y-) <woof>
l l-----l l
l l,,   l l,,
opening session [127.0.0.1:8184]
?h for help

rexster[groovy]> ?h
-= Console Specific =-
?<language-name>: jump to engine
?l: list of available languages on Rexster
?b: print available bindings in the session
?r: reset the rexster session
?e <file-name>: execute a script file
?q: quit
?h: displays this message

-= Rexster Context =-
rexster.getGraph(graphName) - gets a Graph instance
   :graphName - [String] - the name of a graph configured within Rexster
rexster.getGraphNames() - gets the set of graph names configured within Rexster
rexster.getVersion() - gets the version of Rexster server

rexster[groovy]> rexster.getGraphNames() 
==>kpdlp
rexster[groovy]> rexster.getGraph('graph')
==>titangraph[cassandrathrift:[127.0.0.1]]
rexster[groovy]> g = rexster.getGraph('graph')
==>titangraph[cassandrathrift:[127.0.0.1]]
rexster[groovy]> g.V.count()
==>0
rexster[groovy]> 

下面是我正在使用的rexster.xml

代码语言:javascript
复制
  <?xml version="1.0" encoding="UTF-8"?>
<rexster>
    <http>
        <server-port>8182</server-port>
        <server-host>0.0.0.0</server-host>
        <base-uri>http://localhost</base-uri>
        <web-root>public</web-root>
        <character-set>UTF-8</character-set>
        <enable-jmx>false</enable-jmx>
        <enable-doghouse>true</enable-doghouse>
        <max-post-size>2097152</max-post-size>
        <max-header-size>8192</max-header-size>
        <upload-timeout-millis>30000</upload-timeout-millis>
        <thread-pool>
            <worker>
                <core-size>8</core-size>
                <max-size>8</max-size>
            </worker>
            <kernal>
                <core-size>4</core-size>
                <max-size>4</max-size>
            </kernal>
        </thread-pool>
        <io-strategy>leader-follower</io-strategy>
    </http>
    <rexpro>
        <server-port>8184</server-port>
        <server-host>0.0.0.0</server-host>
        <session-max-idle>1790000</session-max-idle>
        <session-check-interval>3000000</session-check-interval>
        <read-buffer>65536</read-buffer>
        <enable-jmx>false</enable-jmx>
        <thread-pool>
            <worker>
                <core-size>8</core-size>
                <max-size>8</max-size>
            </worker>
            <kernal>
                <core-size>4</core-size>
                <max-size>4</max-size>
            </kernal>
        </thread-pool>
        <io-strategy>leader-follower</io-strategy>
    </rexpro>
    <shutdown-port>8183</shutdown-port>
    <shutdown-host>127.0.0.1</shutdown-host>
    <config-check-interval>10000</config-check-interval>
    <script-engines>
        <script-engine>
            <name>gremlin-groovy</name>
            <reset-threshold>-1</reset-threshold>
            <init-scripts>config/init.groovy</init-scripts>
            <imports>com.tinkerpop.rexster.client.*</imports>
            <static-imports>java.lang.Math.PI</static-imports>
        </script-engine>
    </script-engines>
    <security>
        <authentication>
            <type>none</type>
            <configuration>
                <users>
                    <user>
                        <username>rexster</username>
                        <password>rexster</password>
                    </user>
                </users>
            </configuration>
        </authentication>
    </security>
    <metrics>
        <reporter>
            <type>jmx</type>
        </reporter>
        <reporter>
            <type>http</type>
        </reporter>
        <reporter>
            <type>console</type>
            <properties>
                <rates-time-unit>SECONDS</rates-time-unit>
                <duration-time-unit>SECONDS</duration-time-unit>
                <report-period>10</report-period>
                <report-time-unit>MINUTES</report-time-unit>
                <includes>http.rest.*</includes>
                <excludes>http.rest.*.delete</excludes>
            </properties>
        </reporter>
    </metrics>
    <graphs>
<graph>
    <graph-name>graph</graph-name>
    <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
    <graph-location></graph-location>
    <graph-read-only>false</graph-read-only>
    <properties>
          <storage.backend>cassandrathrift</storage.backend>
          <storage.hostname>127.0.0.1</storage.hostname>
    </properties>
    <extensions>
      <allows>
        <allow>tp:gremlin</allow>
      </allows>
    </extensions>
  </graph>
    </graphs>
</rexster>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-17 11:59:56

也许Rexster的角色有点混乱。你的问题是:

我的问题是,当我使用如下所示的TitanGraph实例化一个TitanFactory时,似乎没有指定图形名称的选项?

注意,使用TitanFactory将打开一个直接连接到cassandra的TitanGraph实例。这和Rexster无关。如果您想连接到Rexster (如果您的配置是远程保存TitanGraph实例的),那么您必须通过REST或RexPro进行连接。使用更简单的方法来验证操作是REST,请尝试curl:

代码语言:javascript
复制
curl http://localhost:8182/graphs

这将返回一些JSON,该JSON包含在TitanGraph字段中配置的rexster.xml字段中配置的rexster.xml实例的名称。<graph-name>简单地标识Rexster中的图形实例,这样当请求中存在多个实例时,您可以在请求中唯一地标识它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27519841

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档