Saltstack Official Galera Formula
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

9 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. # All files in this package is subject to the GPL v2 license
  2. # More information is in the COPYING file in the top directory of this package.
  3. # Copyright (C) 2011 severalnines.com
  4. {%- if pillar.galera.master is defined %}
  5. {%- from "galera/map.jinja" import master with context %}
  6. {%- set service = master %}
  7. {%- endif %}
  8. {%- if pillar.galera.slave is defined %}
  9. {%- from "galera/map.jinja" import slave with context %}
  10. {%- set service = slave %}
  11. {%- endif %}
  12. [MYSQLD]
  13. user=mysql
  14. basedir=/usr/
  15. datadir=/var/lib/mysql
  16. socket=/var/run/mysqld/mysqld.sock
  17. pid_file=mysqld.pid
  18. port=3306
  19. log_error=/var/log/mysql.log
  20. log_warnings=2
  21. #log_output=FILE
  22. ### INNODB OPTIONS
  23. innodb_buffer_pool_size=9211M
  24. innodb_flush_log_at_trx_commit=2
  25. innodb_file_per_table=1
  26. innodb_data_file_path = ibdata1:100M:autoextend
  27. ## You may want to tune the below depending on number of cores and disk sub
  28. innodb_read_io_threads=4
  29. innodb_write_io_threads=4
  30. innodb_io_capacity=200
  31. innodb_doublewrite=1
  32. innodb_log_file_size=1024M
  33. innodb_log_buffer_size=96M
  34. innodb_buffer_pool_instances=8
  35. innodb_log_files_in_group=2
  36. innodb_thread_concurrency=64
  37. #innodb_file_format=barracuda
  38. innodb_flush_method = O_DIRECT
  39. innodb_autoinc_lock_mode=2
  40. ## avoid statistics update when doing e.g show tables
  41. innodb_stats_on_metadata=0
  42. default_storage_engine=innodb
  43. bind-address={{ service.bind.address }}
  44. # CHARACTER SET
  45. #collation_server = utf8_unicode_ci
  46. #init_connect='SET NAMES utf8'
  47. character_set_server = utf8
  48. # REPLICATION SPECIFIC
  49. #server_id must be unique across all mysql servers participating in replication.
  50. #server_id=SERVERID
  51. binlog_format=ROW
  52. #log_slave_updates=1
  53. #log_bin=binlog
  54. #relay_log=relay-bin
  55. #expire_logs_days=7
  56. #gtid_mode=ON
  57. #enforce_gtid_consistency=1
  58. # OTHER THINGS, BUFFERS ETC
  59. key_buffer_size = 24M
  60. tmp_table_size = 64M
  61. max_heap_table_size = 64M
  62. max_allowed_packet = 512M
  63. #sort_buffer_size = 256K
  64. #read_buffer_size = 256K
  65. #read_rnd_buffer_size = 512K
  66. #myisam_sort_buffer_size = 8M
  67. skip_name_resolve
  68. memlock=0
  69. sysdate_is_now=1
  70. max_connections=2000
  71. thread_cache_size=512
  72. query_cache_type = 0
  73. query_cache_size = 0
  74. table_open_cache=1024
  75. lower_case_table_names=0
  76. # 5.6 backwards compatibility
  77. #explicit_defaults_for_timestamp=1
  78. ##
  79. ## WSREP options
  80. ##
  81. # Full path to wsrep provider library or 'none'
  82. wsrep_provider=/usr/lib/galera/libgalera_smm.so
  83. wsrep_node_address={{ service.bind.address }}
  84. # Provider specific configuration options
  85. wsrep_provider_options="gcache.size=8192M"
  86. # Logical cluster name. Should be the same for all nodes.
  87. wsrep_cluster_name="my_wsrep_cluster"
  88. # Group communication system handle
  89. wsrep_cluster_address=gcomm://
  90. # Human_readable node name (non-unique). Hostname by default.
  91. wsrep_node_name={{ service.bind.address }}
  92. # Address for incoming client connections. Autodetect by default.
  93. #wsrep_node_incoming_address=
  94. # How many threads will process writesets from other nodes
  95. wsrep_slave_threads=8
  96. # DBUG options for wsrep provider
  97. #wsrep_dbug_option
  98. # Generate fake primary keys for non-PK tables (required for multi-master
  99. # and parallel applying operation)
  100. wsrep_certify_nonPK=1
  101. # Location of the directory with data files. Needed for non-mysqldump
  102. # state snapshot transfers. Defaults to mysql_real_data_home.
  103. #wsrep_data_home_dir=
  104. # Maximum number of rows in write set
  105. wsrep_max_ws_rows=131072
  106. # Maximum size of write set
  107. wsrep_max_ws_size=1073741824
  108. # to enable debug level logging, set this to 1
  109. wsrep_debug=0
  110. # convert locking sessions into transactions
  111. wsrep_convert_LOCK_to_trx=0
  112. # how many times to retry deadlocked autocommits
  113. wsrep_retry_autocommit=1
  114. # change auto_increment_increment and auto_increment_offset automatically
  115. wsrep_auto_increment_control=1
  116. # replicate myisam
  117. wsrep_replicate_myisam=1
  118. # retry autoinc insert, which failed for duplicate key error
  119. wsrep_drupal_282555_workaround=0
  120. # enable "strictly synchronous" semantics for read operations
  121. wsrep_causal_reads=0
  122. # Command to call when node status or cluster membership changes.
  123. # Will be passed all or some of the following options:
  124. # --status - new status of this node
  125. # --uuid - UUID of the cluster
  126. # --primary - whether the component is primary or not ("yes"/"no")
  127. # --members - comma-separated list of members
  128. # --index - index of this node in the list
  129. #wsrep_notify_cmd=
  130. ##
  131. ## WSREP State Transfer options
  132. ##
  133. # State Snapshot Transfer method
  134. # ClusterControl currently DOES NOT support wsrep_sst_method=mysqldump
  135. wsrep_sst_method=xtrabackup
  136. # Address on THIS node to receive SST at. DON'T SET IT TO DONOR ADDRESS!!!
  137. # (SST method dependent. Defaults to the first IP of the first interface)
  138. #wsrep_sst_receive_address=
  139. # SST authentication string. This will be used to send SST to joining nodes.
  140. # Depends on SST method. For mysqldump method it is root:<root password>
  141. wsrep_sst_auth={{ service.admin.user }}:{{ service.admin.password }}
  142. # Desired SST donor name.
  143. #wsrep_sst_donor=
  144. # Protocol version to use
  145. # wsrep_protocol_version=
  146. [MYSQL]
  147. socket=/var/run/mysqld/mysqld.sock
  148. #default_character_set=utf8
  149. [client]
  150. socket=/var/run/mysqld/mysqld.sock
  151. default_character_set=utf8
  152. [mysqldump]
  153. max_allowed_packet = 512M
  154. socket=/var/run/mysqld/mysqld.sock
  155. default_character_set=utf8
  156. [MYSQLD_SAFE]
  157. pid_file=mysqld.pid
  158. log_error=/var/log/mysql.log
  159. basedir=/usr/
  160. datadir=/var/lib/mysql