-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
denglei
committed
Aug 28, 2014
1 parent
745d4f2
commit 556b793
Showing
14 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
本文介绍使用ansible的playbook功能在centos或者redhat 6系列系统里安装sysbench测试数据库负载情况. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- name: restart ntpd | ||
service: name=ntpd state=restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
galaxy_info: | ||
author: Deng Lei | ||
description: Install initializtion Software | ||
license: MIT | ||
min_ansible_version: 1.6 | ||
platforms: | ||
- name: CentOS | ||
versions: | ||
- 5 | ||
- 6 | ||
- name: Ubuntu | ||
versions: | ||
- precise | ||
categories: | ||
- system | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- name: Install initializtion require software | ||
shell: yum -y install make cmake bc gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel nss_ldap openldap openldap-devel openldap-clients openldap-servers libxslt-devel libevent-devel ntp libtool-ltdl bison libtool vim-enhanced tar wget readline-devel libyaml-devel patch telnet dmidecode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
galaxy_info: | ||
author: Deng Lei | ||
description: Delete Sysbench | ||
license: MIT | ||
min_ansible_version: 1.6 | ||
platforms: | ||
- name: CentOS | ||
versions: | ||
- 6 | ||
categories: | ||
- Test | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- name: Delete Sysbench Test Log Dir | ||
shell: rm -rf {{ sysbench_log_dir }} | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- include: delete.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sysbench_log_dir: /tmp/sysbench_test_log | ||
cpu_max_prime: 20000 | ||
num_threads: 64 | ||
mutex_loops: 5000 | ||
mutex_locks: 1000000 | ||
mutex_num: 2048 | ||
memory_total_size: 8G | ||
memory_block_size: 8K | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
galaxy_info: | ||
author: Deng Lei | ||
description: Install Sysbench | ||
license: MIT | ||
min_ansible_version: 1.6 | ||
platforms: | ||
- name: CentOS | ||
versions: | ||
- 6 | ||
categories: | ||
- Test | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
- name: Install Base Require Software In Redhat Client | ||
yum: name=sysbench state=latest | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Only_install_sysbench | ||
- name: Create Sysbench Test Log Dir In Redhat Client | ||
file: dest={{ sysbench_log_dir }} state=directory | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- 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: Start Sysbench Cpu Test In Redhat Client | ||
shell: sysbench --test=cpu --num-threads=`grep "processor" /proc/cpuinfo | wc -l` --cpu-max-prime={{ cpu_max_prime }} run > {{ sysbench_log_dir }}/sysbench_cputest_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Start Sysbench Threads Test In Redhat Client | ||
shell: sysbench --test=threads --num-threads={{ num_threads }} run > {{ sysbench_log_dir }}/sysbench_threads_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Start Sysbench Mutex Test In Redhat Client | ||
shell: sysbench --test=mutex --num-threads={{ num_threads }} --mutex-num={{ mutex_num }} --mutex-locks={{ mutex_locks }} --mutex-loops={{ mutex_loops }} run > {{ sysbench_log_dir }}/sysbench_mutexxx_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Start Sysbench Memory Test In Redhat Client | ||
shell: sysbench --test=memory --memory-block-size={{ memory_block_size }} --memory-total-size={{ memory_total_size }} --num-threads={{ num_threads }} run > {{ sysbench_log_dir }}/sysbench_memory_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Copy Sysbench Test Result from Redhat Client | ||
fetch: src={{ sysbench_log_dir }}/{{ item }} dest=/tmp/{{ item }} flat=yes | ||
with_items: | ||
- sysbench_cputest_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
- sysbench_threads_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
- sysbench_mutexxx_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
- sysbench_memory_{{ ansible_hostname }}-{{ time.stdout }}.log | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- include: install.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sysbench_log_dir: /tmp/sysbench_test_log | ||
cpu_max_prime: 20000 | ||
num_threads: 64 | ||
mutex_loops: 5000 | ||
mutex_locks: 1000000 | ||
mutex_num: 2048 | ||
memory_total_size: 8G | ||
memory_block_size: 8K | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- hosts: "{{host}}" | ||
remote_user: "{{user}}" | ||
gather_facts: True | ||
roles: | ||
- sysbench_delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- hosts: "{{host}}" | ||
remote_user: "{{user}}" | ||
gather_facts: True | ||
roles: | ||
- common | ||
- sysbench_install |