From 890d31289f21146557a4d849f9eaf0ab5851737d Mon Sep 17 00:00:00 2001 From: Marcelo Altmann Date: Tue, 13 Aug 2024 16:14:12 -0300 Subject: [PATCH] Add build images and configuration files This commit adds the docker-compose.yml file to build the environment required to run the tests and the proxysql.cnf file to configure the ProxySQL instance. --- build/docker-compose.yml | 29 +++++++++++++++++++++++++++++ build/proxysql.cnf | 30 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 build/docker-compose.yml create mode 100644 build/proxysql.cnf diff --git a/build/docker-compose.yml b/build/docker-compose.yml new file mode 100644 index 0000000..be77a80 --- /dev/null +++ b/build/docker-compose.yml @@ -0,0 +1,29 @@ +version: "3.8" +services: + proxysql: + image: proxysql/proxysql + ports: + - "6033:6033" + - "6032:6032" + volumes: + - ./proxysql.cnf:/etc/proxysql.cnf + mysql-master: + image: mysql:8.0 + container_name: mysql-master + environment: + - MYSQL_ROOT_PASSWORD=noria + - MYSQL_DATABASE=noria + command: --server-id=1 + ports: + - "3306:3306" + readyset: + image: readysettech/readyset + container_name: readyset + environment: + - UPSTREAM_DB_URL=mysql://root:noria@mysql-master:3306/noria + - LISTEN_ADDRESS=0.0.0.0:3307 + ports: + - "3307:3307" + - "6034:6034" + depends_on: + - mysql-master diff --git a/build/proxysql.cnf b/build/proxysql.cnf new file mode 100644 index 0000000..a45afd7 --- /dev/null +++ b/build/proxysql.cnf @@ -0,0 +1,30 @@ +admin_variables= +{ + admin_credentials="admin:admin;radmin:radmin" +} + +# defines all the MySQL servers +mysql_servers = +( + { address="host.docker.internal" , port=3306 , hostgroup=1, comment="Source" }, + { address="host.docker.internal" , port=3307 , hostgroup=2, weight=1000, comment="Readyset" }, + { address="host.docker.internal" , port=3306 , hostgroup=2, weight=1, comment="Source" } +) + +mysql_variables= +{ + monitor_username="root" + monitor_password="noria" +} + +mysql_users: +( + { + username = "root" + password = "noria" + default_hostgroup = 1 + max_connections=1000 + default_schema="noria" + active = 1 + } +)