Public IP address in a Redis cluster
A public IP address is a static public IP address assigned to a node to configure access to the node in a private network from the Internet. External traffic passes through the public IP address and is processed by a cloud router that functions as 1:1 NAT. The address is a floating IP because it can automatically switch when the role changes from replica to master and vice versa. It will not change or be deleted from the control panel.
The private subnet where you can assign a public IP address must meet the requirements — before adding a public IP address, prepare the subnet.
You can add a public IP address:
when creating a cluster in an existing private subnet;
or in an existing cluster that is located in a private subnet.
The number of public IP addresses in a cluster can be less than the number of nodes in a group, but it cannot exceed it. If necessary, you can detach a public IP address.
Requirements for a private subnet
- The subnet must have a cloud router with an Internet connection;
- The cloud router IP address must be the default gateway in the subnet.
If the subnet does not meet the requirements, prepare it for connecting a public IP address.
Prepare a private subnet for connecting a public IP address
1. Create a cloud router with an Internet connection
A cloud router allows you to route traffic between private networks.
The router can be used to set up Internet access from a private network or to access a device in a private subnet from the Internet via a public IP address.
- In the control panel, on the top menu, click Products and select Cloud Servers.
- Go to Network → tab Cloud Routers.
- Click Create Router.
- Select the location where the cloud router will be created.
- Enter a router name.
- Select the Connect router to the Internet checkbox — an external IP address will be allocated for the router.
- Click Create.
2. Connect a private network to a cloud router
- In the control panel, on the top menu, click Products and select Cloud Servers.
- Go to Network → tab Cloud Routers.
- Open the router card.
- Click Add Subnet.
- Select a private subnet.
- Optional: enter the router IP address. If you do not specify an IP address, one will be automatically selected from the available addresses in the subnet. The cloud router IP address must match the default gateway of the private subnet. The gateway can be viewed in the control panel: in the top menu, click Products → Cloud Servers → Network → tab Private networks → network page → tab Subnets → subnet card → block Automatic network settings → field Subnet gateway.
- Click Add Subnet.
Connect a public IP address
- Make sure the cluster is in a private subnet that meets the requirements.
- In the control panel, on the top menu, click Products and select Managed Databases.
- Open the Active tab.
- Open the database cluster page → tab Settings.
- In the Node addresses and statuses block, in the row with the required node, click Connect public IP.
- Click Connect.
Detach a public IP address
- In the control panel, on the top menu, click Products and select Managed Databases.
- Open the Active tab.
- Open the database cluster page → tab Settings.
- In the Node addresses and statuses block, in the row with the required node, click .
- Click Delete.