Skip to main content

Link a PostgreSQL TimescaleDB cluster to a dedicated server

For your information

Some dedicated server configurations of Chipcore Line cannot be added to a global router network because they do not have a port for connecting to a private network. You can check for a private network port in the control panel on the server page on the Ports tab.

  1. Create a global router.
  2. Connect a network and subnet to the global router up to the dedicated server VLAN.
  3. Connect a network and subnet to the global router up to the Cloud Platform project.
  4. Assign IP addresses from the created subnets to the dedicated server.
  5. Configure routes on the dedicated server.
  6. Create a Managed Database cluster: a new one or from a backup of an existing Managed Database cluster.

See an example of network setup between a dedicated server and a managed database.

Example of network organization between a Managed Database and a 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 gateway 192.168.0.1 for the SPB-2 pool and 172.16.0.0/29 with gateway 172.16.0.1 for the ru-2 pool.
  3. Assign an address from the 192.168.0.0/29 subnet to the dedicated server, for example, 192.168.0.2.
  4. Configure routes on the dedicated server in the SPB-2 pool — to the subnet 172.16.0.0/29 via the gateway 192.168.0.1.
  5. Create a new Managed Database cluster in the 172.16.0.0/29 subnet.

1. Create a global router

  1. In the control panel, in the top menu, click Products and select Global Router.
  2. Click Create router. Each account has a limit of five global routers.
  3. Enter the router name.
  4. Click Create.
  5. If the router was created with the status ERROR or is stuck in one of the statuses, create a ticket.

2. Connect a network and subnet to the global router to the dedicated server VLAN

You can connect a new network to the router or an existing network if it is not already connected to any of the account's global routers.

  1. In the Control panel, from the top menu, click Products and select Global Router.

  2. Open the router page → Networks tab.

  3. Click Create network.

  4. Enter a network name. It will only be used in the control panel.

  5. Select the Servers and hardware service.

  6. Select the location of the network.

  7. Select or enter a VLAN.

  8. If you want to create a network to an internal segment (Q-in-Q), specify its tag — a number from 2 to 4094. If a network already exists for the VLAN, you must specify the Q-in-Q segment of this VLAN.

  9. Enter a subnet name. It will only be used in the control panel.

  10. Enter the CIDR — the IP address and mask of the private subnet. You can enter a new subnet or an existing private server subnet if it has not yet been added to any of the global routers in the account. The subnet must meet the following conditions:

    • belong to the RFC 1918 private address range: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16;
    • have a size of at least /29, because three addresses will be occupied by Selectel network equipment;
    • do not overlap with other subnets added to this router — there must be no identical IP addresses within subnets on the same router;
    • if a Managed Kubernetes cluster on cloud servers is connected to the global router network, the subnet must not overlap with the ranges 10.10.0.0/16, 10.96.0.0/12, 10.250.0.0/16, and 10.251.0.0/24. If a cluster on dedicated servers is connected to the network — with the ranges 10.10.0.0/16, 10.222.0.0/16, 10.250.0.0/16, 10.251.0.0/24, and 172.250.0.0/14. These subnets are used in Managed Kubernetes internal addressing, and their use may lead to conflicts in the global router network.
  11. Enter the gateway IP or leave the first address from the subnet, which is assigned by default. Do not assign this address to your devices to avoid network disruption.

  12. Enter the service IPs or leave the last addresses from the subnet, which are assigned by default. Do not assign these addresses to your devices to avoid network disruption.

  13. Click Create network.

  14. Optional: check the network topology on the global router. In the Control panel, from the top menu, click Products → Global Router → router page → Network map.

  15. If you specified a Q-in-Q tag in step 8, enable Q-in-Q on the switch port and configure the network interface of the private network specified in step 10. Learn more in the Configure Q-in-Q section of the Q-in-Q instructions.

3. Connect a network and subnet to the global router to the Cloud Platform project

You can connect a new or existing network to the router if it is not already connected to any of the account's global routers.

  1. In the control panel, in the top menu, click Products and select Global Router.

  2. Open the router page → the Networks tab.

  3. Click Create network.

  4. Enter a network name. It will only be used in the control panel.

  5. Select the Cloud Platform service.

  6. Select the location of the network.

  7. Select a project.

  8. Enter a subnet name. It will only be used in the control panel.

  9. Enter the CIDR — IP address and subnet mask. The subnet must meet the following conditions:

    • belong to the private address range according to RFC 1918: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16;
    • have a size of at least /29, because three addresses will be occupied by Selectel network equipment;
    • it does not overlap with other subnets added to this router — there must be no identical IP addresses within the subnets of one router;
    • if a Managed Kubernetes cluster on cloud servers is to be added to the global router network, the subnet must not overlap with the ranges 10.10.0.0/16, 10.96.0.0/12, 10.250.0.0/16, and 10.251.0.0/24. If a cluster on dedicated servers is to be added to the network — with the ranges 10.10.0.0/16, 10.222.0.0/16, 10.250.0.0/16, 10.251.0.0/24, and 172.250.0.0/14. These subnets participate in Managed Kubernetes internal addressing, and using them may lead to conflicts in the global router network.
  10. Enter the gateway IP or leave the first address from the subnet, which is assigned by default. Do not assign this address to your devices to avoid disrupting network operation.

  11. Enter the service IPs or leave the last addresses from the subnet, which are assigned by default. Do not assign these addresses to your devices to avoid disrupting network operation.

  12. Click Create network.

  13. Optional: check the network topology on the global router. In the control panel, in the top menu, click Products → Global Router → router page → Network map.

4. Assign an IP address to the dedicated server

Configure a local port on the dedicated server that connects to the global router network. Assign an IP address from the private subnet that you connected to the global router in step 2 to the port.

  1. Connect to the server via SSH or via the KVM console.

  2. Open the netplan utility configuration file with the vi text editor:

    vi /etc/netplan/01-netcfg.yaml
  3. Add or change the values of the private network interface settings:

    <eth_name>:
    addresses: [<ip_address>]

    Specify:

    • <eth_name> – private network interface name;
    • <ip_address> – private IP address of the server with a subnet mask, for example, 192.168.0.2/24.
  4. Press ESC.

  5. Exit the vi text editor, saving the changes:

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.

  8. Optional: assign a private IP address to the server in the Control Panel.

5. Specify a route on the dedicated server

On the server, configure a static route to the Cloud Platform subnet that you connected to the global router in step 3.

  1. Connect to the server.

  2. Open the network configuration file:

    vi /etc/netplan/01-netcfg.yaml
  3. At the end of the data block for the required network interface, add the route:

    routes:
    - to: <ip_address>/<mask>
    via: <gateway>

    Specify:

    • <ip_address>/<mask> — subnet to which the route is needed, specifying the mask, for example 192.168.0.0/28;
    • <gateway> — gateway for the subnet of the current server specified on the global router.
  4. If you need to define multiple routes, add them sequentially in the same block, for example:

    routes:
    - to: 192.168.0.0/28
    via: 172.16.0.1
    - to: 192.168.1.0/28
    via: 172.16.0.1
  5. Save the file.

  6. Check the settings:

    sudo netplan try
  7. Apply the changes:

    netplan apply

6. Create a Managed Database cluster

  1. In the control panel, in the top menu, click Products and select Managed Databases.

  2. Click Create cluster.

  3. Enter the cluster name.

  4. Select a location. The location cannot be changed after creation.

  5. Select a DBMS — TimescaleDB.

  6. Select the PostgreSQL TimescaleDB version. The version cannot be changed after creation.

  7. Select a configuration line and specify the number of vCPUs, RAM size, and disk size.

    After creating the cluster, you can change the node configuration — scale the cluster.

  8. Optional: to configure cluster fault tolerance, in the Fault tolerance block, specify the number of nodes in the cluster. The first node is the master node, the rest are replicas. An SLA applies to multi-node clusters — 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.

    You can restrict the list of addresses allowed to access the database cluster.

  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, then select the checkbox of the node you want to provide public access to. The private subnet must meet the requirements.

  11. Select a pooling mode:

    • 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 the pool size.

  13. Optional: change the DBMS settings by clicking Edit. We recommend changing setting values only if necessary — incorrectly configured values can degrade cluster performance.

  14. Check the cluster price.

  15. Click Create cluster. The cluster will be ready for use when its status changes to ACTIVE.