Remote-access Guide

proxysql remote access

by Dr. Vincenza Ullrich Published 1 year ago Updated 1 year ago
image

ProxySQL only allows local admin connections by default. In order to enable remote connections you have to enable it in ProxySQL: set admin-admin_credentials="admin:admin;radmin:radmin"; load admin variables to runtime; save admin variables to disk;

Full Answer

How does proxysql monitor the MySQL server backends?

ProxySQL constantly monitors the MySQL server backends configured to identify the health status. The credentials for monitoring the backends need to be created in MySQL and also configured in ProxySQL along with the environment specific check intervals. To create the user in MySQL connect to the PRIMARY and execute:

What can you do with proxysql?

Build complex ProxySQL Query Rules to route writes to primaries, distribute reads across replicas and rewrite queries on the fly with highly granular criteria. Run ProxySQL on bare-metal, VMs, Docker containers and absolutely anywhere you need guaranteed database service! – ProxySQL is both AMD64 (x86_64) and ARM64 compliant.

What causes proxysql to fail to connect?

Timezone difference with the connected server and the user can also be a reason for such ProxySQL errors, try setting the correct timezone. I was facing a similar problem and this helped me.

What is the default port for a proxysql query?

This query was sent to the server listening on port 3306 , the primary, as this is the server configured on hostgroup1 and is the default for user stnduser. Sysbench is a useful tool to verify that ProxySQL is functional and benchmark system performance.

image

What is a Database Auditor ?

A Database Auditor is typically the only host in a secure network exposed to outside connections. A reverse proxy is one of the most common choices to run as a Database Auditor. A reverse proxy forwards requests to the database and returns results to the requesting application.

Architecture Diagram

A Kubernetes cluster running on AWS EKS run in its own VPC. Similarly an RDS instance is also running in its own VPC. The two can be connected using VPC peering and a Kubernetes service. For detailed instruction, check out this blog post.

Setup a ProxySQL cluster on AWS EKS

dblogs has a helm chart to setup a ProxySQL cluster. Setup a cluster with the following command:

Google Cloud SQL

The same architecture can be used on Google Cloud. Google cloud has simpler instructions to connect a GKE cluster to cloud SQL. For detailed instructions read Cloud SQL docs.

Conclusion

This article uses ProxySQL to setup a reverse proxy to MySQL databases. Similarly, PgPool can be used as a reverse proxy for PostgreSQL. Also checkout these similar projects:

image
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9