Connect to a deployment
TypeDB Cloud deployment is a cluster of TypeDB Enterprise servers. As such, it can receive connections from TypeDB Clients:
-
TypeDB Studio
-
TypeDB Console
-
TypeDB Drivers:
-
Java
-
Python
-
Node.js
-
To connect to a TypeDB Cloud deployment, we need the following information:
-
Address of at least one server in the deployment:
-
IP or domain name — generated for every server in a deployment by TypeDB Cloud.
-
Port number that the server is configured to listen to — by default, it’s
1729
.
-
-
Credentials of any user to authenticate on the server:
-
Username — by default, it’s
admin
. -
Password — by default, it’s
password
.
-
To get the address of the server in a deployment, use the following steps:
-
Open the deployment details page.
-
Find the
Address
column in the table in theMachines
section.
Ideally, we want to use all servers of the deployments cluster to connect to with a TypeDB Client. But if we set the address for only one server, TypeDB Client will get information on all servers in the cluster upon connection. |
Connection to a TypeDB Enterprise server requires valid credentials of a user existing on that server.
The user to connect to a TypeDB server/cluster is not the same user as a user on the TypeDB Cloud web portal. |
At this stage of alpha testing, all TypeDB Cloud deployments are created with the listening port of Username: |
Connection
-
TypeDB Studio
-
TypeDB Console
We can use the basic connection guide to connect to a TypeDB Cloud deployment with TypeDB Studio, but we need to select the TypeDB Cluster option in the drop-down menu at the Connect to TypeDB window. That will display additional options to set addresses for multiple servers in a cluster, username, password, and TLS encryption switch.
Use the Manage cluster addresses button to set the address of a server to connect.
Insert the TypeDB Cloud deployment server address (including the port number, for example, 127.0.0.1:1729
or rather
a242676f5710e462e9eed7a78d795ecb-1969767772.eu-west-2.elb.amazonaws.com:1729
) to the text field and press
the Add button.
For more information on using TypeDB Studio, see the TypeDB Studio and the Quickstart guide pages.
typedb console --cluster=<address> --username=admin --password=password --tls-enabled=true --tls-root-ca=<path_to_ca>
where:
-
<address>
— is the address of a server in the TypeDB Cloud installation we are connecting to, including the port number.
For example,deployment-78678ca6-afda-4792-b5b8-0cb6b540d8ee-0.deployment-78678ca6-afda-4792-b5b8-0cb6b540d8ee.cloud.typedb.com:1729
. -
admin
— is the default username for the default user. -
password
— is the default password for the default user. -
true
— is the TLS encryption setting. It’s true (enabled) by default. -
<path_to_ca>
— the path to the CA certificate.
typedb console --cluster=deployment-78678ca6-afda-4792-b5b8-0cb6b540d8ee-0.deployment-78678ca6-afda-4792-b5b8-0cb6b540d8ee.cloud.typedb.com:1729 --username=admin --password=password --tls-enabled=true --tls-root-ca=./typedb-cloud-root-ca.pem
As a result, we get a welcome message from TypeDB Console, and if the connection is successful, it’s followed by a command line prompt.
Welcome to TypeDB Console. You are now in TypeDB Wonderland!
Copyright (C) 2022 Vaticle
>
For more information on how to use TypeDB Console, see the TypeDB Console page.
- TypeDB Java Driver
Set<String> addresses = new HashSet<>(Arrays.asList("127.0.0.1:1729"));
TypeDBCredential credentials = new TypeDBCredential("admin", "password", Path.of("/server/conf/encryption/ext-root-ca.pem"));
try (TypeDBClient.Cluster client = TypeDB.clusterClient(addresses, credentials)) { ... }
For more information on the cluster client methods explore the TypeDB Java Driver API reference.
See the Java Driver tutorial page to learn more about using the library.
- TypeDB Python Driver
credentials = TypeDBCredential("admin", "password",
"/server/conf/encryption/ext-root-ca.pem")
client = TypeDB.cluster_client("127.0.0.1:1729", credentials)
For more information on the cluster client methods explore the TypeDB Python Driver API reference.
See the Python Driver tutorial page to learn more about using the library.
- TypeDB Node.js Driver
const client = await TypeDB.clusterClient(
["127.0.0.1:1729"],
new TypeDBCredential("admin", "password", "/server/conf/encryption/ext-root-ca.pem")
);
For more information on the cluster client methods explore the TypeDB Node.js Driver API reference.
See the Node.js Driver tutorial page to learn more about using the library.
What to do next?
Upon successful connection to a server in a TypeDB Cloud deployment, we can use the TypeDB Client we have used to send some queries to the server.
For example, complete our Quickstart guide with TypeDB Cloud deployment.
For more information, see the following:
-
TypeDB documentation for a general understanding of how to use TypeDB server,
-
TypeDB Clients documentation for information on how to use Driver API methods, TypeDB Studio GUI, or TypeDB Console CLI,
-
TypeQL documentation for an advanced understanding of building a query and using patterns.