Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ target/
/output/
/scripts/
/elasticsearch/
/docker/*.zip
# When executing tests in alphabetical order, Maven generates temporary
# files with names like this:
#
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# Please keep the list sorted.

Amazon
Aurelius
DataStax
Dylan Bethune-Waddell <dylan.bethune.waddell@mail.utoronto.ca>
Expand Down
31 changes: 31 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,37 @@ To build with only the TinkerPop tests\*:
mvn clean install -Dtest.skip.tp=false -DskipTests=true
```

## Building Docker Image for JanusGraph Gremlin Server

To build and run Docker images with JanusGraph and Gremlin Server, configured
to run the BerkeleyJE backend and Elasticsearch (requires [Docker Compose](https://docs.docker.com/compose/)):

```bash
mvn clean install -Pjanusgraph-release -Dgpg.skip=true -DskipTests=true && mvn docker:build -Pjanusgraph-docker -pl janusgraph-dist
docker-compose -f janusgraph-dist/janusgraph-dist-hadoop-2/docker-compose.yml up
```

Note the above `docker-compose` call launches containers in the foreground and is convenient for monitoring logs but add "-d" to instead run in the background.

To connect to the server in the same container on the console:

```bash
docker exec -i -t janusgraph /var/janusgraph/bin/gremlin.sh
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should continue this out with some Gremlin Console interaction. The BerkeleyJE backend only allows a single connection, so the users cannot do something like graph = JanusGraphFactory.open('conf/janusgraph-berkeleyje-es.properties') as described in the Getting Started doc.

They would need to configure a remote connection through the Gremlin Server.

gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> GraphOfTheGodsFactory.load(graph)
==>null
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[berkeleyje:db/berkeley], standard]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will make these changes now

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pluradj done!

Then you can interact with the graph on the console through the `:remote` interface:

```groovy
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> GraphOfTheGodsFactory.load(graph)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to GraphOfTheGodsFactory.load(graph,null,true) or make updates to start an ES instance.

==>null
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[berkeleyje:db/berkeley], standard]
```

## Building on Eclipse IDE
Note that this has only been tested on Eclipse Neon.2 Release (4.6.2) with m2e (1.7.0.20160603-1933) and m2e-wtp (1.3.1.20160831-1005) plugin.

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
![JanusGraph logo](janusgraph.png)

JanusGraph is a highly scalable [graph database](http://en.wikipedia.org/wiki/Graph_database) optimized for storing and querying large graphs with billions of vertices and edges distributed across a multi-machine cluster. JanusGraph is a transactional database that can support thousands of concurrent users, complex traversals, and analytic graph queries.
JanusGraph is a highly scalable [graph database](http://en.wikipedia.org/wiki/Graph_database)
optimized for storing and querying large graphs with billions of vertices and edges
distributed across a multi-machine cluster. JanusGraph is a transactional database that
can support thousands of concurrent users, complex traversals, and analytic graph queries.

[![Build Status][travis-shield]][travis-link]
[![Maven][maven-shield]][maven-link]
Expand All @@ -18,7 +21,8 @@ JanusGraph is a highly scalable [graph database](http://en.wikipedia.org/wiki/Gr

## Learn More

The [project homepage](http://janusgraph.org) contains more information on JanusGraph and provides links to documentation, getting-started guides and release downloads.
The [project homepage](http://janusgraph.org) contains more information on JanusGraph and
provides links to documentation, getting-started guides and release downloads.

## Community

Expand Down
11 changes: 11 additions & 0 deletions janusgraph-dist/janusgraph-dist-hadoop-2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM openjdk:8

ARG server_zip
ADD ${server_zip} /var

RUN apt-get update -y && apt-get install -y zip && \
server_base=`basename ${server_zip} .zip` && \
unzip -q /var/${server_base}.zip -d /var && \
ln -s /var/${server_base} /var/janusgraph

WORKDIR /var/janusgraph
24 changes: 24 additions & 0 deletions janusgraph-dist/janusgraph-dist-hadoop-2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '2'
services:
janusgraph:
image: janusgraph/server:latest
container_name: janusgraph
ports:
- "8182:8182"
volumes:
- ./es/wait-for-es.sh:/usr/bin/wait-for-es.sh
depends_on:
- "elasticsearch"
command: ["wait-for-es.sh", "elasticsearch", "./bin/gremlin-server.sh", "./conf/gremlin-server/gremlin-server-berkeleyje.yaml"]

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.3.2
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "http.host=0.0.0.0"
- "transport.host=127.0.0.1"
ports:
- "9200"
volumes:
- ./es/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml

10 changes: 10 additions & 0 deletions janusgraph-dist/janusgraph-dist-hadoop-2/es/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cluster.name: "docker-cluster"
network.host: 0.0.0.0

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
discovery.zen.minimum_master_nodes: 1

xpack.security.enabled : false

18 changes: 18 additions & 0 deletions janusgraph-dist/janusgraph-dist-hadoop-2/es/wait-for-es.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

host="$1"

shift
cmd="$@"

until $(curl --output /dev/null --silent --head --fail http://$host:9200); do
printf '.'
sleep 5
done

>&2 echo "Elasticsearch is up"

exec $cmd

27 changes: 27 additions & 0 deletions janusgraph-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<pkgtools.dir>${project.basedir}/..</pkgtools.dir>

<skipDefaultDistroIT>${it.skip}</skipDefaultDistroIT>
<docker.maven.version>0.4.13</docker.maven.version>
</properties>

<modules>
Expand Down Expand Up @@ -622,6 +623,32 @@
</build>
</profile>

<profile>
<id>janusgraph-docker</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.version}</version>
<configuration>
<dockerDirectory>${project.basedir}/janusgraph-dist-hadoop-2</dockerDirectory>
<buildArgs>
<server_zip>target/janusgraph-${project.version}-hadoop2.zip</server_zip>
</buildArgs>
<forceTags>true</forceTags>
<imageName>janusgraph/server</imageName>
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>

<profile>
<id>janusgraph-release</id>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
host: localhost

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.0.0.0 would be nice, so you can expose port 8182 to outside docker container, and connect using websockets for testing clients outside the container.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't catch this before merging. Will start a new PR to address.

port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/gremlin-server/janusgraph-berkeleyje-es-server.properties}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to janusgraph-berkeleyje-server.properties or make updates to start an ES instance.

plugins:
- janusgraph.imports
scriptEngines: {
gremlin-groovy: {
imports: [java.lang.Math],
staticImports: [java.lang.Math.PI],
scripts: [scripts/empty-sample.groovy]}}
serializers:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
processors:
- { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
- { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
metrics: {
consoleReporter: {enabled: true, interval: 180000},
csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
jmxReporter: {enabled: true},
slf4jReporter: {enabled: true, interval: 180000},
gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
graphiteReporter: {enabled: false, interval: 180000}}
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# JanusGraph configuration sample: BerkeleyDB JE and embedded Elasticsearch
#
# This file opens a BDB JE instance in the directory
# db/berkeley. It also starts a local Elasticsearch
# service inside the same JVM running JanusGraph, persisted at
# db/es.

gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=berkeleyje
storage.directory=db/berkeley
index.search.backend=elasticsearch
index.search.hostname=elasticsearch
10 changes: 6 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<janusgraph.testdir>${project.build.directory}/janusgraph-test</janusgraph.testdir>
<gpg.skip>false</gpg.skip>
<maven.gpg.version>1.4</maven.gpg.version>
<perf.jvm.opts />
<default.test.jvm.opts>-Xms256m -Xmx768m -XX:+HeapDumpOnOutOfMemoryError -ea ${test.extra.jvm.opts}</default.test.jvm.opts>
<mem.jvm.opts>-Xms256m -Xmx256m -ea -XX:+HeapDumpOnOutOfMemoryError ${test.extra.jvm.opts}</mem.jvm.opts>
<test.extra.jvm.opts />
<test.skip.default>false</test.skip.default>
<test.skip.tp>true</test.skip.tp>
<top.level.basedir>${basedir}</top.level.basedir>
<maven.javadoc.version>2.10.4</maven.javadoc.version>
<compiler.source>1.8</compiler.source>
<compiler.target>1.8</compiler.target>
<test.excluded.groups>org.janusgraph.testcategory.MemoryTests,org.janusgraph.testcategory.PerformanceTests,org.janusgraph.testcategory.BrittleTests</test.excluded.groups>
Expand Down Expand Up @@ -383,7 +385,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>${maven.javadoc.version}</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -407,7 +409,7 @@
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<version>${maven.gpg.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -1113,7 +1115,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<version>${maven.javadoc.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -1123,7 +1125,7 @@
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.1</version>
<version>${maven.gpg.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down