Add a remote connection

To add a connection to a view, you must create a permission token for the remote view or repository and then add the connection to the local multi-cluster view.

  1. In the remote cluster go to the Settings for the view, select Tokens.

  2. Click + Add new. The New API token window appears. Give the token a name, and then select the Data read access token checkbox. Click Create token. The generated token is a random string of characters, for example:

    vaHxkz7gKHiNLKganfVQPGtIGKet9jW5~dxg83aJsA6p2jStEvM5z7GNWOl2X1Lu7apz15cR3OEd6

    Copy the token and keep it safe. The string will not be shown again. The generated token is specific to the view or repository where it was created. To share multiple views, create a token on each view that you want to access as part of a multi-cluster view.

To add the connection to the cluster, you will need the token as a parameter to the createRemoteClusterConnection() mutation in the cluster with the multi-cluster view:

graphql
mutation {
  createRemoteClusterConnection(
    input: {
      multiClusterViewName: "myMultiClusterView"
      publicUrl: "https://$REMOTE_LOGSCALE_URL/"
      token: "$REPO_TOKEN"
    }
  )
}

The required arguments are:

  • multiClusterViewName

    The name of the multi-cluster view in the local cluster.

  • publicUrl

    The URL of the cluster.

  • token

    The token for the remote view that you created in the previous steps. The token identifies the view, so you do not need to specify the view name.

You can add multiple remote connections. But you can add only one connection for each remote cluster. For more complex topologies, see Understand Multi-Cluster Topologies.

You can check whether a remote connection is valid before adding it. To do so, run the checkRemoteClusterConnection() query whose input is the same as the input you would use to add the connection:

graphql
query {
  checkRemoteClusterConnection(
    input: {
      multiclusterViewName: "myMultiClusterView"
      publicUrl: "https://$REMOTE_LOGSCALE_URL/"
      token: "$REPO_TOKEN"
    }
  ) {
    isValid
    errorMessage
    remoteViewName
    remoteServerVersion
    remoteServerCompatVersion
  }
}

If validation fails it will give an error message describing why. If it succeeds it will return information about the remote view and server.