Giter VIP home page Giter VIP logo

proxysql-watcher's Introduction

Very basic and experimental watcher for ProxySQL: https://github.com/sysown/proxysql

Watcher monitors changes to specific Etcd prefix and populates those changes to ProxySQL.

For now a lot of values are hardcoded.

Use at your own risk!

How to use

Create k8s configmap percona-config:

kind: ConfigMap
apiVersion: v1
metadata:
  name: percona-config
data:
  mysql-root-password: "JdUDnZyTsL"
  discovery-service: "etcd-client:2379"
  cluster-name: "k8scluster"
  xtrabackup-password: "p9jwtcv3WX"
  mysql-proxy-user: "proxyuser"
  mysql-proxy-password: "XTg1o9g8aP"

Create proxysql-watcher replication controller: kubectl create -f proxysql-watcher.yaml

Run tests (using sysbench):

sysbench --num-threads=4 --max-time=20 --test=oltp --db-ps-mode=disable
--mysql-user='proxyuser' --mysql-password='XTg1o9g8aP' --oltp-table-size=10000
--mysql-host=pxc-service --mysql-port=3306 prepare
sysbench --num-threads=4 --max-time=20 --test=oltp --db-ps-mode=disable
--mysql-user='proxyuser' --mysql-password='XTg1o9g8aP' --oltp-table-size=10000
--mysql-host=pxc-service --mysql-port=3306 run

How it works?

Watcher monitors prefix in Etcd, where Percona nodes store their status. After the node is created and started, watcher configures permissions for mysql-proxy-user and adds new server to ProxySQL.

How to test

I've included monkey.py which is able to randomly destroy pods. Use it on your own risk!

proxysql-watcher's People

Contributors

amnk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

holser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.