使用titan 0.5.4和berkeleyje进行rexster.xml配置

时间:2016-02-07 16:58:31

标签: graph-databases titan gremlin rexster

我是图表数据库的新手,我几天都完全迷失了。我试图用titke db 0.5.4和berkeleyje存储后端运行rexster。 但我不确定rexster.xml配置是否正确。

如果我按照rexster docs进入狗窝空数据库,没有顶点或边缘,而实际存在。 screenshot

  <graphs>
    <graph>
      <graph-name>bio4j</graph-name>
      <graph-type>com.tinkerpop.rexster.config.TinkerGraphGraphConfiguration</graph-type>
      <graph-location>/Users/Phoenix/Dropbox/Graph4Bio/Bio4j/bio4j/importGOTitanProperties.properties</graph-location>
      <graph-read-only>false</graph-read-only>
      <extensions>
        <allows>
          <allow>tp:frames</allow>
        </allows>
      </extensions>
    </graph>
    ...
  </graphs>

如果我按照答案here

  <graphs>
    <graph>
      <graph-name>bio4j</graph-name>
      <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>

      <graph-location>/Users/Phoenix/Dropbox/Graph4Bio/Bio4j/bio4j/importGOTitanProperties.properties</graph-location>
      <graph-read-only>false</graph-read-only>
      <properties>
        <storage.backend>local</storage.backend>
        <storage.directory>/Users/Phoenix/Dropbox/Graph4Bio/Bio4j/bio4j</storage.directory>
        <buffer-size>100</buffer-size>
      </properties>
      <extensions>
        <allows>
          <allow>tp:frames</allow>
        </allows>
      </extensions>
    </graph>
    ...
  </graphs>

我收到了这些错误:

$ ../../bin/rexster.sh --start
0    [main] INFO  com.tinkerpop.rexster.Application  - .:Welcome to Rexster:.
90   [main] INFO  com.tinkerpop.rexster.server.RexsterProperties  - Using [/Users/Phoenix/Dropbox/Graph4Bio/Titan/rexhome/config/rexster.xml] as configuration source.
97   [main] INFO  com.tinkerpop.rexster.Application  - Rexster is watching [/Users/Phoenix/Dropbox/Graph4Bio/Titan/rexhome/config/rexster.xml] for change.
232  [main] WARN  com.tinkerpop.rexster.config.GraphConfigurationContainer  - Could not load graph bio4j. Please check the XML configuration.
233  [main] WARN  com.tinkerpop.rexster.config.GraphConfigurationContainer  - GraphConfiguration could not be found or otherwise instantiated: [com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration]. Ensure that it is in Rexster's path.
com.tinkerpop.rexster.config.GraphConfigurationException: GraphConfiguration could not be found or otherwise instantiated: [com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration]. Ensure that it is in Rexster's path.
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:142)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.<init>(GraphConfigurationContainer.java:54)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.reconfigure(XmlRexsterApplication.java:99)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.<init>(XmlRexsterApplication.java:47)
    at com.tinkerpop.rexster.Application.<init>(Application.java:97)
    at com.tinkerpop.rexster.Application.main(Application.java:189)
Caused by: java.lang.IllegalArgumentException: Could not find implementation class: local
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:47)
    at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:421)
    at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:361)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1275)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:73)
    at com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration.configureGraphInstance(TitanGraphConfiguration.java:33)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:124)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: local
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:42)
    ... 12 more
235  [main] WARN  com.tinkerpop.rexster.config.GraphConfigurationContainer  - Could not find implementation class: local
java.lang.IllegalArgumentException: Could not find implementation class: local
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:47)
    at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:421)
    at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:361)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1275)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:73)
    at com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration.configureGraphInstance(TitanGraphConfiguration.java:33)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:124)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.<init>(GraphConfigurationContainer.java:54)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.reconfigure(XmlRexsterApplication.java:99)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.<init>(XmlRexsterApplication.java:47)
    at com.tinkerpop.rexster.Application.<init>(Application.java:97)
    at com.tinkerpop.rexster.Application.main(Application.java:189)
Caused by: java.lang.ClassNotFoundException: local
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:42)
    ... 12 more
244  [main] INFO  com.tinkerpop.rexster.server.metrics.HttpReporterConfig  - Configured HTTP Metric Reporter.
245  [main] INFO  com.tinkerpop.rexster.server.metrics.ConsoleReporterConfig  - Configured Console Metric Reporter.
1312 [main] INFO  com.tinkerpop.rexster.server.HttpRexsterServer  - HTTP/REST thread pool configuration: kernal[4 / 4] worker[8 / 8] 
1313 [main] INFO  com.tinkerpop.rexster.server.HttpRexsterServer  - Using org.glassfish.grizzly.strategies.LeaderFollowerNIOStrategy IOStrategy for HTTP/REST.
1399 [main] INFO  com.tinkerpop.rexster.server.HttpRexsterServer  - Rexster Server running on: [http://localhost:8182]
1399 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - Using org.glassfish.grizzly.strategies.LeaderFollowerNIOStrategy IOStrategy for RexPro.
1399 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - RexPro thread pool configuration: kernal[4 / 4] worker[8 / 8] 
1402 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - Rexster configured with [DefaultSecurity].
1403 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - RexPro Server bound to [0.0.0.0:8184]
1412 [main] INFO  com.tinkerpop.rexster.server.ShutdownManager  - Bound shutdown socket to /127.0.0.1:8183. Starting listener thread for shutdown requests.

这是db .properties文件:

$ nano importGOTitanProperties.properties
#ImportGOTitan properties
storage.directory=bio4j
storage.backend=berkeleyje
#index.search.backend=elasticsearch
#index.search.directory=bio4j/es
storage.batch-loading=false
storage.transactions=true
query.fast-property=false
schema.default=none

1 个答案:

答案 0 :(得分:1)

阅读this后,我可以弄清楚如何配置rexster.xml文件

rexster.xml:

<?xml version="1.0" encoding="UTF-8"?>
<rexster>
  ...
  <graphs>
    <graph>
      <graph-name>bio4j</graph-name>
      <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
      <graph-read-only>false</graph-read-only>
      <properties>
        <storage.backend>berkeleyje</storage.backend>
        <storage.directory>/Users/Phoenix/Dropbox/Graph4Bio/Bio4j/bio4j</storage.directory>
        <storage.buffer-size>100</storage.buffer-size>
      </properties>
      <extensions>
        <allows>
          <allow>tp:gremlin</allow>
        </allows>
      </extensions>
    </graph>
  </graphs>
</rexster>

启动服务器:

$ ../../bin/rexster.sh --start
0    [main] INFO  com.tinkerpop.rexster.Application  - .:Welcome to Rexster:.
115  [main] INFO  com.tinkerpop.rexster.server.RexsterProperties  - Using [/Users/Phoenix/Dropbox/Graph4Bio/Titan/rexhome/config/rexster.xml] as configuration source.
129  [main] INFO  com.tinkerpop.rexster.Application  - Rexster is watching [/Users/Phoenix/Dropbox/Graph4Bio/Titan/rexhome/config/rexster.xml] for change.
942  [main] INFO  com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration  - Generated unique-instance-id=0a2581025086-AngryMac-local1
1049 [main] INFO  com.thinkaurelius.titan.diskstorage.Backend  - Initiated backend operations thread pool of size 8
1161 [main] INFO  com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog  - Loaded unidentified ReadMarker start time Timepoint[1454913673816000 μs] into com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog$MessagePuller@302c971f
1165 [main] INFO  com.tinkerpop.rexster.RexsterApplicationGraph  - Graph [bio4j] - configured with allowable namespace [tp:gremlin]
1205 [main] INFO  com.tinkerpop.rexster.config.GraphConfigurationContainer  - Graph bio4j - titangraph[berkeleyje:/Users/Phoenix/Dropbox/Graph4Bio/Bio4j/bio4j] loaded
2502 [main] INFO  com.tinkerpop.rexster.server.HttpRexsterServer  - HTTP/REST thread pool configuration: kernal[4 / 4] worker[8 / 8]
2504 [main] INFO  com.tinkerpop.rexster.server.HttpRexsterServer  - Using org.glassfish.grizzly.strategies.LeaderFollowerNIOStrategy IOStrategy for HTTP/REST.
2636 [main] INFO  com.tinkerpop.rexster.server.HttpRexsterServer  - Rexster Server running on: [http://localhost:8182]
2636 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - Using org.glassfish.grizzly.strategies.LeaderFollowerNIOStrategy IOStrategy for RexPro.
2636 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - RexPro thread pool configuration: kernal[4 / 4] worker[8 / 8]
2640 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - Rexster configured with no security.
2641 [main] INFO  com.tinkerpop.rexster.server.RexProRexsterServer  - RexPro Server bound to [0.0.0.0:8184]
2653 [main] INFO  com.tinkerpop.rexster.server.ShutdownManager  - Bound shutdown socket to /127.0.0.1:8183. Starting listener thread for shutdown requests.

狗屋screenshot:))))