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

70 行
2.9KB

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