File size: 2,845 Bytes
2795186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Cassandra CQL Storage, Elasticsearch Index

## About Cassandra and Elasticsearch

[Apache Cassandra](https://cassandra.apache.org/) is a distributed database
designed for scalability and high availability. Cassandra supports two
protocols for communications, Thrift (legacy RPC protocol) and CQL (native
protocol).

[Elasticsearch](https://www.elastic.co/elasticsearch/) is a scalable,
distributed search engine.

> Check the JanusGraph [version compatibility](https://docs.janusgraph.org/changelog/#version-compatibility)
to ensure you select versions of Cassandra and Elasticsearch compatible with
this JanusGraph release.

## JanusGraph configuration

* [`jgex-cql.properties`](conf/jgex-cql.properties) contains the Cassandra
and Elasticsearch server locations. By providing different values for
`storage.cql.keyspace` and `index.jgex.index-name`, you can store multiple
graphs on the same Cassandra and Elasticsearch servers. Refer to the JanusGraph
[configuration reference](https://docs.janusgraph.org/basics/configuration-reference/)
for additional properties.

### Cassandra configuration

The JanusGraph properties file assumes that Cassandra is installed on localhost
using its default configuration. Please refer to the Cassandra documentation
for installation instructions.

### Elasticsearch configuration

The JanusGraph properties file assumes that Elasticsearch is installed on
localhost using its default configuration. Please refer to the Elasticsearch
documentation for installation instructions.

### JanusGraph pre-packaged distribution

Rather than installing Cassandra and Elasticsearch separately, the JanusGraph
[pre-packaged distribution](https://docs.janusgraph.org/basics/server/#using-the-pre-packaged-distribution)
is provided for convenience. The distribution starts a local Cassandra,
Elasticsearch, and Gremlin Server.

## Dependencies

The required Maven dependency for Cql:

```
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-cql</artifactId>
            <version>${janusgraph.version}</version>
            <scope>runtime</scope>
        </dependency>
```

The required Maven dependency for Elasticsearch:

```
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-es</artifactId>
            <version>${janusgraph.version}</version>
            <scope>runtime</scope>
        </dependency>
```

## Run the example

This command can be run from the `examples` or the project's directory.

```
mvn exec:java -pl :example-cql
```

## Drop the graph

After running an example, you may want to drop the graph from storage. Make
sure to stop the application before dropping the graph. This command can be
run from the `examples` or the project's directory.

```
mvn exec:java -pl :example-cql -Dcmd=drop
```