-
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 30, 2014
1 parent
2256394
commit 46a3357
Showing
11 changed files
with
108 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,7 @@ | ||
--- | ||
- hosts: "{{host}}" | ||
remote_user: "{{user}}" | ||
gather_facts: True | ||
roles: | ||
- common | ||
- fio_install |
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,3 @@ | ||
- 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 libselinux-python | ||
poll: 0 |
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 @@ | ||
#!/bin/bash | ||
awk -v result=`df -h|egrep -Ev '(Filesystem|shm|boot|mapper|/$)'|awk '{print $NF}'|head -n 1` 'BEGIN{if(result=="") {print "/tmp"} else {print result}}' |
Binary file not shown.
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 Fio | ||
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,50 @@ | ||
- name: Install Fio Require Software To Redhat Client | ||
yum: name=libaio-devel state=latest | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Only_install_fio | ||
- name: Copy Fio Software To Redhat Client | ||
copy: src={{ item }} dest=/tmp/{{ item }} owner=root group=root | ||
with_items: | ||
- fio-{{ fio_version }}.tar.gz | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Only_install_fio | ||
- name: Uncompression Fio Software In Redhat Client | ||
shell: tar zxf /tmp/fio-{{ fio_version }}.tar.gz -C /tmp/ | ||
ignore_errors: yes | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Only_install_fio | ||
- name: Install Fio Software In Redhat Client | ||
shell: "cd /tmp/fio-{{ fio_version }}; make && make install" | ||
ignore_errors: yes | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Only_install_fio | ||
- name: Delete Old Software In Redhat Client | ||
shell: rm -rf /tmp/fio-{{ fio_version }}.tar.gz /tmp/fio-{{ fio_version }} | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Only_install_fio | ||
- 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: Copy Test Disk Script In Redhat Client | ||
copy: src=check_disk.sh dest=/tmp/check_disk.sh owner=root group=root mode=0755 | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Get Test Disk info In Redhat Client | ||
shell: /bin/bash /tmp/check_disk.sh | ||
register: test_disk | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Start Fio Random Write And Read Test In Redhat Client | ||
shell: /usr/local/bin/fio -filename={{ test_disk.stdout }}/{{ filename }} -direct={{ direct }} -iodepth {{ iodepth }} -thread -rw={{ rw }} -rwmixread={{ rwmixread }} -ioengine={{ ioengine }} -bs={{ bs }} -size={{ size }} -numjobs={{ numjobs }} -runtime={{ runtime }} -group_reporting -name={{ name }} -ioscheduler={{ ioscheduler }} --output=/tmp/{{ ansible_hostname }}-fio-{{ time.stdout }}.log | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Copy Fio Test Result from Redhat Client | ||
fetch: src=/tmp/{{ ansible_hostname }}-fio-{{ time.stdout }}.log dest=/tmp/{{ ansible_hostname }}-fio-{{ time.stdout }}.log flat=yes | ||
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6 | ||
tags: Onlytest | ||
- name: Delete Fio Test Log In Redhat Client | ||
shell: rm -rf {{ test_disk.stdout }}/{{ filename }} /tmp/{{ ansible_hostname }}-fio-{{ time.stdout }}.log /tmp/check_disk.sh | ||
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,14 @@ | ||
fio_dir: /tmp/fio_log | ||
fio_version: 2.1.11 | ||
filename: random_write_read | ||
direct: 1 | ||
iodepth: 1 | ||
rw: randrw | ||
rwmixread: 70 | ||
ioengine: psync | ||
bs: 16K | ||
size: 2G | ||
numjobs: 30 | ||
runtime: 1000 | ||
name: random_read_write | ||
ioscheduler: noop |