This is a tutorial to build an HTAP service based on MySQL, MyDuck Server, and ProxySQL.
- Install
docker-compose
- On MacOS, please run
brew install docker-compose
. - On Linux, please do the following:
- Run
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
. - And then run
sudo chmod +x /usr/local/bin/docker-compose
.
- Run
- On MacOS, please run
Go the root path of this project and run the following commands:
cd devtools/htap-setup-mysql/proxysql
docker-compose up -d
Then you'll get a HTAP cluster. And an account 'lol' with password 'lol' has been created for connecting. Have fun!
The HTAP service can be accessed by
mysql -h127.0.0.1 -P16033 -ulol -plol
The status of ProxySQL can be checked by connecting to its admin interface:
mysql -h127.0.0.1 -P16032 -uradmin -pradmin --prompt='ProxySQL Admin> '
In the admin interface, you can check server status:
SELECT * FROM mysql_servers;
SELECT * FROM stats.stats_mysql_connection_pool;
ProxySQL will automatically route read queries to MyDuck Server. You can monitor the query distribution by checking:
SELECT * FROM stats.stats_mysql_commands_counters;
You can run docker-compose down
to clean up all resources after the trial.