Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3920294
D1122.id3002.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D1122.id3002.diff
View Options
diff --git a/map.jinja b/map.jinja
--- a/map.jinja
+++ b/map.jinja
@@ -132,7 +132,7 @@
'emacs': 'emacs-nox11',
'exiftool': 'p5-Image-ExifTool-devel',
'imagemagick': 'ImageMagick',
- 'mariadb': 'mariadb101-server',
+ 'mariadb': 'mariadb102-server',
'node': 'node',
'pear': 'pear',
'phpcs': 'pear-PHP_CodeSniffer',
diff --git a/pillar/nodes/nodes.sls b/pillar/nodes/nodes.sls
--- a/pillar/nodes/nodes.sls
+++ b/pillar/nodes/nodes.sls
@@ -32,6 +32,8 @@
roles:
- devserver
- saltmaster
+ zfs:
+ pool: arcology
network:
ipv4_interface: igb0
ipv4_address: 163.172.49.16
diff --git a/roles/dbserver-mysql/init.sls b/roles/dbserver-mysql/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/dbserver-mysql/init.sls
@@ -0,0 +1,10 @@
+# -------------------------------------------------------------
+# Salt — Database server — MySQL
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-10-27
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .mysql-server
diff --git a/roles/dbserver-mysql/mysql-server/cnf.sls b/roles/dbserver-mysql/mysql-server/cnf.sls
new file mode 100644
--- /dev/null
+++ b/roles/dbserver-mysql/mysql-server/cnf.sls
@@ -0,0 +1,39 @@
+# -------------------------------------------------------------
+# 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') %}
+
+# -------------------------------------------------------------
+# Main my.cnf
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ dirs.etc }}/my.cnf:
+ file.managed:
+ - source: salt://roles/dbserver-mysql/mysql-server/files/my.cnf
+ - template: jinja
+ - context:
+ etc: {{ dirs.etc }}
+ use_zfs: {{ use_zfs }}
+
+# -------------------------------------------------------------
+# Required directories
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/var/run/mysqld:
+ file.directory:
+ - user: mysql
+ - group: mysql
+ - dir_mode: 755
+
+/var/db/mysql:
+ file.directory:
+ - user: mysql
+ - group: mysql
+ - dir_mode: 755
diff --git a/roles/dbserver-mysql/mysql-server/files/my.cnf b/roles/dbserver-mysql/mysql-server/files/my.cnf
new file mode 100644
--- /dev/null
+++ b/roles/dbserver-mysql/mysql-server/files/my.cnf
@@ -0,0 +1,78 @@
+# -------------------------------------------------------------
+# MySQL configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2015-04-21
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Client
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+[client]
+port = 3306
+socket = /var/run/mysqld/mysqld.sock
+
+[mysql]
+prompt = \u@\h [\d]>\_
+
+# -------------------------------------------------------------
+# Server wrapper
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+[mysqld_safe]
+pid-file = /var/run/mysqld/mysqld.pid
+socket = /var/run/mysqld/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
+basedir = /usr
+tmpdir = /tmp
+lc-messages-dir = /usr/share/mysql
+explicit_defaults_for_timestamp
+
+{% if use_zfs %}
+datadir = /var/db/mysql/mysql-root
+{% else %}
+datadir = /var/db/mysql
+{% endif %}
+
+# -------------------------------------------------------------
+# InnoDB / XtraDB configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+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
+
+skip-innodb_doublewrite
+{% endif %}
+
+# -------------------------------------------------------------
+# Applications configuration
+#
+# :: Phabricator
+# :: OTRS
+#
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+# Phabricator
+sql_mode = STRICT_ALL_TABLES
+max_allowed_packet = 33554432
+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/init.sls b/roles/dbserver-mysql/mysql-server/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/dbserver-mysql/mysql-server/init.sls
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------
+# Salt — Database server — MySQL
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-10-27
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .software
+ - .zfs
+ - .cnf
diff --git a/roles/dbserver-mysql/mysql-server/software.sls b/roles/dbserver-mysql/mysql-server/software.sls
new file mode 100644
--- /dev/null
+++ b/roles/dbserver-mysql/mysql-server/software.sls
@@ -0,0 +1,18 @@
+# -------------------------------------------------------------
+# Salt — Database server — MySQL
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-10-27
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import packages with context %}
+
+# -------------------------------------------------------------
+# MySQL server
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+mysql_server_software:
+ pkg.installed:
+ - pkgs:
+ - {{ packages.mariadb }}
diff --git a/roles/dbserver-mysql/mysql-server/zfs.sls b/roles/dbserver-mysql/mysql-server/zfs.sls
new file mode 100644
--- /dev/null
+++ b/roles/dbserver-mysql/mysql-server/zfs.sls
@@ -0,0 +1,37 @@
+# -------------------------------------------------------------
+# Salt — Database server — MySQL
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-10-27
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% if salt['node.has']('zfs:pool') %}
+
+{% set tank = salt['pillar.get']("nodes:" + grains['id'] + ":zfs:pool", '') %}
+
+{{ tank }}/mysql-innodb-data:
+ zfs.filesystem_present:
+ - properties:
+ mountpoint: /var/db/mysql/mysql-innodb-data
+ compression: lz4
+ recordsize: 16k
+ primarycache: metadata
+
+{{ tank }}/mysql-innodb-logs:
+ zfs.filesystem_present:
+ - properties:
+ mountpoint: /var/db/mysql/mysql-innodb-logs
+ compression: lz4
+ recordsize: 128k
+ primarycache: metadata
+
+{{ tank }}/mysql-root:
+ zfs.filesystem_present:
+ # This one is optimized for Aria/MyISAM
+ - properties:
+ mountpoint: /var/db/mysql/mysql-root
+ compression: lz4
+ recordsize: 8k
+
+{% endif %}
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -19,6 +19,7 @@
- roles/saltmaster
'ysul':
- roles/paas-jails
+ - roles/dbserver-mysql
- roles/webserver-core
- roles/webserver-legacy
- roles/webserver-varnish
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 14:16 (18 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2309561
Default Alt Text
D1122.id3002.diff (7 KB)
Attached To
Mode
D1122: Provision MySQL
Attached
Detach File
Event Timeline
Log In to Comment