JanusGraph Setup & Testing Instructions for RHEL/CentOS/Alma Linux 7-8

JanusGraph Setup & Testing Instructions for RHEL/CentOS/Alma Linux 7-8

Single Node Setup Instructions

 


Pre-requisites

1.  Ensure you have the syndeia-cloud-3.5_janusgraph_setup.zip (or latest service pack) downloaded to your home directory (or home directory's Downloads folder) from the download/license instructions sent out by our team.  

  Note: the .ZIP will pre-create a separate folder for its contents when extracted so there is no need to pre-create a separate folder for it.  

2.  Ensure you satisfy Janusgraph's pre-requisites, ie: have (Open|Oracle)JDK/JRE + Apache Cassandra (& optionally Elasticsearch) installed.  Re. CPU, memory, HD space, etc. this will depend on how much data you expect to store, query, and graph.  

3.  If using a firewall, and JG will be on a separate server from SC, ensure the following port is accessible (consult your local network admin if required): TCP port 8182 (this is the port to listen to for client connections).  

 


Downloading & Extracting JanusGraph

1. Ensure you have Janusgraph 0.5.3 (https://github.com/JanusGraph/janusgraph/releases/tag/v0.5.3) downloaded to your home directory (ie: wget https://github.com/JanusGraph/janusgraph/releases/download/v0.5.3/janusgraph-full-0.5.3.zip)

 Note: JG releases are now split into ones with and without ElasticSearch + Gremlin Server bundled.  The full releases contains ElasticSearch + the Gremlin Server.  

2. Unzip the JanusGraph package to /opt, ie:  sudo unzip janusgraph-0.5.3-full.zip -d /opt/

 Note: if you don't have unzip installed, you may need to first install it via yum install unzip

3. Unzip Syndeia Cloud's JanusGraph setup package in your home directory ~/, ie:  unzip syndeia-cloud-3.5_janusgraph_setup.zip -d ~/

4. Create a new user and group named janusgraph , ie:  sudo useradd --system --user-group janusgraph

5. Take ownership of the extracted folder, ie:  sudo chown -R janusgraph:janusgraph /opt/janusgraph-0.5.3-full

Pre-Janusgraph Setup Health Check

When completed, confirm all of the following are true before proceeding:

(The tools used and the network locations used are site-dependent.)

  • Cassandra service is running:  systemctl status cassandra 

  • Cassandra port is accessible/open:  netstat -tulpn | grep 9042 

  • Cassandra service is accessible via CQLSH:  Linux: clqsh check  

  • JanusGraph files exist at:  /opt/janusgraph-${JG_build-ver} 

 


JanusGraph Keyspace Setup, Service Setup & Start:

6. In a new terminal session, cd into the bin dir and run the Syndeia Cloud JanusGraph setup script, ie:  cd ~/syndeia-cloud-3.5_janusgraph_setup/bin; ./syndeia-cloud-3.5_janusgraph_setup.bash

(info)  Note, If you are deploying JG on a multi-node configuration where JG is not on the same machine as Cassandra, please: 

  1. ensure you have CQLSH installed,

  2. run this setup with the --multi_node or -m  switch. 

  This will:  

- Create/update janusgraph-current symlink to specified version, default = 0.5.3
- Create a new syndeia_admin superuser in Cassandra with a password you specify
- Create a new syndeia_cloud_graph and syndeia_cloud_graph_config keyspaces
GRANT ALL PERMISSIONS ON KEYSPACE syndeia_cloud_graph TO syndeia_admin
GRANT ALL PERMISSIONS ON KEYSPACE syndeia_cloud_graph_config TO syndeia_admin
- Run a Groovy JanusGraph setup script to set storage params for your graph and build indexes
- Create a renamed copy of the file /opt/janusgraph-<release_ver>/conf/janusgraph-cql-configurationgraph.properties as janusgraph-cql-configurationgraph-syndeia.properties with: 

graph.graphname=syndeia_cloud_graph_config
Add storage.username=syndeia_admin
Add storage.password=<password_specified>
storage.hostname=<your_Cassandra_host>

- If you installed Elasticsearch on the same machine, add index.search.backend=elasticsearch and index.search.hostname=localhost to use Elasticsearch for search indexing
- Create a renamed copy of the file /opt/janusgraph-<release_ver>/conf/gremlin-server/gremlin-server-configuration.yaml as gremlin-server-configuration-syndeia.yaml and set ConfigurationManagementGraph to point to janusgraph-cql-configurationgraph-syndeia.properties.  
- Install systemd .service file for JanusGraph service
- Start JanusGraph service

(info)  Note: you may be prompted for sudo authentication.  You will also be prompted for your cassandra account password (default = cassandra), to set your syndeia_admin password and the FQDN of your Cassandra host.  

(warning)  Avoid all of the following special characters: \?*[]+#&.{}$ when setting your syndeia_admin password.

 

Configuration Health Check

When completed, confirm all of the following are true before proceeding or when trying to determine if the JanusGraph service is properly configured and operating.

(The tools used and the network locations used are site-dependent.)

  • SC's .groovy script for JG ran successfully, ie:  you should have only received a WARN  org.apache.hadoop.util.NativeCodeLoader  - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable WARN-ing 

  • JanusGraph service is now running:  systemctl status janusgraph 

  • JanusGraph port is accessible:  netstat -tulpn | grep 8182

  • Cassandra syndeia_cloud_graph and syndeia_cloud_graph_config keyspaces exist, ie:  if you type SELECT * FROM syndeia_cloud_ in CQLSH and hit tab, you should see syndeia_cloud_graph. syndeia_cloud_graph_config. 

  • Following files exist as described below:  

    • /opt/janusgraph-current symlink exists, and points to the latest Intercax-approved version of JanusGraph

    • /opt/janusgraph-current/conf/gremlin-server/gremlin-server-configuration-syndeia.yaml exists.

      • When completed with the defaults, the beginning of the file should resemble this content:

        sample: gremlin-server-configuration-syndeia.yaml

        host: localhost port: 8182 scriptEvaluationTimeout: 60000 channelizer: org.janusgraph.channelizers.JanusGraphWebSocketChannelizer graphManager: org.janusgraph.graphdb.management.JanusGraphManager graphs: { ConfigurationManagementGraph: conf/janusgraph-cql-configurationgraph-syndeia.properties } ...
    • janusgraph-cql-configurationgraph-syndeia.properties' 

      • storage.hostname entry should be set to the hostname/IP address for the Cassandra host

    • /opt/janusgraph-current/conf/gremlin-server/gremlin-server-configuration-syndeia.yaml exists

    • /opt/janusgraph-current/log/gremlin-server.log exists

  • A message similar to INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Channel started at port 8182. appears near the recent end of the gremlin-server.log file


Managing JanusGraph:

7. To check the status of JanusGraph services, use systemctl status janusgraph.  You can verify that it started by verifying "Active: active (running)" shows up in the output: 

$ systemctl status janusgraph ● janusgraph.service Loaded: loaded (/etc/systemd/system/janusgraph.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2019-04-17 10:21:59 EDT; 7s ago Process: 22486 ExecStop=/bin/bash -c /opt/janusgraph-0.5.3-full/bin/janusgraph.sh stop (code=exited, status=0/SUCCESS) Main PID: 23677 (java) CGroup: /system.slice/janusgraph.service └─23677 java -server -Djanusgraph.logdir=/opt/janusgraph-0.5.3-full/bin/../log -Dlog4j.configuration=conf/gremlin-server/log4j-server.properties -Xms32m -Xmx512m -javaagent:

8. To stop/start the JanusGraph services, use sudo systemctl <action> janusgraph; where <action> = one of start|stop.  If the service successfully starts you should get the command prompt again. 

  Note: If you wish to ensure the services run on startup, run sudo systemctl enable janusgraph.  For more information on installing the .service files manually and configuring them to start after Cassandra, see Setting up Services to Start on Boot.  

9. To view the logs for JanusGraph, use sudo journalctl -eu janusgraph & less /opt/janusgraph-0.5.3-full/log/gremlin-server.log.  To follow the log files, you can use sudo journalctl -feu janusgraph & tail -f /opt/janusgraph-0.5.3-full/log/gremlin-server.log.  You should see output similar to the following (abridged) text:

 Note, for your convenience you may wish to create a symlink to /opt/janusgraph-0.5.3-full/log/ from /var/log, ie: sudo ln -nfs /opt/janusgraph-0.5.3-full/log/ /var/log/janusgraph

$ less /var/log/janusgraph/gremlin-server.log [...] 2987 [main] INFO com.datastax.driver.core.NettyUtil - Found Netty's native epoll transport in the classpath, using it 4827 [main] INFO com.datastax.driver.core.policies.DCAwareRoundRobinPolicy - Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor) 4835 [main] INFO com.datastax.driver.core.Cluster - New Cassandra host janusgraph.domain.com/localhost:9042 added 9043 [main] INFO org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration - Set default timestamp provider MICRO 11325 [main] INFO org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration - Generated unique-instance-id=2d3877742385-janusgraph-domain-com1 11341 [main] INFO com.datastax.driver.core.ClockFactory - Using java.lang.System clock to generate timestamps. 11902 [main] INFO com.datastax.driver.core.policies.DCAwareRoundRobinPolicy - Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor) 11902 [main] INFO com.datastax.driver.core.Cluster - New Cassandra host janusgraph.domain.com/localhost:9042 added 12251 [main] INFO org.janusgraph.diskstorage.Backend - Initiated backend operations thread pool of size 8 27969 [main] INFO org.janusgraph.diskstorage.Backend - Configuring total store cache size: 208138508 33098 [main] INFO org.janusgraph.diskstorage.log.kcvs.KCVSLog - Loaded unidentified ReadMarker start time 2019-03-18T01:55:02.918Z into org.janusgraph.diskstorage.log.kcvs.KCVSLog$MessagePuller@28d6290 35668 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-* 36019 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized GremlinExecutor and preparing GremlinScriptEngines instances. 40510 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized gremlin-groovy GremlinScriptEngine and registered metrics 40532 [main] INFO org.apache.tinkerpop.gremlin.server.op.OpLoader - Adding the standard OpProcessor. 40540 [main] INFO org.apache.tinkerpop.gremlin.server.op.OpLoader - Adding the session OpProcessor. 41030 [main] INFO org.apache.tinkerpop.gremlin.server.op.OpLoader - Adding the traversal OpProcessor. 41076 [main] INFO org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms 41097 [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - idleConnectionTimeout was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled 41098 [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - keepAliveInterval was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled 41247 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 41248 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 41298 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 41299 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 41306 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 41311 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0 serialization class is deprecated. 41314 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-lite with org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0 41315 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 41325 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0 41347 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 41350 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - application/json already has org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 configured - it will not be replaced by org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0. 41437 [gremlin-server-boss-1] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Gremlin Server configured with worker thread pool of 1, gremlin pool of 4 and boss thread pool of 1. 41438 [gremlin-server-boss-1] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Channel started at port 8182. 181192 [metrics-logger-reporter-thread-1] INFO org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics - type=GAUGE, name=org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.average-load-penalty, value=2.450843818E9

10.  Validate correct operation and create/update an archive image to use as a new base image if the node needs to be rebuilt or if you wish to create a cluster. 

  Before making the image you may wish to first stop and optionally disable the service temporarily to prevent auto-start on boot, ie:  sudo systemctl disable janusgraph.  

 


Multi-Node (Cluster) Setup Instructions

Enabling your single-node deployment for cluster operation

11. If Cassandra will be on a separate server from JG, ensure you first enable Cassandra for cluster operation.   

12. Update the Janusgraph syndeia_cloud_graph configuration by running /opt/janusgraph-current/bin/gremlin.sh and running the following Groovy code ; where cassandra.mydomain.com = the FQDN of the Casandra server that you have now exposed :