Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3769279
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
10 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/roles/dbserver-mysql/mysql-server/cnf.sls b/roles/dbserver-mysql/mysql-server/cnf.sls
index 7c23fd2..3f2da2c 100644
--- a/roles/dbserver-mysql/mysql-server/cnf.sls
+++ b/roles/dbserver-mysql/mysql-server/cnf.sls
@@ -1,58 +1,67 @@
# -------------------------------------------------------------
# Salt — Database server — MySQL
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-10-27
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% from "map.jinja" import dirs with context %}
{% set use_zfs = salt['node.has']('zfs:pool') %}
# -------------------------------------------------------------
# Required directories
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-/var/run/mysqld:
+/var/run/mysql:
file.directory:
- user: mysql
- group: mysql
- dir_mode: 755
/var/db/mysql:
file.directory:
- user: mysql
- group: mysql
- dir_mode: 755
{{ dirs.etc }}/mysql:
file.directory:
- user: root
- group: mysql
- dir_mode: 755
# -------------------------------------------------------------
# Configuration files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-{{ dirs.etc }}/my.cnf:
- file.managed:
- - source: salt://roles/dbserver-mysql/mysql-server/files/my.cnf
+{{ dirs.etc }}/mysql/conf.d:
+ file.recurse:
+ - source: salt://roles/dbserver-mysql/mysql-server/files/conf.d
+ - clean: True # remove wsrep.cnf values (and empty config files)
- template: jinja
- context:
nodename: {{ grains['id'] }}
etc: {{ dirs.etc }}
share: {{ dirs.share }}
use_zfs: {{ use_zfs }}
{{ dirs.etc }}/mysql/stopwords.txt:
file.managed:
- source: salt://roles/dbserver-mysql/mysql-server/files/stopwords.txt
+# -------------------------------------------------------------
+# Service
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os'] == 'FreeBSD' %}
+
/etc/rc.conf.d/mysql:
file.managed:
- source: salt://roles/dbserver-mysql/mysql-server/files/mysql.rc
- template: jinja
- context:
use_zfs: {{ use_zfs }}
+
+{% endif %}
diff --git a/roles/dbserver-mysql/mysql-server/files/conf.d/client.cnf b/roles/dbserver-mysql/mysql-server/files/conf.d/client.cnf
new file mode 100644
index 0000000..c78d023
--- /dev/null
+++ b/roles/dbserver-mysql/mysql-server/files/conf.d/client.cnf
@@ -0,0 +1,27 @@
+# -------------------------------------------------------------
+# MariaDB configuration :: clients
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/dbserver-mysql/mysql-server/files/conf.d/client.cnf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+[client]
+port = 3306
+socket = /var/run/mysql/mysqld.sock
+
+[mariadb-client]
+prompt = \u@\h [\d]>\_
+no_auto_rehash
+
+[mariadb-dump]
+max_allowed_packet = 256M
+quote_names
+quick
diff --git a/roles/dbserver-mysql/mysql-server/files/my.cnf b/roles/dbserver-mysql/mysql-server/files/conf.d/server.cnf
similarity index 78%
rename from roles/dbserver-mysql/mysql-server/files/my.cnf
rename to roles/dbserver-mysql/mysql-server/files/conf.d/server.cnf
index 3a55905..019b428 100644
--- a/roles/dbserver-mysql/mysql-server/files/my.cnf
+++ b/roles/dbserver-mysql/mysql-server/files/conf.d/server.cnf
@@ -1,125 +1,110 @@
# -------------------------------------------------------------
-# MySQL configuration
+# MariaDB configuration :: servers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2015-04-21
# License: Trivial work, not eligible to copyright
+# Source file: roles/dbserver-mysql/mysql-server/files/conf.d/server.cnf
# -------------------------------------------------------------
-
-# -------------------------------------------------------------
-# Clients
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-[client]
-port = 3306
-socket = /var/run/mysqld/mysqld.sock
-
-[mysql]
-prompt = \u@\h [\d]>\_
-
-[mysqldump]
-quick
-max_allowed_packet = 32M
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
# -------------------------------------------------------------
# Server wrapper
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-[mysqld_safe]
-pid-file = /var/run/mysqld/mysqld.pid
-socket = /var/run/mysqld/mysqld.sock
+[mariadb-safe]
+pid-file = /var/run/mysql/mysqld.pid
+socket = /var/run/mysql/mysqld.sock
nice = 0
# -------------------------------------------------------------
# Generic server settings
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[mysqld]
-user = mysql
-pid-file = /var/run/mysqld/mysqld.pid
-socket = /var/run/mysqld/mysqld.sock
-port = 3306
+user = mysql
+pid-file = /var/run/mysql/mysqld.pid
+
basedir = /usr
tmpdir = /tmp
+datadir = /var/db/mysql
lc-messages-dir = {{ share }}/mysql
+bind-address = 127.0.0.1
+socket = /var/run/mysql/mysqld.sock
+port = 3306
+
+net_retry_count = 16384
+log_error = /var/log/mysql/mysqld.err
+
sql_mode = STRICT_ALL_TABLES
explicit_defaults_for_timestamp
log_bin
log_basename = {{ nodename }}
binlog_cache_size = 1M
max_binlog_size = 1000M
binlog_format = MIXED
-{% if use_zfs %}
-datadir = /var/db/mysql/mysql-root
-{% else %}
-datadir = /var/db/mysql
-{% endif %}
-
# -------------------------------------------------------------
# InnoDB / XtraDB configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
default-storage-engine = InnoDB
innodb_buffer_pool_size = 410M
{% if use_zfs %}
innodb_data_home_dir = /var/db/mysql/mysql-innodb-data
innodb_log_group_home_dir = /var/db/mysql/mysql-innodb-logs
innodb_file_per_table = off
-skip-innodb_doublewrite
+innodb_doublewrite = 0
+innodb_flush_method = O_DSYNC
+
{% endif %}
# -------------------------------------------------------------
# Performance schema
#
# Wikimedia production servers on s3 have this configuration
# with only 100MB of overhead. This is an acceptable cost
# for a valuable information.
#
# Reference: https://phabricator.wikimedia.org/T99485
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
performance_schema = 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
# -------------------------------------------------------------
# Applications configuration
#
-# :: MediaWiki
# :: Phabricator
-# :: OTRS
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# MediaWiki
-character_set_server = binary
-character_set_filesystem = binary
-collation_server = binary
-
# Phabricator
max_allowed_packet = 32M
ft_stopword_file = {{ etc }}/mysql/stopwords.txt
ft_min_word_len = 3
ft_boolean_syntax = ' |-><()~*:""&^'
-
-# OTRS
-key_buffer_size = 32M
diff --git a/roles/dbserver-mysql/mysql-server/files/mysql.rc b/roles/dbserver-mysql/mysql-server/files/mysql.rc
index 79997d1..952af32 100644
--- a/roles/dbserver-mysql/mysql-server/files/mysql.rc
+++ b/roles/dbserver-mysql/mysql-server/files/mysql.rc
@@ -1,16 +1,13 @@
# -------------------------------------------------------------
# Database server — MySQL — rc configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-11-05
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
mysql_enable="YES"
-mysql_pidfile="/var/run/mysqld/mysqld.pid"
+mysql_rundir="/var/run/mysql"
+mysql_pidfile="/var/run/mysql/mysqld.pid"
-{% if use_zfs %}
-mysql_dbdir=/var/db/mysql/mysql-root
-{% else %}
mysql_dbdir=/var/db/mysql
-{% endif %}
diff --git a/roles/webserver-legacy/php-sites/files/php.ini b/roles/webserver-legacy/php-sites/files/php.ini
index cdd3b0b..ce10ade 100644
--- a/roles/webserver-legacy/php-sites/files/php.ini
+++ b/roles/webserver-legacy/php-sites/files/php.ini
@@ -1,26 +1,26 @@
; -------------------------------------------------------------
; PHP configuration
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; Project: Nasqueron
; License: Trivial work, not eligible to copyright
; Source file: roles/webserver-legacy/php-sites/files/php.ini
; -------------------------------------------------------------
;
; <auto-generated>
; This file is managed by our rOPS SaltStack repository.
;
; Changes to this file may cause incorrect behavior
; and will be lost if the state is redeployed.
; </auto-generated>
[Date]
; Place de la bastille, Paris
date.default_latitude = 48.853139
date.default_longitude = 2.369111
date.timezone = "UTC"
[MySQLi]
-mysqli.default_socket = /var/run/mysqld/mysqld.sock
+mysqli.default_socket = /var/run/mysql/mysqld.sock
[Pdo_mysql]
-pdo_mysql.default_socket = /var/run/mysqld/mysqld.sock
+pdo_mysql.default_socket = /var/run/mysql/mysqld.sock
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 13:59 (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260297
Default Alt Text
(10 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment