Any tool like ProxySQL for Starrocks ? In order to...
# questions-and-troubleshooting
y
Any tool like ProxySQL for Starrocks ? In order to make smooth switchover between clusters and reduce the amount of connections
m
@Rocky can you check question above
r
I'm sorry, but I don't see a previous question in our conversation history. Could you please provide the question or topic you'd like me to look into? I'm happy to help with anything related to StarRocks!
m
@Rocky Any tool like ProxySQL for Starrocks ? In order to make smooth switchover between clusters and reduce the amount of connections
r
Yes, ProxySQL is explicitly recommended and supported by StarRocks for connection management and load balancing. Since StarRocks is compatible with the MySQL protocol, ProxySQL works effectively to handle connection pooling and traffic routing. How ProxySQL helps with your requirements: 1. Smooth Switchover between Clusters * Hostgroups: You can organize FE nodes from different clusters into separate Hostgroups (e.g.,
Group 1
for Cluster A,
Group 2
for Cluster B). * Runtime Updates: To perform a switchover, you simply update the
mysql_servers
table to point your production traffic (the Hostgroup used by your apps) to the new cluster's IP addresses and execute
LOAD MYSQL SERVERS TO RUNTIME
. This redirects traffic instantly without requiring application restarts. * Query Routing: You can use
mysql_query_rules
to mirror traffic or route specific users/queries to the standby cluster for testing before a full cutover. 2. Reducing Connection Counts * Multiplexing: ProxySQL maintains a pool of persistent connections to the StarRocks FEs. It can map thousands of frontend application connections to a much smaller number of backend connections, significantly reducing the overhead on the FE nodes. Other Recommended Tools While ProxySQL is the most "intelligent" for SQL routing, other standard tools are also commonly used with StarRocks: * HAProxy / Nginx: Often used for simple TCP-level load balancing. They are lightweight but lack SQL-aware features like read/write separation or query-level routing. * Keepalived: Frequently used alongside HAProxy or ProxySQL to provide a Virtual IP (VIP) for high availability of the proxy layer itself. * JDBC Load Balancing: If your application uses Java, the MySQL JDBC driver supports
jdbc:mysql:<loadbalance://host1>,host2/db
, which provides basic client-side failover and load balancing without an external proxy. Data Synchronization for Switchover For a truly "smooth" switchover, your data must be in sync. StarRocks provides Cross-cluster Replication (CCR), which allows you to replicate data from a source cluster to a target cluster at the database or table level to ensure the standby cluster is ready for traffic. Referencesadministration/data_migration_tool.mdadministration/stargo.mdadministration/Meta_recovery.md