tar -xvzf glusterfs-3.3.1.tar.gz
clear
ls
cd glusterfs-3.3.1
yum search flex
yum install -y flex.x86_64
yum search bison
yum install -y bison-devel.x86_64
yum install -y bison.x86_64
yum search openssl
yum install -y openssl-devel.x86_64
./configure-enable-dependency-tracking -enable-lib -enable-util -enable-kernel-module-prefix=
make
make install
mkdir /data/gluster
chmod 1777 /data/gluster
cd /etc/
cd glusterfs/
cat glusterd.vol
vi glusterd.vol
server:
### Export volume"brick" with the contents of "/data/gluster" directory.
volume brick
type storage/posix # POSIX FS translator
option directory /data/gluster # Export this directory
end-volume
### Add network servingcapability to above brick.
volume server
type protocol/server
option transport-type tcp # For TCP/IP transport
option transport.socket.listen-port 24016
# option transport-typeib-verbs # For Infiniband Verbs transport
# optiontransport.ib-verbs.work-request-send-size 131072
# optiontransport.ib-verbs.work-request-send-count 64
# optiontransport.ib-verbs.work-request-recv-size 131072
# optiontransport.ib-verbs.work-request-recv-count 64
# optiontransport.ib-verbs.listen-port 24016
# option bind-address 192.168.1.10 # Default is to listen on all interfaces
# optionclient-volume-filename /etc/glusterfs/glusterfs-client.vol
subvolumes brick
option auth.addr.brick.allow 192.168.* #Allow access to "brick" volume
end-volume
client:
volume client0
type protocol/client
option transport-type tcp # for TCP/IP transport
# option transport-typeib-sdp # for Infiniband transport
option remote-host 192.168.50.143 # IP address of the remote brick
option transport.socket.remote-port 24016
# option transport-typeib-verbs # for Infiniband verbs transport
# optiontransport.ib-verbs.work-request-send-size 1048576
# optiontransport.ib-verbs.work-request-send-count 16
# optiontransport.ib-verbs.work-request-recv-size 1048576
# option transport.ib-verbs.work-request-recv-count16
# optiontransport.ib-verbs.remote-port 24016
option remote-subvolume brick # name of the remote volume
# optiontransport-timeout 30 # defaultvalue is 120seconds
end-volume
volume client1
type protocol/client
option transport-type tcp # for TCP/IP transport
# option transport-typeib-sdp # for Infiniband transport
option remote-host 192.168.50.144 # IP address of the remote brick
option transport.socket.remote-port 24016
# option transport-typeib-verbs # for Infiniband verbs transport
# optiontransport.ib-verbs.work-request-send-size 1048576
# optiontransport.ib-verbs.work-request-send-count 16
# optiontransport.ib-verbs.work-request-recv-size 1048576
# option transport.ib-verbs.work-request-recv-count16
# optiontransport.ib-verbs.remote-port 24016
option remote-subvolume brick # name of the remote volume
# optiontransport-timeout 30 # defaultvalue is 120seconds
end-volume
volume client2
type protocol/client
option transport-type tcp # for TCP/IP transport
# option transport-typeib-sdp # for Infiniband transport
option remote-host 192.168.50.145 # IP address of the remote brick
option transport.socket.remote-port 24016
# option transport-typeib-verbs # for Infiniband verbs transport
# optiontransport.ib-verbs.work-request-send-size 1048576
# optiontransport.ib-verbs.work-request-send-count 16
# optiontransport.ib-verbs.work-request-recv-size 1048576
# option transport.ib-verbs.work-request-recv-count16
# optiontransport.ib-verbs.remote-port 24016
option remote-subvolume brick # name of the remote volume
# optiontransport-timeout 30 # defaultvalue is 120seconds
end-volume
volume client3
type protocol/client
option transport-type tcp # for TCP/IP transport
# option transport-typeib-sdp # for Infiniband transport
option remote-host 192.168.50.146 # IP address of the remote brick
option transport.socket.remote-port 24016
# option transport-typeib-verbs # for Infiniband verbs transport
# optiontransport.ib-verbs.work-request-send-size 1048576
# optiontransport.ib-verbs.work-request-send-count 16
# optiontransport.ib-verbs.work-request-recv-size 1048576
# option transport.ib-verbs.work-request-recv-count16
# optiontransport.ib-verbs.remote-port 24016
option remote-subvolume brick # name of the remote volume
# optiontransport-timeout 30 # defaultvalue is 120seconds
end-volume
volume client4
type protocol/client
option transport-type tcp # for TCP/IP transport
# option transport-typeib-sdp # for Infiniband transport
option remote-host 192.168.50.147 # IP address of the remote brick
option transport.socket.remote-port 24016
# option transport-typeib-verbs # for Infiniband verbs transport
# optiontransport.ib-verbs.work-request-send-size 1048576
# optiontransport.ib-verbs.work-request-send-count 16
# optiontransport.ib-verbs.work-request-recv-size 1048576
# option transport.ib-verbs.work-request-recv-count16
# optiontransport.ib-verbs.remote-port 24016
option remote-subvolume brick # name of the remote volume
# optiontransport-timeout 30 # defaultvalue is 120seconds
end-volume
volume client5
type protocol/client
option transport-type tcp # for TCP/IP transport
# option transport-typeib-sdp # for Infiniband transport
option remote-host 192.168.50.148 # IP address of the remote brick
option transport.socket.remote-port 24016
# option transport-typeib-verbs # for Infiniband verbs transport
# optiontransport.ib-verbs.work-request-send-size 1048576
# optiontransport.ib-verbs.work-request-send-count 16
# optiontransport.ib-verbs.work-request-recv-size 1048576
# option transport.ib-verbs.work-request-recv-count16
# optiontransport.ib-verbs.remote-port 24016
option remote-subvolume brick # name of the remote volume
# optiontransport-timeout 30 # defaultvalue is 120seconds
end-volume
volume unify
type cluster/distribute
subvolumes client0client1 client2 client3 client4 client5
end-volume
scp hadoop43:/etc/glusterfs/glusterd.vol/etc/glusterfs/glusterd.vol
服务器启动:
glusterfsd -l /etc/glusterfs/g.log -f /etc/glusterfs/glusterd.vol
ps ax|grep -v grep |grep gluster
客户端启动:
glusterfs -l /etc/glusterfs/glusterfs.log-f /etc/glusterfs/glusterd.vol /mnt/glusterfs
df –h
service glusterd stop
service glusterd start
service glusterd status
umount /mnt/glusterfs
kill –s 9 13880