Advertisement
lifeboy

Galera config files

Aug 28th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.13 KB | None | 0 0
  1. # cat /usr/local/etc/my.cnf
  2. # Example MariaDB config file for medium systems.
  3. #
  4. # This is for a system with little memory (32M - 64M) where MariaDB plays
  5. # an important part, or systems up to 128M where MariaDB is used together with
  6. # other programs (such as a web server)
  7. #
  8. # MariaDB programs look for option files in a set of
  9. # locations which depend on the deployment platform.
  10. # You can copy this option file to one of those
  11. # locations. For information about these locations, do:
  12. # 'my_print_defaults --help' and see what is printed under
  13. # Default options are read from the following files in the given order:
  14. # More information at: http://dev.mysql.com/doc/mysql/en/option-files.html
  15. #
  16. # In this file, you can use all long options that a program supports.
  17. # If you want to know which options a program supports, run the program
  18. # with the "--help" option.
  19.  
  20. # The following options will be passed to all MariaDB clients
  21. [client]
  22. #password   = your_password
  23. port        = 3306
  24. socket      = /tmp/mysql.sock
  25.  
  26. # Here follows entries for some specific programs
  27.  
  28. # The MariaDB server
  29. [mysqld]
  30. # change ip
  31. bind-address    = 172.16.15.20
  32. port        = 3306
  33. socket      = /tmp/mysql.sock
  34. skip-external-locking
  35. key_buffer_size = 16M
  36. max_allowed_packet = 1M
  37. table_open_cache = 64
  38. sort_buffer_size = 512K
  39. net_buffer_length = 8K
  40. read_buffer_size = 256K
  41. read_rnd_buffer_size = 512K
  42. myisam_sort_buffer_size = 8M
  43. log-error = /var/db/mysql/hout2.err
  44.  
  45. # Point the following paths to different dedicated disks
  46. #tmpdir     = /tmp/
  47.  
  48. # Don't listen on a TCP/IP port at all. This can be a security enhancement,
  49. # if all processes that need to connect to mysqld run on the same host.
  50. # All interaction with mysqld must be made via Unix sockets or named pipes.
  51. # Note that using this option without enabling named pipes on Windows
  52. # (via the "enable-named-pipe" option) will render mysqld useless!
  53. #
  54. #skip-networking
  55.  
  56. # Replication Master Server (default)
  57. # binary logging is required for replication
  58. #log-bin=mysql-bin
  59.  
  60. # binary logging format - mixed recommended
  61. #binlog_format=mixed
  62.  
  63. # Specify the log hostname
  64. #log-basename=hout2
  65.  
  66. # Lines added by Dries to prevent db access error.
  67. # Mysql2::Error: Incorrect integer value: '' for column 'vMerchant_id' at row 1
  68. # sql_mode was: STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
  69. sql_mode = ""
  70.  
  71. # required unique id between 1 and 2^32 - 1
  72. # defaults to 1 if master-host is not set
  73. # but will not function as a master if omitted
  74. #server-id  = 2
  75.  
  76. # Replication Slave (comment out master section to use this)
  77. #
  78. # To configure this host as a replication slave, you can choose between
  79. # two methods :
  80. #
  81. # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  82. #    the syntax is:
  83. #
  84. #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
  85. #    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
  86. #
  87. #    where you replace <host>, <user>, <password> by quoted strings and
  88. #    <port> by the master's port number (3306 by default).
  89. #
  90. #    Example:
  91. #
  92. #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
  93. #    MASTER_USER='joe', MASTER_PASSWORD='secret';
  94. #
  95. # OR
  96. #
  97. # 2) Set the variables below. However, in case you choose this method, then
  98. #    start replication for the first time (even unsuccessfully, for example
  99. #    if you mistyped the password in master-password and the slave fails to
  100. #    connect), the slave will create a master.info file, and any later
  101. #    change in this file to the variables' values below will be ignored and
  102. #    overridden by the content of the master.info file, unless you shutdown
  103. #    the slave server, delete master.info and restart the slaver server.
  104. #    For that reason, you may want to leave the lines below untouched
  105. #    (commented) and instead use CHANGE MASTER TO (see above)
  106. #
  107. # required unique id between 2 and 2^32 - 1
  108. # (and different from the master)
  109. # defaults to 2 if master-host is set
  110. # but will not function as a slave if omitted
  111. #server-id       = 2
  112. #
  113. # The replication master for this slave - required
  114. #master-host     =   <hostname>
  115. #
  116. # The username the slave will use for authentication when connecting
  117. # to the master - required
  118. #master-user     =   <username>
  119. #
  120. # The password the slave will authenticate with when connecting to
  121. # the master - required
  122. #master-password =   <password>
  123. #
  124. # The port the master is listening on.
  125. # optional - defaults to 3306
  126. #master-port     =  <port>
  127. #
  128. # binary logging - not required for slaves, but recommended
  129. #log-bin=mysql-bin
  130.  
  131. # Uncomment the following if you are using InnoDB tables
  132. innodb_data_home_dir = /var/db/mysql
  133. innodb_data_file_path = ibdata1:10M:autoextend
  134. innodb_log_group_home_dir = /var/db/mysql
  135. # You can set .._buffer_pool_size up to 50 - 80 %
  136. # of RAM but beware of setting memory usage too high
  137. innodb_buffer_pool_size = 122M
  138. # Set .._log_file_size to 25 % of buffer pool size
  139. innodb_log_file_size = 5M
  140. innodb_log_buffer_size = 8M
  141. # Ensure log is written once per second, rather than on each commit
  142. innodb_flush_log_at_trx_commit = 0
  143. innodb_lock_wait_timeout = 50
  144.  
  145. [mysqldump]
  146. quick
  147. max_allowed_packet = 16M
  148.  
  149. [mysql]
  150. no-auto-rehash
  151. # Remove the next comment character if you are not familiar with SQL
  152. #safe-updates
  153.  
  154. [myisamchk]
  155. key_buffer_size = 20M
  156. sort_buffer_size = 20M
  157. read_buffer = 2M
  158. write_buffer = 2M
  159.  
  160. [mysqlhotcopy]
  161. interactive-timeout
  162.  
  163. [mysql_safe]
  164. log-error=/var/log/mysqld.log
  165. pid-file=/var/run/mysqld/mysqld.pid
  166.  
  167. !include /usr/local/etc/wsrep.cnf
  168.  
  169. # cat /usr/local/etc/wsrep.cnf
  170. # This file contains wsrep-related mysqld options. It should be included
  171. # in the main MySQL configuration file.
  172. #
  173. # Options that need to be customized:
  174. #  - wsrep_provider
  175. #  - wsrep_cluster_address
  176. #  - wsrep_sst_auth
  177. # The rest of defaults should work out of the box.
  178.  
  179. ##
  180. ## mysqld options _MANDATORY_ for correct opration of the cluster
  181. ##
  182. [mysqld]
  183.  
  184. # (This must be substituted by wsrep_format)
  185. binlog_format=ROW
  186.  
  187. # Currently only InnoDB storage engine is supported
  188. default-storage-engine=innodb
  189.  
  190. # to avoid issues with 'bulk mode inserts' using autoinc
  191. innodb_autoinc_lock_mode=2
  192.  
  193. # Override bind-address
  194. # In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
  195. # it will have (most likely) disastrous consequences on donor node
  196. #bind-address=0.0.0.0
  197.  
  198. ##
  199. ## WSREP options
  200. ##
  201. wsrep_on=ON
  202. wsrep-new-cluster=1
  203.  
  204. # Full path to wsrep provider library or 'none'
  205. wsrep_provider=/usr/local/lib/libgalera_smm.so
  206.  
  207. # Provider specific configuration options
  208. wsrep_provider_options="gcache.size=300M; gcache.page_size=300M"
  209.  
  210. # Logical cluster name. Should be the same for all nodes.
  211. wsrep_cluster_name="hout_wsrep_cluster"
  212.  
  213. # Group communication system handle
  214. wsrep_cluster_address="gcomm://172.16.15.20:4567,172.16.15.21:4567,172.16.15.22:4567"
  215.  
  216. # Human-readable node name (non-unique). Hostname by default.
  217. wsrep_node_name=hout2
  218.  
  219. # Base replication <address|hostname>[:port] of the node.
  220. # The values supplied will be used as defaults for state transfer receiving,
  221. # listening ports and so on. Default: address of the first network interface.
  222. wsrep_node_address=172.16.15.20:4567
  223.  
  224. # Address for incoming client connections. Autodetect by default.
  225. #wsrep_node_incoming_address=
  226.  
  227. # How many threads will process writesets from other nodes
  228. wsrep_slave_threads=1
  229.  
  230. # DBUG options for wsrep provider
  231. wsrep_dbug_option=1
  232.  
  233. # Generate fake primary keys for non-PK tables (required for multi-master
  234. # and parallel applying operation)
  235. wsrep_certify_nonPK=1
  236.  
  237. # Maximum number of rows in write set
  238. wsrep_max_ws_rows=131072
  239.  
  240. # Maximum size of write set
  241. wsrep_max_ws_size=1073741824
  242.  
  243. # to enable debug level logging, set this to 1
  244. wsrep_debug=1
  245.  
  246. # convert locking sessions into transactions
  247. wsrep_convert_LOCK_to_trx=0
  248.  
  249. # how many times to retry deadlocked autocommits
  250. wsrep_retry_autocommit=1
  251.  
  252. # change auto_increment_increment and auto_increment_offset automatically
  253. wsrep_auto_increment_control=1
  254.  
  255. # retry autoinc insert, which failed for duplicate key error
  256. wsrep_drupal_282555_workaround=0
  257.  
  258. # enable "strictly synchronous" semantics for read operations
  259. wsrep_causal_reads=0
  260.  
  261. # Command to call when node status or cluster membership changes.
  262. # Will be passed all or some of the following options:
  263. # --status  - new status of this node
  264. # --uuid    - UUID of the cluster
  265. # --primary - whether the component is primary or not ("yes"/"no")
  266. # --members - comma-separated list of members
  267. # --index   - index of this node in the list
  268. wsrep_notify_cmd=
  269.  
  270. ##
  271. ## WSREP State Transfer options
  272. ##
  273.  
  274. # State Snapshot Transfer method
  275. wsrep_sst_method=rsync
  276.  
  277. # Address which donor should send State Snapshot to.
  278. # Should be the address of THIS node. DON'T SET IT TO DONOR ADDRESS!!!
  279. # (SST method dependent. Defaults to the first IP of the first interface)
  280. #wsrep_sst_receive_address=
  281.  
  282. # SST authentication string. This will be used to send SST to joining nodes.
  283. # Depends on SST method. For mysqldump method it is root:<root password>
  284. wsrep_sst_auth=root:
  285.  
  286. # Desired SST donor name.
  287. #wsrep_sst_donor=
  288.  
  289. # Reject client queries when donating SST (false)
  290. #wsrep_sst_donor_rejects_queries=0
  291.  
  292. # Protocol version to use
  293. # wsrep_protocol_version=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement