[mysql] default-character-set=utf8 [mysqld] ### configure separately on master/slave : ### define 2 virtual IPs : one for MASTER, and the other for ANALYSIS. ### they can point to same server or ANALYSIS could be handled by the slave one. server_id=1 ### Rather prefer associating autoinc key with "server_id" auto_increment_offset=1 auto_increment_increment=2 ### configure based on machine resources : ### slaves automatically increase key_buffer_size key_buffer_size=10G key_cache_division_limit=20 max_heap_table_size=128M innodb_buffer_pool_size = 4G innodb_log_file_size = 2G innodb_additional_mem_pool_size=16M innodb_log_buffer_size = 16M innodb_data_file_path = ibdata1:8G:autoextend ### configure based on platform/environment : basedir =/opt/mysql/mysql init_file =/tank/mysql/myinit.sql tmpdir =/tank/mysql/tmp datadir =/tank/mysql/data innodb_data_home_dir =/tank/mysql/innodbdata innodb_log_group_home_dir =/tank/mysql/innodblog log_bin =/tank/mysql/log/mysql-bin log_error =/tank/mysql/log/mysql.err master_info_file =/tank/mysql/log/master.info relay_log =/tank/mysql/log/mysql-relay-bin relay_log_index =/tank/mysql/log/mysql-relay-bin.index relay_log_info_file =/tank/mysql/log/relay-log.info # Set the SQL mode to strict sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" expire_logs_days=99 ### binlog_format options : ROW, STATEMENT, MIXED binlog_format=ROW ### mysql and q system design and master-master HA makes overall system slave SQL error prone ### as a result of simple high level application coding errors. ### Ex. create a table when SQL_LOG_BIN is 0 and later insert to that table when SQL_LOG_BIN is 1. slave_exec_mode=IDEMPOTENT slave-skip-errors=ALL ### unfortunately no wildcard support and depends on "USE DB;" : binlog_ignore_db=qt% replicate_wild_ignore_table=qa%.% replicate_wild_ignore_table=qb%.% replicate_wild_ignore_table=qo%.% replicate_wild_ignore_table=qt%.% sync_binlog=1 table_cache = 10000 table_definition_cache=20000 default-character-set=utf8 event_scheduler=ON skip-name-resolve # practically lock the hot sub-chain key_cache_age_threshold=4294967200 read_rnd_buffer_size = 2M sort_buffer_size = 32k thread_cache = 8 query_cache_size = 0M thread_concurrency = 8 myisam_recover=BACKUP,FORCE # innodb_file_per_table # ZFS guaranties complete pages , no need for innodb_doublewrite : innodb_doublewrite=0 # ZFS guaranties complete pages , no need for innodb_checksums : innodb_checksums=0 innodb_flush_log_at_trx_commit = 1 innodb_support_xa=1 innodb_thread_concurrency=0 # when ZFS supoorts this if there is ZIL device (confirmation required) # even if there is no such device, innodb warns about the situation and continues innodb_flush_method = O_DIRECT