Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

Commit

Permalink
Moving to be InnoDB-specific
Browse files Browse the repository at this point in the history
  • Loading branch information
seldo committed Aug 12, 2014
1 parent 59f50b4 commit a4e7642
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 279 deletions.
66 changes: 1 addition & 65 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,65 +1 @@
# Test files
dump.sql.bz2

# VIM specific files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
bin/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Rope
.ropeproject

# Django stuff:
*.log
*.pot

# Sphinx documentation
docs/_build/

.idea
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Ansible Role: Percona

Ansible playbook to install percona MySQL server in Debian/Ubuntu servers

[![Build Status](https://api.travis-ci.org/overdrive3000/ansible-percona.svg)](https://travis-ci.org/overdrive3000/ansible-percona/)
Ansible playbook to install Percona MySQL server on Debian/Ubuntu servers

## Requirements

Expand Down
53 changes: 35 additions & 18 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
---
# Define root password for percona server
root_password: reallylongpassword
# file: mysql/defaults/main.yml

# Some defaults variables for percona server config file
port: 3306
bind_address: 0.0.0.0
max_allowed_packet: 16M
key_buffer: 16M
thread_stack: 192K
thread_cache_size: 8
# Uncomment following vars if you want to log queries
sqldebug: true
log_slow_queries: log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time: long_query_time = 2
log_queries_not_using_indexes: log-queries-not-using-indexes
# Basic settings
mysql_port: 3306
mysql_bind_address: "0.0.0.0"
mysql_root_password: 'pass'
mysql_language: '/usr/share/mysql/'

# Define is a database must be created
create_app_db: true
# Fine Tuning
mysql_key_buffer: '16M'
mysql_max_allowed_packet: '128M'
mysql_thread_stack: '192K'
mysql_cache_size: 8
mysql_myisam_recover: 'BACKUP'
mysql_max_connections: 100
mysql_table_cache: 64
mysql_thread_concurrency: 10
mysql_query_cache_limit: '1M'
mysql_query_cache_size: '16M'
mysql_innodb_file_per_table: 'innodb_file_per_table'
mysql_character_set_server: 'utf8'
mysql_collation_server: 'utf8_general_ci'
mysql_mysqldump_max_allowed_packet: '128M'
mysql_isamchk_key_buffer: '16M'

# InnoDB tuning
mysql_innodb_file_per_table: 'innodb_file_per_table'
mysql_innodb_flush_method: 'fdatasync'
mysql_innodb_buffer_pool_size: '128M'
mysql_innodb_flush_log_at_trx_commit: 1
mysql_innodb_lock_wait_timeout: 50
mysql_innodb_log_buffer_size: '1M'
mysql_innodb_log_file_size: '5M'

# Create from a DB dump?
create_app_db: false
db_name: mydatabase
db_collation: utf8_general_ci
db_user: myuser
db_user_password: anotherreallylongpassword
db_host: "%"
db_dump_file: ""
db_dump_file: ""
7 changes: 4 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
galaxy_info:
author: "Juan Mesa"
company: gochos
license: BSD
author: "Laurie Voss"
company: "npm Inc"
license: ISC
min_ansible_version: 1.4
platforms:
- name: Ubuntu
versions:
- trusty
- saucy
- precise
- name: Debian
Expand Down
11 changes: 1 addition & 10 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,7 @@
- name: remove test database
mysql_db: name=test state=absent

- name: Create fnv1a_64
shell: /usr/bin/mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'" && touch /var/log/libfnv1a_udf.so.done creates=/var/log/libfnv1a_udf.so.done

- name: Create fnv_64
shell: /usr/bin/mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'" && touch /var/log/libfnv_udf.so.done creates=/var/log/libfnv_udf.so.done

- name: Create murmur_hash
shell: /usr/bin/mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'" && touch /var/log/libmurmur_udf.so.done creates=/var/log/libmurmur_udf.so.done

- name: Write custom server configuration
template: src=my.cnf.j2 dest=/etc/mysql/my.cnf owner=root mode=0622
template: src=etc_mysql_my.cnf.j2 dest=/etc/mysql/my.cnf owner=root mode=0622
notify:
- restart percona
2 changes: 1 addition & 1 deletion tasks/repo.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# file: tasks/repo.tml

- name: Obtianing percona public key
- name: Obtaining percona public key
apt_key: url=http://www.percona.com/downloads/RPM-GPG-KEY-percona
state=present

Expand Down
100 changes: 100 additions & 0 deletions templates/etc_mysql_my.cnf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#
# The MySQL database server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[client]
port = {{ mysql_port }}
socket = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
# * Basic Settings
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = {{ mysql_port }}
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
# language is for pre-5.5. In 5.5 it is an alias for lc_messages_dir.
language = {{ mysql_language }}
bind-address = {{ mysql_bind_address }}
skip-external-locking


# * Fine Tuning
key_buffer = {{ mysql_key_buffer }}
max_allowed_packet = {{ mysql_max_allowed_packet }}
thread_stack = {{ mysql_thread_stack }}
thread_cache_size = {{ mysql_cache_size }}
myisam-recover = {{ mysql_myisam_recover }}
max_connections = {{ mysql_max_connections }}
table_open_cache = {{ mysql_table_cache }}
thread_concurrency = {{ mysql_thread_concurrency }}

# ** Query Cache Configuration
query_cache_limit = {{ mysql_query_cache_limit }}
query_cache_size = {{ mysql_query_cache_size }}

# ** Logging and Replication
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name

# ** InnoDB
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
innodb_flush_log_at_trx_commit = {{ mysql_innodb_flush_log_at_trx_commit }}
innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }}
{% if mysql_innodb_flush_method != 'fdatasync': %}
innodb_flush_method = {{ mysql_innodb_flush_method }}
{% endif %}
innodb_lock_wait_timeout = {{ mysql_innodb_lock_wait_timeout }}
innodb_log_buffer_size = {{ mysql_innodb_log_buffer_size }}
innodb_log_file_size = {{ mysql_innodb_log_file_size }}
{{ mysql_innodb_file_per_table }}

# ** Security Features
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

character_set_server = {{ mysql_character_set_server }}
collation_server = {{ mysql_collation_server }}

[mysqldump]
quick
quote-names
max_allowed_packet = {{ mysql_mysqldump_max_allowed_packet }}

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = {{ mysql_isamchk_key_buffer }}

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Loading

0 comments on commit a4e7642

Please sign in to comment.