my.cnf.in 3.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
{% set socket = parameter_dict['socket'] -%}
# ERP5 buildout my.cnf template based on my-huge.cnf shipped with mysql
# The MySQL server
[mysqld]
# ERP5 by default requires InnoDB storage. MySQL by default fallbacks to using
# different engine, like MyISAM. Such behaviour generates problems only, when
# tables requested as InnoDB are silently created with MyISAM engine.
#
# Loud fail is really required in such case.
sql_mode="NO_ENGINE_SUBSTITUTION"

skip_show_database
{% set ip = parameter_dict.get('ip') -%}
{% if ip -%}
bind_address = {{ ip }}
port = {{ parameter_dict['port'] }}
{% else -%}
skip_networking
{% endif -%}
socket = {{ socket }}
datadir = {{ parameter_dict['data-directory'] }}
22
tmpdir = {{ parameter_dict['tmp-directory'] }}
23 24 25 26
pid_file = {{ parameter_dict['pid-file'] }}
log_error = {{ parameter_dict['error-log'] }}
slow_query_log
slow_query_log_file = {{ parameter_dict['slow-query-log'] }}
27
long_query_time = {{ parameter_dict['long-query-time'] }}
28 29
max_allowed_packet = 128M
query_cache_size = 32M
30
innodb_file_per_table = 0
31 32 33 34 35 36 37

plugin_load = ha_mroonga.so;handlersocket.so

# By default only 100 connections are allowed, when using zeo
# we may have much more connections
max_connections = 1000

38
{% set innodb_buffer_pool_size = parameter_dict['innodb-buffer-pool-size'] -%}
39
{% if innodb_buffer_pool_size %}innodb_buffer_pool_size = {{ innodb_buffer_pool_size }}{% endif %}
40
{% set innodb_log_file_size = parameter_dict['innodb-log-file-size'] -%}
41
{% if innodb_log_file_size %} innodb_log_file_size = {{ innodb_log_file_size }}{% endif %}
42
{% set innodb_log_buffer_size = parameter_dict['innodb-log-buffer-size'] -%}
43 44 45 46 47 48 49
{% if innodb_log_buffer_size %} innodb_log_buffer_size = {{ innodb_log_buffer_size }}{% endif %}

# very important to allow parallel indexing
# Note: this is compatible with binlog-based incremental backups, because ERP5
# doesn't use "insert ... select" (in any number of queries) pattern.
innodb_locks_unsafe_for_binlog = 1

50
{% set log_bin = parameter_dict['binlog-path'] -%}
51 52
{% if log_bin -%}
log_bin = {{ log_bin }}
53
{% set binlog_expire_days = parameter_dict['binlog-expire-days'] -%}
54
{% if binlog_expire_days > 0 %}expire_logs_days = {{ binlog_expire_days }}{% endif %}
55
server_id = {{ parameter_dict['server-id'] }}
56
{% endif %}
57

58 59 60 61 62 63 64
# Some dangerous settings you may want to uncomment temporarily
# if you only want performance or less disk access.
{% set x = '' if parameter_dict['relaxed-writes'] else '#' -%}
{{x}}innodb_flush_log_at_trx_commit = 0
{{x}}innodb_flush_method = nosync
{{x}}innodb_doublewrite = 0
{{x}}sync_frm = 0
65 66 67 68 69 70

# Force utf8 usage
collation_server = utf8_unicode_ci
character_set_server = utf8
skip_character_set_client_handshake

71 72 73 74 75 76
{% if 'ssl-key' in parameter_dict -%}
ssl_cert = {{ parameter_dict['ssl-crt'] }}
ssl_key = {{ parameter_dict['ssl-key'] }}
{%   if 'ssl-ca-crt' in parameter_dict -%}
ssl_ca = {{ parameter_dict['ssl-ca-crt'] }}
{%-  endif %}
77 78 79 80 81 82
{%   if 'ssl-crl' in parameter_dict -%}
ssl_crl = {{ parameter_dict['ssl-crl'] }}
{%-  endif %}
{%   if 'ssl-cipher' in parameter_dict -%}
ssl_cipher = {{ parameter_dict['ssl-cipher'] }}
{%-  endif %}
83 84
{%- endif %}

85 86
[client]
socket = {{ socket }}
87
user = root
88 89 90 91 92 93

[mysql]
no_auto_rehash

[mysqlhotcopy]
interactive_timeout