Saltstack Official Galera Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

66 行
2.9KB

  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') %}