Saltstack Official Galera Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

83 lines
3.3KB

  1. {%- set master = salt['grains.filter_by']({
  2. 'default': {
  3. 'max_connections': 20000,
  4. 'innodb_buffer_pool_size': '3138M',
  5. },
  6. 'Debian': {
  7. 'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'],
  8. 'service': 'mysql',
  9. 'wsrep_provider': '/usr/lib/galera/libgalera_smm.so',
  10. 'log_file': '/var/log/mysql.log',
  11. 'socket': '/var/run/mysqld/mysqld.sock',
  12. 'config': '/etc/mysql/my.cnf',
  13. },
  14. 'RedHat': {
  15. 'pkgs': ['galera', 'mariadb-galera-server', 'mariadb', 'MySQL-python', 'rsync', 'percona-xtrabackup', 'psmisc', 'socat'],
  16. 'xtrabackup_repo': 'http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm',
  17. 'service': 'mariadb',
  18. 'wsrep_provider': '/usr/lib64/galera/libgalera_smm.so',
  19. 'log_file': '/var/log/mariadb/mariadb.log',
  20. 'socket': '/var/run/mariadb/mysqld.sock',
  21. 'config': '/etc/my.cnf',
  22. },
  23. }, merge=pillar.galera.get('master', {}), base='default') %}
  24. {%- set slave = salt['grains.filter_by']({
  25. 'default': {
  26. 'max_connections': 20000,
  27. 'innodb_buffer_pool_size': '3138M',
  28. },
  29. 'Debian': {
  30. 'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'libmysqlclient18', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'],
  31. 'service': 'mysql',
  32. 'wsrep_provider': '/usr/lib/galera/libgalera_smm.so',
  33. 'log_file': '/var/log/mysql.log',
  34. 'socket': '/var/run/mysqld/mysqld.sock',
  35. 'config': '/etc/mysql/my.cnf',
  36. },
  37. 'RedHat': {
  38. 'pkgs': ['galera', 'mariadb-galera-server', 'mariadb', 'MySQL-python', 'rsync', 'percona-xtrabackup', 'psmisc', 'socat'],
  39. 'xtrabackup_repo': 'http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm',
  40. 'service': 'mariadb',
  41. 'wsrep_provider': '/usr/lib64/galera/libgalera_smm.so',
  42. 'log_file': '/var/log/mariadb/mariadb.log',
  43. 'socket': '/var/run/mariadb/mysqld.sock',
  44. 'config': '/etc/my.cnf',
  45. },
  46. }, merge=salt['grains.filter_by']({
  47. 'trusty': {
  48. 'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'libmysqlclient18', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'],
  49. 'service': 'mysql',
  50. 'wsrep_provider': '/usr/lib/galera/libgalera_smm.so',
  51. 'log_file': '/var/log/mysql.log',
  52. 'socket': '/var/run/mysqld/mysqld.sock',
  53. 'config': '/etc/mysql/my.cnf',
  54. },
  55. 'xenial': {
  56. 'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'libmysqlclient-dev', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'],
  57. 'service': 'mysql',
  58. 'wsrep_provider': '/usr/lib/galera/libgalera_smm.so',
  59. 'log_file': '/var/log/mysql.log',
  60. 'socket': '/var/run/mysqld/mysqld.sock',
  61. 'config': '/etc/mysql/my.cnf',
  62. },
  63. }, grain='oscodename', merge=pillar.galera.get('slave', {})), base='default') %}
  64. {% set clustercheck = salt['grains.filter_by']({
  65. 'Debian': {
  66. 'config': '/etc/mysql/my.cnf',
  67. 'enabled': False,
  68. 'user': clustercheck,
  69. 'password': clustercheck,
  70. 'port': '9200'
  71. },
  72. 'RedHat': {
  73. 'config': '/etc/my.cnf',
  74. 'enabled': False,
  75. 'user': clustercheck,
  76. 'password': clustercheck,
  77. 'port': '9200'
  78. },
  79. }, merge=pillar.galera.get('clustercheck', {})) %}