Configuring a Routing Policy
Proxy instances support weighted and load balancing routing policies.
To configure a routing policy, you need to:
- Create a proxy instance. For details, see Creating a Proxy Instance.
- Select a routing policy by referring to this section.
Constraints
- To use the load balancing policy, the kernel versions of proxy instances must be 2.22.07.000 or later. To upgrade a kernel version, see Upgrading the Kernel Version of a Proxy Instance.
Procedure
- Log in to the management console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page, choose .
- On the Instances page, click the instance name to go to the Basic Information page.
- In the navigation pane on the left, choose Database Proxy.
- On the Database Proxy page, click the name of a proxy instance.
- On the Basic Information page, click Change next to Routing Policy.
- In the displayed dialog box, select a routing policy.
- Weighted: Read requests are assigned to nodes based on the weights you specify.
- Load balancing: Read requests are assigned to nodes with fewer active connections. In load balancing policy, you do not need to configure the weights of nodes.
The proxy mode of a proxy instance affects read requests assigned to different nodes.
- Read-only mode: All read requests are assigned to the selected read replica based on the routing policy and weights you specify, but not to the primary node.
- Read/write mode: All read requests are assigned to the selected nodes (including primary nodes and read replicas) based on the routing policy and weights you specify.
Figure 1 Changing the routing policy of a proxy instance in read/write modeFigure 2 Changing the routing policy of a proxy instance in read-only mode
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.