GithubHelp home page GithubHelp logo

michaeldg / proxysql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jubunel/proxysql

0.0 1.0 0.0 95 KB

This role installs and configures ProxySQL 2 - the high performance, high availability, protocol aware proxy for MySQL.

License: BSD 3-Clause "New" or "Revised" License

Shell 29.26% Jinja 70.74%

proxysql's Introduction

PROJECT HAS MOVED TO GITLAB

Hi,

I have moved my fork to my gitlab group where I have all my (open source) roles in the MariaDB/MySQL ecosystem. This means I will not publish changes here anymore.

You can find the repository here: https://gitlab.com/de-groot-consultancy-ansible-roles/proxysql

Michaël

proxysql

Currently this role is compatible with ProxySQL v2

Requirements

Ansible 2.5 minimum

Role Variables

The variables that can be passed to this role. For all variables, take a look at defaults/main.yml.

# defaults file for proxySQL
proxysql_cnf_path: '/etc'
proxysql_template: 'proxysql.cnf.j2'

# admin variables
proxysql_admin_credentials: 'admin:admin'
proxysql_admin_ifaces: '0.0.0.0:6032'
proxysql_admin_refresh_interval: 2000

# mysql variables
proxysql_mysql_threads: 4
proxysql_mysql_max_connections: 2048
proxysql_mysql_default_query_delay: 0
proxysql_mysql_default_query_timeout: 36000000
proxysql_mysql_have_compress: true
proxysql_mysql_poll_timeout: 2000
proxysql_mysql_interfaces: '0.0.0.0:6033' #0.0.0.0:6033;/tmp/proxysql.sock 
proxysql_mysql_default_schema: 'information_schema'
proxysql_mysql_stacksize: 1048576 
proxysql_mysql_server_version: '5.5.30'
proxysql_mysql_connect_timeout_server: 3000
proxysql_mysql_monitor_username: 'monitor'
proxysql_mysql_monitor_password: 'monitor'
proxysql_mysql_monitor_history: 600000
proxysql_mysql_monitor_connect_interval: 60000
proxysql_mysql_monitor_ping_interval: 10000
proxysql_mysql_monitor_read_only_interval: 1500
proxysql_mysql_monitor_read_only_timeout: 500
proxysql_mysql_ping_interval_server_msec: 120000
proxysql_mysql_ping_timeout_server: 500
proxysql_mysql_commands_stats: true
proxysql_mysql_sessions_sort: true
proxysql_mysql_connect_retries_on_failure: 10

# define all MySQL servers
proxysql_mysql_servers: []
  # - address: "127.0.0.1" # no default, required . If port is 0 , address is interpred as a Unix Socket Domain
  #	  port: 3306           # no default, required . If port is 0 , address is interpred as a Unix Socket Domain
  #	  hostgroup: 0	        # no default, required
  #	  status: "ONLINE"     # default: ONLINE
  #	  weight: 1            # default: 1
  #	  compression: 0       # default: 0
  #   max_replication_lag: 10  # default 0 . If greater than 0 and replication lag passes such threshold, the server is shunned
  #   max_connections: 200

# defines all the MySQL users
proxysql_mysql_users: []
  # - username: "username" # no default , required
  #   password: "password" # default: ''
  #		default_hostgroup: 0 # default: 0
  #		active: 1            # default: 1
  #		max_connections: 1000
  #		default_schema: "test"

# defines MySQL Query Rules
proxysql_mysql_query_rules: []
  # -	rule_id: 1
  #		active: 1
  #		match_pattern: "^SELECT .* FOR UPDATE$"
  #		destination_hostgroup: 0
  #		apply: 1
  
  #	-	rule_id: 2
  #		active: 1
  #		match_pattern: "^SELECT"
  #		destination_hostgroup: 1
  #		apply: 1


proxysql_scheduler: []
  # - id: 1
  #   active: 0
  #   interval_ms: 10000
  #   filename: "/var/lib/proxysql/proxysql_galera_checker.sh"
  #   args:
  #     - "0"
  #     - "1"
  #     - "0"
  #     - "1"
  #     - "/var/lib/proxysql/proxysql_galera_checker.log"

proxysql_mysql_replication_hostgroups: []
# - writer_hostgroup: 30
#   reader_hostgroup: 40
#   comment: "test repl 1"
#                
# - writer_hostgroup: 50
#   reader_hostgroup: 60
#   comment: "test repl 2"

proxysql_mysql_galera_hostgroups: []
# - writer_hostgroup: 60
#   backup_writer_hostgroup: 61
#   reader_hostgroup: 70
#   offline_hostgroup: 79
#   health_check_enabled: True
#   health_check_port: 9200
#   health_check_type: galera
#   comment: "Galera cluster 1"
#                
# - writer_hostgroup: 80
#   backup_writer_hostgroup: 81
#   reader_hostgroup: 90
#   offline_hostgroup: 99
#   comment: "Galera cluster 2"
#
# NOTE: Add your servers in the reader hostgroup, ProxySQL will take care of everything else.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: all
  roles:
     - proxysql

Health check

This role installs a HTTP health check for galera host groups. By default this runs on port 9200, if you configure multiple galera hostgroups with this role you need to specify a different port. Contributions to install health checks for other hostgroups are appreciated.

License

BSD

Author Information

Julien Bunel ([email protected])

proxysql's People

Contributors

jubunel avatar michaeldg avatar

Watchers

 avatar

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.