glusterfs

git clone git://git.gluster.com/glusterfs.git

yum install gcc autoconf automake libtool flex openssl* bison

./autogen.sh

./configure

make

make install

mkdir /usr/local/include/glusterfs/

cp glusterfs/libglusterfs/src/*.h /usr/local/include/glusterfs/

cp glusterfs/config.h /usr/local/include/glusterfs/

cp glusterfs/contrib/uuid/uuid.h /usr/local/include/glusterfs/

 

 

 

 qemu

 yum install glib2-devel

 yum install libuuid-devel

 

 ./configure --disable-werror --target-list=x86_64-softmmu --enable-glusterfs --enable-uuid

 ./configure --disable-werror --target-list=x86_64-softmmu --enable-glusterfs

 

 GlusterFS support yes

 

 make

 make install

vim /etc/profile

export QEMU_HOME=/usr/local/qemu

export PATH=${QEMU_HOME}:${PATH}

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

source /etc/profile


ln -s ${QEMU_HOME}/bin/qemu-system-x86_64 /usr/bin/kvm

modprobe kvm

modprobe kvm_intel



qemu-system-x86_64 -enable-kvm -nographic -smp 4 -m 2048 -drive file=gluster://172.21.80.156/testVol/centos.raw,if=virtio,cache=none -vnc :5


돌아다니다가 외국에서 어떤 구루삘 나는 사람이 쓰길래...

일단 기록해놓음.

wget http://brick.kernel.dk/snaps/fio-2.0.10.tar.bz2

bzip2 -d fio-2.0.10.tar.bz2

tar xvf fio-2.0.10.tar

yum install libaio-devel

make && make install


vim random-read-test.fio

[random-read]

rw=randread

size=128m

directory=/data1

fio random-read-test.fio


https://www.linux.com/learn/tutorials/442451-inspecting-disk-io-performance-with-fio/

libvirt를 최신버전으로 바꾸면서 virt-manager를 사용할 수가 없게 되었다.

ip없이 vm을 생성하게 되면 확인할 방법이 없었는데,

vm에 vnc 포트를 넣어 생성하게 되면

vinagre를 통해서 vm을 확인할 수가 있다.


설치는 

# yum install vinagre

Ubuntu 12.04 로 3대의 서버 기준

# apt-get install ceph

# mkdir /var/lib/ceph/mon/ceph-a

# iptables -A INPUT -m multiport -p tcp -s 0/0 --dports 6789,6800:6810 -j ACCEPT

# mkfs.btrfs /dev/vda2

# mount /dev/vda2 /var/lib/ceph/osd/ceph-0/

/etc/ceph/ceph.conf

[global]

        auth supported = cephx

        keyring = /etc/ceph/$name.keyring

[mon]

        mon data = /brick/mon.$id

[osd]

        osd journal size = 1000

[mds]


[mon.a]

        host = node1

        mon addr = 172.21.81.243:6789

[mon.b]

        host = node2

        mon addr = 172.21.81.244:6789

[mon.c]

        host = node3

        mon addr = 172.21.81.245:6789

[osd.0]

        host = node1

[osd.1]

        host = node2

[osd.2]

        host = node3

[mds.a]

        host = node1


# mkcephfs -a -c /etc/ceph/ceph.conf -k /etc/ceph/admin.keyring

# /etc/init.d/ceph start

# ceph -c /etc/ceph/ceph.conf -k /etc/ceph/admin.keyring health


GlusterFS에서 Volume을 만들었다가 다른 Volume으로 이전 사용했던 Brick을 다시 사용하려고 할 경우,

${brick_path} or a prefix of it is already part of a volume

이와 같은 에러가 뜬다.

해결 방법은,

setfattr -x trusted.glusterfs.volume-id $brick_path
setfattr -x trusted.gfid $brick_path
rm -rf $brick_path/.glusterfs

자세한 내용은 아래 블로그를 참고.

http://joejulian.name/blog/glusterfs-path-or-a-prefix-of-it-is-already-part-of-a-volume/

Storage Pool Creation XML


Storage Volume Creation XML

Domain Creation XML

볼륨 생성이 실패를 하여 확인해보니,

Libvirt에서 아래와 같이 에러가 났다.

2012-09-19 06:09:15.007+0000: 15006: error : virFileOpenForceOwnerMode:796 : '/mnt/e57ef0ee-16c7-ed72-9726-53fa57612794/9098c1b7-b7ef-d155-fe58-70044f6aa41a'를 (0, 0)로 chown할 수 없음: 부적절한 인수

2012-09-19 06:09:15.007+0000: 15006: error : virStorageBackendCreateRaw:401 : 경로 /mnt/e57ef0ee-16c7-ed72-9726-53fa57612794/9098c1b7-b7ef-d155-fe58-70044f6aa41a를 생성할 수 없음: 부적절한 인수


권한 문제같아 확인해보니 nfs 로 마운트한 곳이 nobody로 되어 있었다.

drwxrwxrwx. 3 nobody nobody 20480 2012-09-19 20:29 e57ef0ee-16c7-ed72-9726-53fa57612794


참고로 nfs server의 설정은 아래와 같이 되어있다.

/home/data *(rw,async,no_root_squash)


구글링 한 결과 대충 nfs4 문제인거 같기도 하고, 설정문제같기도 한데, 일단은 버전을 바꿔서 임시로 해결하였다.

vim /etc/nfsmount.conf

Defaultvers=3

Nfsvers=3


version 4를 3으로 바꿔주고,

/etc/init.d/rpcbind restart

/etc/init.d/nfs restart


다시 마운트를 해보면 버전 3으로 되고 root로 되어 있다는 것을 확인할 수 있다.


설치 (configure 에서 error 나는 package 에 대해서는 추가 설치 필요)
# tar -xvf libvirt-0.X.X

# yum install gcc libc

# yum install libxml2-devel

# yum install gnutls gnutls-devel

# yum install device-mapper device-mapper-devel device-mapper-libs

# yum install python python-devel

# yum libnl-devel

# configure --prefix=/usr/local/libvirt

# make && make install


#./autogen.sh --system --prefix=/usr/local/libvirt --sysconfdir=/etc --localstatedir=/var

Path 설정

# vi /etc/profile

--> export LIBVIRT_HOME=/usr/local/libvirt

--> export PATH=${LIBVIRT_HOME}/bin:${LIBVIRT_HOME}/sbin:${PATH}

# . /etc/profile


링크설정

# cd /usr/sbin

# ln -s ${LIBVIRT_HOME}/sbin/libvirtd libvirtd

# cd /var/run

# ln -s ${LIBVIRT_HOME}/var/run/libvirt libvirt


데몬 서비스 복사

# cp ${LIBVIRT_HOME}/etc/rc.d/init.d/* /etc/rc.d/init.d/


functions 경로 수정

# vi /etc/rc.d/init.d/libvirtd

--> # Source function libriry

--> . /etc/rc.d/init.d/functions


데몬 시작

# service libvirtd start

+ Recent posts