Springle has submitted this change and it was merged.
Change subject: Labs: puppetize labsdb1005's mysql setup
......................................................................
Labs: puppetize labsdb1005's mysql setup
This mostly replicates the current config, but brings it in
to the standard for passwords, etc.
Bug: T88234
Change-Id: I8ce32a37aa517baa9d21ef9bb9d03f50ea9917ef
---
M manifests/role/labsdb.pp
M manifests/site.pp
A templates/mariadb/toolsmaster.my.cnf
3 files changed, 80 insertions(+), 54 deletions(-)
Approvals:
Springle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/manifests/role/labsdb.pp b/manifests/role/labsdb.pp
index eecc679..ee460ad 100644
--- a/manifests/role/labsdb.pp
+++ b/manifests/role/labsdb.pp
@@ -2,60 +2,21 @@
class role::labs::db::master {
- system::role { 'role::labs::db::master': description => "Labs user
database master" }
-
- class { 'mysql::server':
- config_hash => {
- 'datadir' => '/srv/labsdb',
- 'port' => '3306',
- 'bind_address' => '0.0.0.0',
- 'max_connections' => '4096',
-
- 'server-id' => '1',
- 'report_host' => 'labsdbmaster',
- 'log_bin' => true,
- 'max_binlog_size' => '100M',
-
- 'innodb_log_file_size' => '64M',
- 'innodb_buffer_pool_size' => '13G',
- 'innodb_log_buffer_size' => '64M',
- 'innodb_file_per_table' => '1',
- 'innodb_open_files' => '512',
- 'innodb_flush_method' => 'O_DIRECT',
-
- # More tuning will certainly be needed
- }
+ system::role { 'role::labs::db::master':
+ description => 'Labs user database master',
}
-}
+ include standard
+ include mariadb::packages_wmf
+ include role::mariadb::grants
+ include role::mariadb::monitor
-class role::labs::db::slave {
-
- system::role { 'role::labs::db::slave': description => "Labs user database
slave" }
-
- class { 'mysql::server':
- config_hash => {
- 'datadir' => '/srv/labsdb',
- 'port' => '3306',
- 'bind_address' => '0.0.0.0',
- 'max_connections' => '4096',
-
- 'server-id' => '2',
- 'report_host' => 'labsdbslave',
- 'log_bin' => true,
- 'max_binlog_size' => '100M',
- 'relay_log' => '/srv/labsdb/relay',
- 'relay_log_index' => '/srv/labsdb/relay.index',
- 'relay_log_info_file' => '/srv/labsdb/relay.info',
-
- 'innodb_log_file_size' => '64M',
- 'innodb_buffer_pool_size' => '13G',
- 'innodb_log_buffer_size' => '64M',
- 'innodb_file_per_table' => '1',
- 'innodb_open_files' => '512',
- 'innodb_flush_method' => 'O_DIRECT',
-
- # More tuning will certainly be needed
- }
+ class { 'mariadb::config':
+ prompt => 'TOOLSDB',
+ config => 'mariadb/toolsmaster.my.cnf.erb',
+ password => $passwords::misc::scripts::mysql_root_pass,
+ datadir => '/srv/labsdb/data',
+ tmpdir => '/tmp',
}
+
}
diff --git a/manifests/site.pp b/manifests/site.pp
index 645b6a8..480c3f2 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1222,14 +1222,14 @@
$postgres_slave_v4 = '10.64.37.9'
include role::postgres::master
- # include role::labs::db::slave
+ # role labs::db::slave
}
node 'labsdb1005.eqiad.wmnet' {
$postgres_master = 'labsdb1004.eqiad.wmnet'
include role::postgres::slave
- # include role::labs::db::master
+ role labs::db::master
}
node 'labsdb1006.eqiad.wmnet' {
diff --git a/templates/mariadb/toolsmaster.my.cnf
b/templates/mariadb/toolsmaster.my.cnf
new file mode 100644
index 0000000..e5621c6
--- /dev/null
+++ b/templates/mariadb/toolsmaster.my.cnf
@@ -0,0 +1,65 @@
+[client]
+port = 3306
+socket = /var/run/mysqld/mysqld.sock
+
+[mysqld]
+
+user = mysql
+socket = /var/run/mysqld/mysqld.sock
+port = 3306
+datadir = <%= @datadir %>
+tmpdir = <%= @tmpdir %>
+server_id = <%= @server_id %>
+read_only = 0
+
+log_bin = /srv/labsdb/binlogs/log
+log_bin_index = /srv/labsdb/binlogs/log.index
+log_slave_updates
+
+skip-external-locking
+skip-name-resolve
+temp-pool
+
+max_connections = 1024
+max_connect_errors = 1000000000
+max_allowed_packet = 16M
+connect_timeout = 5
+query_cache_size = 0
+query_cache_type = 0
+event_scheduler = 1
+userstat = 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 = MIXED
+expire_logs_days = 7
+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 = 1
+innodb_flush_method = O_DIRECT
+innodb_thread_concurrency = 0
+innodb_io_capacity = 1000
+innodb_read_io_threads = 16
+innodb_write_io_threads = 8
+innodb_stats_sample_pages = 16
+innodb_stats_method = nulls_unequal
+
+[mysqldump]
+
+quick
+max_allowed_packet = 16M
+
+#!includedir /etc/mysql/conf.d/
--
To view, visit https://gerrit.wikimedia.org/r/200170
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ce32a37aa517baa9d21ef9bb9d03f50ea9917ef
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Springle <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: coren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits