Launch DynamoDB Storage Backend for Titan with Gremlin Server on Amazon EC2 by using a AWS CloudFormation template
You can use the AWS Management Console to launch an AWS CloudFormation stack from a template to launch Titan with Gremlin Server on an instance type of your choice in Amazon EC2. This stack requires a pre-existing IAM Role that has Amazon S3 read access to your gremlin-server.yaml configuration file and DynamoDB full access to create tables, and read and write items in these tables.
The Network ACL of the VPC includes just enough access to allow:
An SSH connection to the instance.
The EC2 instance to download yum updates from central repositories (HTTP outbound).
The EC2 instance to download your gremlin-server.yaml and the Gremlin Server package from S3 (HTTPS outbound).
The EC2 instance to connect to DynamoDB (HTTPS outbound).
An SSH key for Amazon EC2 instances must exist in the region you plan to create the Gremlin Server stack.
The name and path of an IAM role in the region that has Amazon S3 Read access and DynamoDB full access, the very minimum policies required to run this CloudFormation stack. Amazon S3 read access is required to provide the
dynamodb.propertiesfile to the stack in cloud-init. DynamoDB full access is required because the DynamoDB Storage Backend for Titan must create and delete tables, and read and write data in those tables.
An Amazon S3 bucket with the
dynamodb.propertiesfiles containing your settings. These files are in the server/dynamodb-titan100-storage-backend-1.0.0-hadoop1/conf/gremlin-server.
For more information on creating and uploading to Amazon S3, see the Working with Amazon S3 Buckets
The DynamoDB Storage Backend for Titan and its dependencies have been added to the default distributions. They are available for download from the following websites:
0.4.4: dynamodb-titan044-storage-backend-server-1.0.0.zip (SHA256 hash: a3bbd0e5eb0b71bbadf6762def516f5836c8032c442d5f39799c56c5345cb14b)
0.5.4: dynamodb-titan054-storage-backend-1.0.0-hadoop2.zip (SHA256 hash: 612979bc0c3c4ced3d01c2366c3a95888a40931d3dea72c47284653cdcc1)
1.0.0: dynamodb-titan100-storage-backend-1.0.0-hadoop1.zip (SHA256 hash: 5e8c31c97227ebc19eb6ac555d914de950ebbcd93b8eb5439b6f28a1990)
To launch Gremlin Server on Amazon EC2 using AWS CloudFormation
Choose the following link to view the AWS CloudFormation template that creates a Gremlin Server stack using the DynamoDB Storage Backend for Titan:
When you are ready to launch the stack, choose this button
On the Select Template page, choose Next.
This walkthrough uses the default settings. However, this page lets you customize the name of the AWS CloudFormation stack, or use a different template.
On the Specify Parameters page, specify the following:
EC2 Instance Type
The network whitelist pattern for Gremlin Server Websockets port
The Gremlin Server port, default 8182.
The S3 URL to your dynamodb.properties configuration file
The name of your pre-existing EC2 SSH key
The network whitelist for the SSH protocol. You will need to allow incoming connections via SSH to enable the SSH tunnels that will secure Websockets connections to Gremlin Server.
The default CIDR,
0.0.0.0/32, blocks SSH access from all ip addresses. You will need to specify a proper address range. For more information, see Authorizing Inbound Traffic for Your Linux Instances.
The path to an IAM role that has the minimum amount of privileges to run this CloudFormation script and run Gremlin Server with the DynamoDB Storage Backend for Titan. This role will require S3 read to get the dynamodb.properties file, and DynamoDB full access to create tables and read and write items in thos
You can change the Network whitelist and Amazon EC2 instance type.
On the Options page, choose Next.
For this walkthrough, you use the default settings.
On the Review page, select I acknowledge that this template might cause AWS CloudFormation to create IAM resources, and then choose Create.
This AWS CloudFormation template does not create IAM resources.
While the stack is deploying, you can monitor its progress by going to the AWS CloudFormation console and viewing the Status column for the Amazon EC2 instance.
When stack creation is complete, go to the Outputs tab of your new stack.
Copy the SSH tunnel command from the CloudFormation script Outputs and use it to create an SSH tunnel from your localhost port 8182 to the Gremlin Server port (8182) on the EC2 host after the stack deployment is complete.
Continue the To load a subset of the Marvel Universe Social Graph section in the previous topic starting from Step 5.
Now that you have the Gremlin Server on EC2, you can start working with Titan. Here are some options for continuing:
- Follow Titan Getting Started tutorial
Go to the Titan Getting Started documentation and then follow the rest of the setup process, starting from the Global Graph Indices section.
- Follow the Gremlin examples
To learn more about Gremlin, repeat the steps of this section and follow the examples in the Gremlin documentation.
You need to prepend each command with :> to remotely execute the commands on the Gremlin Server endpoint.
- Experiment with the Marvel graph
To work with the Marvel Social Graph data, repeat steps of this section and then follow steps 5 through 14 of the Marvel graph section.
- Learn more about the DynamoDB Storage Backend for Titan
For more information, start with the Storage in Local DynamoDB vs. the Amazon DynamoDB Service section.