This file contains hidden or 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
#fio 是测试磁盘性能的最佳工具: | |
#1、测试顺序读性能 | |
fio --filename=/home/test -iodepth=64 -ioengine=libaio --direct=1 --rw=read --bs=1m --size=2g --numjobs=4 --runtime=10 --group_reporting --name=test-read | |
#2、测试顺序写性能 | |
fio -filename=/home/test -iodepth=64 -ioengine=libaio -direct=1 -rw=write -bs=1m -size=2g -numjobs=4 -runtime=20 -group_reporting -name=test-write | |
#3、测试随机读性能 | |
fio -filename=/home/test -iodepth=64 -ioengine=libaio -direct=1 -rw=randread -bs=4k -size=2G -numjobs=64 -runtime=20 -group_reporting -name=test-rand-read |
This file contains hidden or 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
#!/usr/bin/env python | |
#-*-coding=utf-8-*- | |
import hashlib | |
import sys | |
def chunkreadable(iter, chunk_size=65536): | |
""" |
This file contains hidden or 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
mv /var/lib/nova/instances/instance-00000026 /var/lib/nova/instances/instance-00000026_resize | |
mkdir -p /var/lib/nova/instances/instance-00000026 | |
qemu-img convert -f qcow2 -O qcow2 /var/lib/nova/instances/instance-00000026_resize/disk /var/lib/nova/instances/instance-00000026_resize/disk_rbase | |
mv /var/lib/nova/instances/instance-00000026_resize/disk_rbase /var/lib/nova/instances/instance-00000026/disk | |
qemu-img convert -f qcow2 -O qcow2 /var/lib/nova/instances/instance-00000026_resize/disk.local /var/lib/nova/instances/instance-00000026_resize/disk.local_rbase | |
mv /var/lib/nova/instances/instance-00000026_resize/disk.local_rbase /var/lib/nova/instances/instance-00000026/disk.local | |
finish_resize: |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import re | |
import socket | |
def get_localhost_ip(): | |
""" | |
Returns IP address of localhost. | |
""" |
This file contains hidden or 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
#!/usr/bin/python | |
import os, sys | |
try: | |
import packstack | |
except ImportError: | |
# packstack isn't installed, running from source checkout | |
sys.path.insert(0, os.path.join(os.path.split(sys.argv[0])[0], "..")) | |
import packstack |
This file contains hidden or 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
== Initial == | |
On controller node (192.168.122.163): | |
$ yum install openstack-keystone openstack-utils dnsmasq-utils -y | |
$ yum install openstack-glance openstack-cinder openstack-neutron \ | |
openstack-neutron-openvswitch -y | |
$ yum install openstack-nova -y | |
On compute (192.168.122.100): |
This file contains hidden or 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
expected_signature = hmac.new( | |
CONF.neutron_metadata_proxy_shared_secret, | |
instance_id, | |
hashlib.sha256).hexdigest() | |
# grep shared_secret /etc/nova/nova.conf | |
neutron_metadata_proxy_shared_secret=deadbeef2eb84d8d | |
Python 2.7.5 (default, Nov 12 2013, 16:18:42) | |
[GCC 4.8.2 20131017 (Red Hat 4.8.2-1)] on linux2 |
This file contains hidden or 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
--- | |
##prapare to install | |
# for all nodes | |
sudo useradd -d /home/ceph -m ceph | |
sudo passwd ceph | |
echo "ceph ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ceph | |
sudo chmod 0440 /etc/sudoers.d/ceph | |
##admin-node node(ceph and root) | |
ssh-keygen |
This file contains hidden or 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
syntax on | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 | |
set nu | |
set autoindent | |
set laststatus=2 | |
set list listchars=tab:>-,trail:- | |
set hlsearch | |
set smartindent |
This file contains hidden or 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
http://blog.csdn.net/k_james/article/details/12994145 | |
VM1: 192.168.1.11 | |
VM2: 192.168.1.13 | |
VIP: 192.168.1.201 | |
VM1: /etc/keepalived/keepalived.conf | |
vrrp_instance VI_NODE { | |
state MASTER | |
interface eth2 |