mysql-proxy
mysql-proxy copied to clipboard
Cetus which originates from MySQL Proxy is a high performance, stable, protocol aware proxy for MySQL Group Replication.
Introduction
Cetus which originates from MySQL Proxy is a high performance, stable, protocol aware proxy for MySQL Group Replication.
Getting started
1. Prerequisites
- cmake
- gcc
- glib2-devel (version >= 2.6.0)
- zlib-devel
- flex
- mysql-devel 5.6 or mysql-devel 5.7 or mariadb-devel
- jemalloc
2. How to compile
- Go to the cetus_mgr directory
- mkdir build/
- cd build/
- CFLAGS='-O2 -w' cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-ljemalloc" -DCMAKE_INSTALL_PREFIX=/home/user/cetus_mgr_install
3. How to install
make install
4. How to run
- Go to /home/user/cetus_mgr_install/conf
- cp proxy.conf.example proxy.conf
- Modify proxy.conf
- cp users.json.example users.json
- Modify users.json
- cd ..
- ./bin/cetus --defaults-file=conf/proxy.conf
5. How to modify proxy.conf
- Modify proxy-backend-addresses to be the primary address of MySQL Group Replication
- Modify proxy-read-only-backend-addresses to be the secondary addresses of MySQL Group Replication
- Modify default-username to be the valid user name that could have the privileges of both manipulating MySQL Group Replication and MySQL.
- Modify log-file to be the valid file path.
- Modify worker-processes to be appropriate number that best suits the workload.
- Modify default-pool-size appropriately.
- Add group_replication_group_name appropriately.
- Add group-replication-mode=1 for single primary mode.
- Add backend-multi-write=true for multiple primary mode.
- Add session-causal-read=true for session causal reading under session_track_gtids=OWN_GTID in MySQL conf settings.
6. How to modify user.conf
Modify password appropriately for both your applications and MySQL.
Note
- Cetus runs only on Linux.
- Cetus could not be compiled under MySQL 8.0 development.
- Cetus only works for MySQL Group Replication.
- Cetus only supports mysql_native_password.
- As for MySQL Group Replication, please use the modified version which could be downloaded at https://github.com/session-replay-tools/percona-server-8.0.27-18 or https://github.com/session-replay-tools/MySQL-5.7.
- RESET MASTER before runing MySQL Group Replication
- Configure MySQL Group Replication before running cetus.
- The total num of connections to each MySQL is equal to default-pool-size plus worker-processes.
Bugs and feature requests:
If you encounter any issues with the release, I would encourage you to file a bug report. Your feedback is really critical to myself and the rest of the team as we want to make cetus better.