---
title: "Link a PostgreSQL TimescaleDB cluster to a dedicated server"
sidebar_label: "Link a cluster to a dedicated server"
sidebar_position: 20
description: "How to link a PostgreSQL TimescaleDB cluster to a dedicated server"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import {TabItemLabel} from '@selectel/docux/components'
import CreateGlobalRouter from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/global-router/create-global-router.mdx'
import ConnectDedicatedNetworkToGlobalRouter from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/global-router/connect-dedicated-network-to-global-router.mdx'
import ConnectCloudNetworkToGlobalRouter from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/global-router/connect-cloud-network-to-global-router.mdx'
import ConfigureNetworkInterfaceOfPrivateNetwork from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/dedicated/configure-network-interface-of-private-network.mdx'
import WriteStaticRoutesDedicated from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/global-router/write-static-routes-dedicated.mdx'

# Link a PostgreSQL TimescaleDB cluster to a dedicated server

:::info

Some dedicated server configurations [Chipcore Line](/dedicated/order/dedicated-configurations.mdx#prebuilt-servers) cannot be added to a global router network because they lack a port for connecting to a private network. You can check for the availability of a private network port in the [Control panel](https://my.selectel.ru/servers/servers/) on the server page under the **Ports**.

:::

1. [Create a global router](#create-global-router).
2. [Connect a network and subnet to the global router up to the dedicated server VLAN](#connect-network-and-subnet-to-router-up-to-dedicated-server-vlan).
3. [Connect a network and subnet to the global router up to the Managed Database project](#connect-network-and-subnet-to-router-up-to-cloud-platform-project).
4. [Assign IP addresses from the created subnets to a dedicated server](#assign-ip-to-dedicated-server).
5. [Specify routes on the dedicated server](#write-routes-on-dedicated-server).
6. [Create a Managed Database cluster](#create-managed-database-cluster): new or from a backup of an existing Managed Database cluster.

See an [example of network organization](#example-of-network-organization-between-managed-database-and-dedicated-server) between a dedicated server and a Managed Database.

## Example of network organization between a Managed Database and a dedicated server \{#example-of-network-organization-between-managed-database-and-dedicated-server}

If you need to configure private connectivity between a dedicated server in the SPB-2 pool and a new Managed Database in the ru-2 pool:

1. Create a global router.
2. Connect two private subnets to the router — `192.168.0.0/29` with a gateway of `192.168.0.1` for the SPB-2 pool and `172.16.0.0/29` with a gateway of `172.16.0.1` for the ru-2 pool.
3. Assign an address from the `192.168.0.0/29` subnet to a dedicated server, for example, `192.168.0.2`.
4. Specify routes on the dedicated server in the SPB-2 pool — to the `172.16.0.0/29` subnet via the `192.168.0.1`.
5. Create a new Managed Database cluster on subnet `172.16.0.0/29`.

![](https://423.selcdn.ru/kb/globalrouter-dbaas-create-network-database-to-dedicated-server-example-LANG-THEME.png)

## 1. Create a global router \{#create-global-router}

<CreateGlobalRouter />

## 2. Connect a network and subnet to the global router to the dedicated server VLAN \{#connect-network-and-subnet-to-router-up-to-dedicated-server-vlan}

<ConnectDedicatedNetworkToGlobalRouter />

## 3. Connect a network and subnet to the global router to the Cloud Platform project \{#connect-network-and-subnet-to-router-up-to-cloud-platform-project}

<ConnectCloudNetworkToGlobalRouter />

## 4. Assign an IP address to the dedicated server \{#assign-ip-to-dedicated-server}

Configure the local port on the dedicated server that is included in the global router network. Assign an IP address to the port from the private subnet that you [connected to the global router in step 2](#connect-network-and-subnet-to-router-up-to-dedicated-server-vlan).

<ConfigureNetworkInterfaceOfPrivateNetwork />

## 5. Specify a route on the dedicated server \{#write-routes-on-dedicated-server}

On the server, you must specify a static route to the Cloud Platform subnet that you [connected to the global router in step 3](#connect-network-and-subnet-to-router-up-to-cloud-platform-project).

<WriteStaticRoutesDedicated />

## 6. Create a Managed Database cluster \{#create-managed-database-cluster}

<Tabs queryString="create-managed-database-cluster">
  <TabItem value="new-cluster" default>
    <TabItemLabel>
      New
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/dbaas/), click **Products** in the top menu and select **Managed Databases**.

    2. Click **Create cluster**.

    3. Enter the cluster name.

    4. Select a [location](/infrastructure/locations.mdx). You will not be able to change the location after creation.

    5. Select a DBMS — TimescaleDB.

    6. Select a [PostgreSQL TimescaleDB version](/managed-databases/timescaledb/configurations.mdx#versions). You will not be able to change the version after creation.

    7. Select a [configuration line](/managed-databases/timescaledb/configurations.mdx#configuration-lines) and specify the number of vCPUs, RAM size, and disk size.

       After creating the cluster, you can change the node configuration — [scale the cluster](/managed-databases/timescaledb/resize-cluster.mdx).

    8. Optional: to configure [cluster fault tolerance](/managed-databases/timescaledb/cluster-fault-tolerance.mdx), specify the number of nodes in the cluster in the **Fault tolerance** block. The first node is the master node, and the others are replicas. For a multi-node cluster, the [SLA](https://files.selectel.ru/docs/ru/conditions-cloud-platform.pdf) applies — we guarantee 99.95% write availability and 99.99% read availability.

    9. Select the subnet that you [connected to the global router in step 3](#connect-network-and-subnet-to-router-up-to-cloud-platform-project).

       You can [restrict the list of addresses](/managed-databases/timescaledb/network-access-control.mdx) from which access to the database cluster will be allowed.

    10. Optional: in a private subnet, you can connect a public IP address to a cluster node. Select the **Public access to cluster nodes** checkbox, and then the checkbox for the node to which you want to provide public access. The private subnet must meet the [requirements](/managed-databases/timescaledb/public-ip.mdx#requirements).

    11. Select a [pooling mode](/managed-databases/timescaledb/connection-pooler.mdx#pooling-modes):

        * transaction — a connection is assigned to a client for the duration of a transaction;
        * session — a connection is assigned as long as the client is connected;
        * statement — transactions with multiple statements are prohibited.

    12. Select a [pool size](/managed-databases/timescaledb/connection-pooler.mdx#pool-size).

    13. Optional: change the [DBMS settings](/managed-databases/timescaledb/settings.mdx); to do this, click **Change**. We recommend changing setting values only when necessary — incorrectly selected values may reduce cluster performance.

    14. Check the cluster price.

    15. Click **Create cluster**. The cluster will be ready for use when it switches to the `ACTIVE`.
  </TabItem>

  <TabItem value="cluster-from-backup">
    <TabItemLabel>
      From backup
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/dbaas/), click **Products** in the top menu and select **Managed Databases**.

    2. Click **Create cluster**.

    3. Select the [location](/infrastructure/locations.mdx) where the existing Managed Database cluster is located.

    4. Select the **Restore cluster from backup** checkbox.

    5. Select an existing Managed Database cluster.

    6. Select how to restore the cluster — from the latest available backup or to a specific point in time from the last 7 days.

    7. Click **Continue**.

    8. Select a [configuration line](/managed-databases/timescaledb/configurations.mdx#configuration-lines) and specify the number of vCPUs, RAM size, and disk size.

       After creating the cluster, you can change the node configuration — [scale the cluster](/managed-databases/timescaledb/resize-cluster.mdx).

    9. Optional: select the **Add replicas** checkbox and specify the number of replicas. Replicas increase cluster fault tolerance.

    10. Select the subnet that you [connected to the global router in step 3](#connect-network-and-subnet-to-router-up-to-cloud-platform-project).

        You can [restrict the list of addresses](/managed-databases/timescaledb/network-access-control.mdx) from which access to the database cluster will be allowed.

    11. Select a [connection pooler mode](/managed-databases/timescaledb/connection-pooler.mdx):

        * transaction — a connection is assigned to a client for the duration of a transaction;
        * session — a connection is assigned as long as the client is connected;
        * statement — transactions with multiple statements are prohibited.

    12. Optional: change the [DBMS settings](/managed-databases/timescaledb/settings.mdx); to do this, click **Change**. We recommend changing setting values only when necessary — incorrectly selected values may reduce cluster performance.

    13. Click **Create cluster**.

    14. After restoring the cluster, the node addresses will change — update them in your application.
  </TabItem>
</Tabs>

<Formbricks />
