Jcrespo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/301081

Change subject: Add provisional my.cnf for new labsdb replicas
......................................................................

Add provisional my.cnf for new labsdb replicas

It will need lots of changes to be useful.

Change-Id: I89db9f1e8ffe81187636b4c3c695480459d49692
---
M modules/role/manifests/labs/db/replica.pp
A modules/role/templates/labs/db/labsdb-replica.my.cnf.erb
2 files changed, 108 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/81/301081/1

diff --git a/modules/role/manifests/labs/db/replica.pp 
b/modules/role/manifests/labs/db/replica.pp
index 390f924..b963ff7 100644
--- a/modules/role/manifests/labs/db/replica.pp
+++ b/modules/role/manifests/labs/db/replica.pp
@@ -14,7 +14,7 @@
 
     class { 'mariadb::config':
         prompt        => 'REPLICA database',
-        config        => 'mariadb/labs-replica.my.cnf.erb',
+        config        => 
'puppet:///modules/role/labs/db/labsdb-replica.my.cnf.erb',
         password      => $passwords::misc::scripts::mysql_root_pass,
         datadir       => '/srv/labsdb/data',
         tmpdir        => '/srv/labsdb/tmp',
diff --git a/modules/role/templates/labs/db/labsdb-replica.my.cnf.erb 
b/modules/role/templates/labs/db/labsdb-replica.my.cnf.erb
new file mode 100644
index 0000000..658459a
--- /dev/null
+++ b/modules/role/templates/labs/db/labsdb-replica.my.cnf.erb
@@ -0,0 +1,107 @@
+[client]
+port   = 3306
+socket = /tmp/mysql.sock
+default-character-set = binary
+
+[mysqld]
+
+user       = mysql
+socket     = /tmp/mysql.sock
+port       = 3306
+datadir    = <%= @datadir %>
+tmpdir     = <%= @tmpdir %>
+server_id  = <%= @server_id %>
+read_only  = 0
+
+log_bin
+log_slave_updates
+
+skip-external-locking
+skip-name-resolve
+temp-pool
+
+character-set-server           = binary
+collation-server               = binary
+
+max_connections                = 1024
+max_connect_errors             = 1000000000
+max_allowed_packet             = 32M
+connect_timeout                = 5
+query_cache_size               = 0
+query_cache_type               = 0
+event_scheduler                = 1
+log-warnings                   = 0
+thread_stack                   = 192K
+thread_cache_size              = 128
+interactive_timeout            = 28800
+wait_timeout                   = 600
+
+binlog_cache_size              = 1M
+max_binlog_size                = 100M
+binlog_format                  = <%= @binlog_format %>
+expire_logs_days               = 2
+slave_transaction_retries      = 4294967295
+
+table_open_cache               = 5000
+table_definition_cache         = 4000
+
+default-storage-engine         = InnoDB
+innodb_file_per_table          = 1
+innodb_buffer_pool_size        = <%= (Float(@memorysize.split[0]) * 0.5).round 
%>G
+innodb_buffer_pool_instances   = 1
+innodb_log_file_size           = 128M
+innodb_flush_log_at_trx_commit = 0
+innodb_thread_concurrency      = 0
+innodb_io_capacity             = 1000
+innodb_stats_sample_pages      = 16
+innodb_stats_method            = nulls_unequal
+
+<% if @kernelversion < "3.19" %>
+# Until kernel 3.16 http://www.spinics.net/lists/stable/msg61873.html
+# At least, I think so. For now we need to avoid the an assertion failure on 
Trusty w/ 3.13
+innodb_use_native_aio          = 0
+innodb_read_io_threads         = 16
+innodb_write_io_threads        = 8
+<% end %>
+<% if @ssl == 'on' %>
+# ssl
+ssl-ca=/etc/mysql/ssl/cacert.pem
+ssl-cert=/etc/mysql/ssl/server-cert.pem
+ssl-key=/etc/mysql/ssl/server-key.pem
+ssl-cipher=TLSv1.2
+<% end %>
+
+# dump and load innodb buffer at start and stop
+innodb_buffer_pool_load_at_startup  = 1
+innodb_buffer_pool_dump_at_shutdown = 1
+
+<% if @p_s == 'on' %>
+# Enabling performance_schema (disabled by default in MariaDB10)
+performance_schema                                     = 1
+# downsizing performance schema memory usage: T99485
+performance_schema_digests_size                        = -1
+performance_schema_max_thread_instances                = 500
+performance_schema_max_cond_instances                  = 1000
+performance_schema_accounts_size                       = 300
+performance_schema_hosts_size                          = 300
+performance_schema_events_statements_history_size      = 10
+performance_schema_events_statements_history_long_size = 1000
+performance_schema_events_waits_history_size           = 10
+performance_schema_events_waits_history_long_size      = 1000
+performance_schema_events_stages_history_size          = 10
+performance_schema_events_stages_history_long_size     = 1000
+performance_schema_max_mutex_instances                 = 5000
+performance_schema_max_rwlock_instances                = 2000
+performance_schema_max_socket_instances                = 500
+performance_schema_max_table_instances                 = 1000
+<% else %>
+# only enable userstat if p_s is disabled
+performance_schema                                     = 0
+userstat                                               = 1
+<% end %>
+
+[mysqldump]
+
+quick
+max_allowed_packet = 32M
+

-- 
To view, visit https://gerrit.wikimedia.org/r/301081
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89db9f1e8ffe81187636b4c3c695480459d49692
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to