Deploying Grakn on Google Cloud Platform

GCP Marketplace

Deployment

We shall begin with deployment of a Grakn cluster. The procedure is straight-forward and takes advantage of the listing in the GCP Marketplace:

To start deployment, click on the Launch on Compute Engine button which will take you to the configuration screen

Feel free to adjust the settings to your needs.

Configuring firewall settings

Please pay extra attention to the Allow TCP port 48555 traffic tickbox as it allows the automatic addition of a suitable firewall rule to allow connecting to servers from outside the cluster via RPC. The tickbox location is highlighted below:

Should you decide to tick the box, please specify the allowed IP ranges to connect via the RPC port 48555. The field to control this can be found after clicking on the More roll as pictured below:

Finalising deployment

When satisfied with the configuration, press Deploy.

That is all! Your cluster deployment is now pending.

When the deployment is complete you should be able to see the post-deployment screen:

Running Grakn

A Grakn Cluster starts automatically running as user grakn. There is no need to manually start grakn servers. Once the deployment is started, please allow some time for the cluster to fully bootup and synchronise. A reasonable rule of thumb for the bootup time is 2 minutes per cluster node. The progress of cluster bootup can be checked by logging in to a cluster node and executing the cluster health check command.

User credentials

In order to use Graql and Grakn consoles, user credentials are required. The default user is grakn, whereas the default password can be found in the Google Deployments screen in the red circle:

Once logged in, We strongly encourage to change the default user password. In order to do so, log in to th Grakn console and type:

UPDATE USER grakn WITH PASSWORD newpassword

More details on available commands can be found here.

Connecting to Grakn

Using Grakn gRPC

To enable gRPC communication, traffic on TCP port 48555 needs to be allowed. It is not enabled by default. To create a suitable firewall rule, please execute the command in the red circle in your terminal:

This firewall setting is also available during the deployment stage.

Accessing Grakn

There are various ways to access Grakn in the cloud. Here we will address the most common usage patterns.

Logging in into a node

You may require a more direct interaction with the database. You need to log into a node to achieve that. To do so go back to the Google console and follow the red arrow as shown below to start an ssh session using the Open in browser window option.

Once logged in, a variety of interactions are possible through grakn and graql terminals.

Cluster health check

To check cluster health, execute the grakn cluster status command. The output shall look like this:

The command lists available servers and their state in the cluster.

Accessing the Graql console

To log into the Graql console, simply type graql console. After entering the user credentials you are free to interact with Grakn via the Graql terminal. A successful login attempt will look like this:

A summary of available commands can be found here.

Accessing the Grakn console

The Grakn console can be accessed similarly to Graql console by typing grakn console start and providing the user credentials. A successful login will look like this:

A summary of available commands can be found here.

Next Steps

Deploying Grakn KGMS on Google Cloud comes with our Enterprise Support. Please contact Support with your Support ID so we can create your account on our Support Platform.

If you want to learn more about Grakn KGMS, the Grakn Academy is a good place to start.

To learn more about running Grakn KGMS in the cloud, take a look at the best practices guide and post deployment steps.