---
schema_version: "1"
id: 540985cd4f76ff83ca5792ea471b05e6d04f250511c4e1ea634e1cc7d589dcf5
title: Setting Dedicated Load Balancer URLs for Anypoint Datagraph
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/datagraph/set-dlb.md
canonical_url: https://docs.mulesoft.com/datagraph/set-dlb
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7aa898c557e106601059bdc151516d8cf22d50bd553de8829e2d5909dce29932
description: MuleSoft Documentation Site
latest: true
---
---
product: DataGraph
---

# Setting Dedicated Load Balancer URLs for Anypoint Datagraph

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

If you’re unable to use Port 8082 on a CloudHub shared load balancer, you must set a URL for
Anypoint DataGraph to use on a dedicated load balancer (DLB).

To set the URL, add a DLB mapping rule to the Anypoint DataGraph configuration.

## Example Mapping Rules for a DLB URL

Based on the way DLB mapping rules work, you must configure the **Input Path** (Input URI) and the
**Output Path** (App URI) so that the final DLB URL is able to access the endpoint of the Anypoint
DataGraph application, which is `/graphql`.

For example, consider the following mapping rules for `examplelb.lb.anypointdns.net` depending on
the value of the **Input Path** and a Datagraph app name of `datagraph-xz082edx-1585-901xe374-d0x0`:

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Index</th><th>Input URI (Input Path)</th><th>App name</th><th>App URI (Output Path)</th><th>Protocol</th></tr></thead><tbody><tr><td><p>0</p></td><td><p><code>/graphql</code></p></td><td><p><code>datagraph-xz082edx-1585-901xe374-d0x0</code></p></td><td><p><code>/graphql</code></p></td><td><p>HTTPS</p></td></tr><tr><td><p>1</p></td><td><p><code>/datagraph/</code></p></td><td><p><code>datagraph-xz082edx-1585-901xe374-d0x0</code></p></td><td><p><code>/graphql</code></p></td><td><p>HTTPS</p></td></tr><tr><td><p>2</p></td><td><p><code>/datagraph/</code></p></td><td><p><code>datagraph-xz082edx-1585-901xe374-d0x0</code></p></td><td><p><code>/</code></p></td><td><p>HTTPS</p></td></tr><tr><td><p>3</p></td><td><p><code>/{app}/</code></p></td><td><p><code>{app}</code></p></td><td><p><code>/</code></p></td><td><p>HTTPS</p></td></tr></tbody></table>

For each index, the appropriate DLB URL is:

- Index 0: `examplelb.lb.anypointdns.net/graphql`

- Index 1: `examplelb.lb.anypointdns.net/datagraph/`

- Index 2: `examplelb.lb.anypointdns.net/datagraph/graphql`

- Index 3: `examplelb.lb.anypointdns.net/datagraph-xz082edx-1585-901xe374-d0x0/graphql`

## Prerequisites

- You must have the [Admin or Operator permission](https://docs.mulesoft.com/datagraph/permissions) for the environment in which you
  want to specify a DLB URL.

- You must be able to [authenticate to](https://docs.mulesoft.com/anypoint-cli/latest/#authentication) and run commands
  from the Anypoint CLI.

- You must be familiar with [creating DLB mapping rules](https://docs.mulesoft.com/cloudhub/lb-mapping-rules).

- You must
  [create and configure a DLB](https://docs.mulesoft.com/cloudhub/cloudhub-dedicated-load-balancer#create-and-configure-a-dedicated-load-balancer).

To complete this task, you:

1.  Use the Anypoint CLI to gather details about your DLB and Anypoint DataGraph.

2.  Use Anypoint Runtime Manager to create a mapping rule for the DLB.

3.  Use the Anypoint CLI to add the DLB configuration to Anypoint DataGraph.

## Gather Details about the DLB and Anypoint DataGraph

Gather the name of your DLB and the app name for Anypoint DataGraph.

1.  Connect to the Anypoint CLI using your Anypoint Platform username and password.

2.  If you did not previously set the environment, do so with the following command:

    - Using Anypoint CLI v3.x:

      `use environment <environment name>`

    - Using Anypoint CLI v4.x:

      `conf environment <environment name>`

3.  Get the name of the DLB:

    - Using Anypoint CLI v3.x:

      `cloudhub load-balancer describe <dlb name>`

    - Using Anypoint CLI v4.x:

      `cloudhub:load-balancer:describe <dlb name>`

      The expected output resembles:

      `Name | examplelb`

4.  Get the CloudHub domain for the Anypoint DataGraph app name:

    - Using Anypoint CLI v3.x:

      `datagraph load-balancer-config describe`

    - Using Anypoint CLI v4.x:

      `datagraph:load-balancer-config:describe`

      The expected value resembles:

      `Domain | datagraph-xz082edx-1585-901xe374-d0x0`

      The DataGraph app name contains elements from your org ID and the environment ID.

5.  Note the values for steps 3 and 4.

## Create a Mapping Rule for the DLB

You set up the mapping rule in Runtime Manager.

1.  From Anypoint Platform, select **Runtime Manager**.

2.  From the navigation menu, select **Load Balancers**.

3.  Click a load balancer name, and then click a certificate name.

    Ensure your load balancer has a valid, CA-signed certificate, or the browser won’t connect to
    Anypoint DataGraph.

4.  In the **URL Mapping Rules** section, click **Add New Rule**.

5.  Complete the fields with the following values:

    - **Input Path** (`inputUri`): The URI that the client requests: for example, `/{app}/`

    - **Target App** (`appName`): The domain for the Anypoint DataGraph application discovered in
      Step 4 of the gathering details task

    - **Output Path** (`appURI`): The URI string to pass to Anypoint DataGraph; for example `/` or
      `/graphql`

    - **Protocol** (`upstreamProtocol`): https

      Anypoint DataGraph supports only HTTPS.

## Add the DLB Configuration to Anypoint DataGraph

After you add the mapping rule, you configure the DLB for use with Anypoint Datagraph.

1.  Check the DLB URL for Anypoint DataGraph:

    - Using Anypoint CLI v3.x:

      ```copy
      datagraph load-balancer-config describe
      ```

    - Using Anypoint CLI v4.x:

      ```copy
      datagraph:load-balancer-config:describe
      ```

      By default, no value is returned for `dlbUrl` if you haven’t previously configured a DLB for
      that Anypoint DataGraph environment.

2.  Add the new DLB URL:

    - Using Anypoint CLI v3.x:

      ```copy
      datagraph load-balancer-config add <url>
      ```

    - Using Anypoint CLI v4.x:

      ```copy
      datagraph:load-balancer-config:add <url>
      ```

      Replace `<url>` with a valid URL that includes the DLB name and DataGraph app name (gathered
      in Steps 3 and 4 of the gathering details task) and the mapping rule **Input Path**, for
      example:

    - Using Anypoint CLI v3.x:

      ```copy
      datagraph load-balancer-config add examplelb.lb.anypointdns.net/datagraph/graphql
      ```

    - Using Anypoint CLI v4.x:

      ```copy
      datagraph:load-balancer-config:add examplelb.lb.anypointdns.net/datagraph/graphql
      ```

      Refer to [Example Mapping Rules for a DLB URL](#example-mapping-rules-for-a-dlb-url) if
      needed.

3.  Validate that the value was updated:

    - Using Anypoint CLI v3.x:

      ```copy
      datagraph load-balancer-config describe
      ```

    - Using Anypoint CLI v4.x:

      ```copy
      datagraph:load-balancer-config:describe
      ```

      The CLI returns details that include the application name for the Anypoint DataGraph load
      balancer and the full domain name for the DLB.

After you add this change, Anypoint DataGraph re-deploys, and you must wait for the status indicator
to indicate that Anypoint DataGraph is up to date.

## Remove the DLB Configuration from Anypoint DataGraph

You can remove the DLB configuration using the following command:

- Using Anypoint CLI v3.x:

  ```copy
  datagraph load-balancer-config remove
  ```

- Using Anypoint CLI v4.x:

  ```copy
  datagraph:load-balancer-config:remove
  ```

  When you remove the configuration, Anypoint DataGraph redeploys.

## Additional Resources

- [Anypoint DataGraph Hosting Options and Networking](https://docs.mulesoft.com/datagraph/hosting-options)

- [Add an API Schema to the Unified Schema](https://docs.mulesoft.com/datagraph/add-api-to-unified-schema)

- [DataGraph CLI](https://docs.mulesoft.com/datagraph/datagraph-cli)
