Skip to content

Commit

Permalink
mysql config modify
Browse files Browse the repository at this point in the history
  • Loading branch information
denglei committed Aug 27, 2014
1 parent 37a2aa6 commit 18076c3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ chown -R {{ mysql_user }}:{{ mysql_user }} {{ mysql_datadir }} {{ mysql_basedir
{{ mysql_basedir }}/scripts/mysql_install_db --defaults-file={{ mysql_datadir }}/my.cnf --basedir={{ mysql_basedir }} --datadir={{ mysql_datadir }} --user={{ mysql_user }} >> /dev/null 2>&1 &

/etc/init.d/mysqld start &
rm -rf /usr/bin/mysql /usr/bin/mysql_config
ln -s {{ mysql_basedir }}/bin/mysql /usr/bin/mysql
ln -s {{ mysql_basedir }}/bin/mysql_config /usr/bin/mysql_config
ln -s {{ mysql_sock }} /tmp/mysql.sock
Expand Down
10 changes: 6 additions & 4 deletions mysql_tpcc_install/roles/mysql_install/templates/my.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
log-error = {{ mysql_datadir }}/mysql-error.log
pid-file = {{ mysql_datadir }}/mysql.pid
log-bin = {{ mysql_datadir }}/mysql-bin
log_bin_trust_function_creators = 1
skip-external-locking
skip-name-resolve
skip-symbolic-links
Expand All @@ -20,8 +21,9 @@
binlog_cache_size=64M
max_binlog_cache_size=128M
max_binlog_size=1G
expire_logs_days=7

expire_logs_days=7
sync_binlog = 1
max_prepared_stmt_count = 65535
key_buffer_size = 384M
sort_buffer_size = 2M
read_buffer_size = 2M
Expand All @@ -34,7 +36,7 @@
wait_timeout = 120

table_cache = 4069
table_open_cache = 512
table_open_cache = 1024
open_files_limit = 10240
back_log=600

Expand All @@ -58,7 +60,7 @@
innodb_data_file_path = ibdata1:2G:autoextend
innodb_data_home_dir = {{ mysql_datadir }}
innodb_log_group_home_dir = {{ mysql_datadir }}
innodb_file_io_threads = 4
innodb_file_io_threads = 8
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 256M
Expand Down
9 changes: 7 additions & 2 deletions mysql_tpcc_install/roles/mysql_tpcc_install/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
- name: Install Base Require Software In Redhat Client
yum: name=bzr state=latest
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: get the current time In Redhat Client
command: date +%Y%m%d%H%M
register: time
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
tags: Onlytest
- name: Download Tpcc Software To Redhat Client
shell: "cd /tmp ; bzr branch lp:~percona-dev/perconatools/tpcc-mysql"
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
Expand All @@ -22,10 +27,10 @@
shell: /tmp/tpcc-mysql/tpcc_load {{ ansible_default_ipv4.address }} {{ tpcc_database_name }} {{ mysql_database_user }} {{ mysql_passwd }} {{ warehouse }}
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Start Mysql Tpcc Test In Redhat Client
shell: /tmp/tpcc-mysql/tpcc_start -h {{ ansible_default_ipv4.address }} -u {{ mysql_database_user }} -p{{ mysql_passwd }} -d {{ tpcc_database_name }} -w {{ w }} -c {{ c }} -r {{ r }} -l {{ l }} -f {{ f }} > /tmp/tpcc-mysql/{{ f }}.log
shell: /tmp/tpcc-mysql/tpcc_start -h {{ ansible_default_ipv4.address }} -u {{ mysql_database_user }} -p{{ mysql_passwd }} -d {{ tpcc_database_name }} -w {{ w }} -c {{ c }} -r {{ r }} -l {{ l }} -f {{ f }}_{{ ansible_hostname }}-{{ time.stdout }}-{{ r }}.log > /tmp/tpcc-mysql/{{ f }}_{{ ansible_hostname }}-{{ time.stdout }}-{{ r }}.log
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
tags: Onlytest
- name: Copy Mysql Tpcc Result from Redhat Client
fetch: src=/tmp/tpcc-mysql/{{ f }}.log dest=/tmp/mysql-tpcc-{{ ansible_default_ipv4.address }}.log flat=yes
fetch: src=/tmp/tpcc-mysql/{{ f }}_{{ ansible_hostname }}-{{ time.stdout }}-{{ r }}.log dest=/tmp/{{ f }}_{{ ansible_hostname }}-{{ time.stdout }}-{{ r }}.log flat=yes
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
tags: Onlytest
2 changes: 1 addition & 1 deletion mysql_tpcc_install/roles/mysql_tpcc_install/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ w: 50
c: 50
r: 30
l: 300
f: 'tpcc-mysql-result'
f: 'tpcc-mysql'

0 comments on commit 18076c3

Please sign in to comment.