Deploying JanusGraph on Alibaba Cloud ECS

Prerequisite: Elastic Compute Service (ECS) Instance

Preparing the Server

sudo sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
sudo yum -y install wget
sudo wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh epel-release-latest-7.noarch.rpm
sudo yum -y install git zip unzip
sudo yum -y update
sudo shutdown -r now

Installing & Configuring JanusGraph Dependencies

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearchsudo vi /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
sudo yum install -y java elasticsearch
sudo vi /etc/yum.repos.d/cassandra.repo
[cassandra-3.x]
name=Apache Cassandra
baseurl=https://www.apache.org/dist/cassandra/redhat/311x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.apache.org/dist/cassandra/KEYS
sudo yum install -y Cassandra
sudo vi /etc/cassandra/default.conf/cassandra.yaml
start_rpc: false
start_rpc: true
sudo systemctl daemon-reload
sudo chkconfig elasticsearch on
sudo chkconfig cassandra on
sudo service cassandra start
sudo service elasticsearch start
sudo service elasticsearch status
sudo service cassandra status

Installing JanusGraph

wget https://github.com/JanusGraph/janusgraph/releases/download/v0.3.0/janusgraph-0.3.0-hadoop2.zip
unzip janusgraph-0.3.0-hadoop2.zip
cd janusgraph-0.3.0-hadoop2
bin/gremlin-server.sh
bin/gremlin.sh
:plugin use tinkerpop.credentials
graph = TinkerGraph.open()
graph.createIndex("username",Vertex.class)
credentials = credentials(graph)
credentials.createUser("myusername","mYpa$$word!")
credentials.findUser("myusername ").properties()
credentials.countUsers()
graph.io(IoCore.gryo()).writeGraph("data/credentials.kryo")
:quit
vi conf/tinkergraph-credentials.properties
gremlin.graph=org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
gremlin.tinkergraph.vertexIdManager=LONG
gremlin.tinkergraph.graphLocation=data/credentials.kryo
gremlin.tinkergraph.graphFormat=gryo
cp conf/gremlin-server/gremlin-server.yaml conf/gremlin-server/socket-gremlin-server.yamlvi conf/gremlin-server/socket-gremlin-server.yaml
authentication: {
className: org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator,
config: {
credentialsDb: conf/tinkergraph-credentials.properties}}
ssl: {
enabled: true}
bin/gremlin-server.sh ./conf/gremlin-server/socket-gremlin-server.yaml
sudo vi /etc/systemd/system/janusgraph.service
[Unit]
Description = JanusGraph Server
After = cassandra.service elasticsearch.service
[Service]
User=root
ExecStart = /home/root/janusgraph-0.3.0-hadoop2/bin/gremlin-server.sh /home/root/janusgraph-0.3.0-hadoop2/conf/gremlin-server/socket-gremlin-server.yaml
TimeoutStartSec=60
[Install]
WantedBy = multi-user.target
sudo systemctl daemon-reload
sudo chkconfig janusgraph on
sudo service janusgraph start
sudo service janusgraph status

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store