[root@localhost glusterfs-3.1.4] ./configure
[root@localhost glusterfs-3.1.4] make
[root@localhost glusterfs-3.1.4] make install
install on other servers.
[root@localhost glusterfs-3.1.4]# gluster peer probe 192.168.35.128
Connection failed. Please check if gluster daemon is operational.
[root@localhost glusterfs-3.1.4]# /etc/init.d/glusterd start
Starting glusterd: [ OK ]
start on other servers.
[root@localhost glusterfs-3.1.4]# gluster peer probe 192.168.35.128
[root@localhost glusterfs-3.1.4]# gluster peer status
Number of Peers: 1
Hostname: 192.168.35.128
Uuid: 00000000-0000-0000-0000-000000000000
State: Establishing Connection (Disconnected)-----------------------------firewall problem. setup:disable firewall.
[root@localhost glusterfs-3.1.4]#
[root@localhost ~]# gluster peer detach 192.168.35.128
Detach successful
[root@localhost glusterfs-3.1.4]# chkconfig glusterd on
[root@localhost glusterfs-3.1.4]# chkconfig --list|grep glusterd
glusterd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost glusterfs-3.1.4]#
[root@localhost ~]# gluster peer probe 192.168.35.128
Probe successful
[root@localhost ~]# gluster peer status
Number of Peers: 1
Hostname: 192.168.35.128
Uuid: 120a6543-97d5-46f0-8710-989ee3881adc
State: Peer in Cluster (Connected)
[root@localhost opt]# ls
glusterfs-3.1.4 glusterfs-3.1.4.tar.gz
[root@localhost opt]# mkdir dir1
[root@localhost opt]# mkdir dir2
[root@localhost opt]# gluster volume create test-volume replica 2 transport tcp 192.168.102.128:/opt/dir1 192.168.102.129:/opt/dir1
192.168.102.128:/opt/dir2 192.168.102.129:/opt/dir2
Creation of volume test-volume has been successful. Please start the volume to access data.
[root@localhost opt]# gluster volume start test-volume
Starting volume test-volume has been successful
[root@localhost opt]# gluster volume info
Volume Name: test-volume
Type: Distributed-Replicate
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: 192.168.102.128:/opt/dir1
Brick2: 192.168.102.129:/opt/dir1
Brick3: 192.168.102.128:/opt/dir2
Brick4: 192.168.102.129:/opt/dir2
[root@localhost opt]# mount -t glusterfs 192.168.102.128:/test-volume /mnt
Mount failed. Please check the log file for more details.
[root@localhost opt]# modprobe fuse
[root@localhost opt]# mount -t glusterfs 192.168.102.128:/test-volume /mnt
[root@localhost opt]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
18187836 3839184 13409852 23% /
/dev/sda1 101086 12554 83313 14% /boot
tmpfs 255132 0 255132 0% /dev/shm
glusterfs#192.168.102.128:/test-volume
36375552 7678336 26819584 23% /mnt
[root@localhost opt]# cd /mnt
[root@localhost mnt]# ls
[root@localhost mnt]# ls
[root@localhost mnt]# cp /opt/glusterfs-3.1.4.tar.gz .
[root@localhost mnt]# ls
glusterfs-3.1.4.tar.gz
[root@localhost mnt]# du -sh glusterfs-3.1.4.tar.gz
2.1M glusterfs-3.1.4.tar.gz
[root@localhost mnt]# cd /opt
[root@localhost opt]# ls
dir1 dir2 glusterfs-3.1.4 glusterfs-3.1.4.tar.gz
[root@localhost opt]# cd dir1
[root@localhost dir1]# ls
[root@localhost dir1]# cd ..
[root@localhost opt]# ls
dir1 dir2 glusterfs-3.1.4 glusterfs-3.1.4.tar.gz
[root@localhost opt]# cd dir2
[root@localhost dir2]# ls
glusterfs-3.1.4.tar.gz
[root@localhost dir2]# du -sh glusterfs-3.1.4.tar.gz
2.1M glusterfs-3.1.4.tar.gz
[root@localhost dir2]# cd /etc/glusterd/
glusterd.info nfs/ peers/ vols/
[root@localhost dir2]# cd /etc/glusterd/
glusterd.info nfs/ peers/ vols/
[root@localhost dir2]# cd /etc/glusterd/vols/
[root@localhost vols]# ls
test-volume
[root@localhost vols]# cd test-volume/
[root@localhost test-volume]# ls
bricks info test-volume.192.168.102.128.opt-dir1.vol test-volume.192.168.102.129.opt-dir1.vol test-volume-fuse.vol
cksum run test-volume.192.168.102.128.opt-dir2.vol test-volume.192.168.102.129.opt-dir2.vol
[root@localhost test-volume]# vi test-volume-fuse.vol
Added cscope database /opt/glusterfs-3.1.4/cscope.out
Press ENTER or type command to continue
1 volume test-volume-client-0
2 type protocol/client
3 option remote-host 192.168.102.128
4 option remote-subvolume /opt/dir1
5 option transport-type tcp
6 end-volume
7
8 volume test-volume-client-1
9 type protocol/client
10 option remote-host 192.168.102.129
11 option remote-subvolume /opt/dir1
12 option transport-type tcp
13 end-volume
14
15 volume test-volume-client-2
16 type protocol/client
17 option remote-host 192.168.102.128
18 option remote-subvolume /opt/dir2
19 option transport-type tcp
20 end-volume
21
22 volume test-volume-client-3
23 type protocol/client
24 option remote-host 192.168.102.129
19 option transport-type tcp
20 end-volume
21
22 volume test-volume-client-3
23 type protocol/client
24 option remote-host 192.168.102.129
25 option remote-subvolume /opt/dir2
26 option transport-type tcp
27 end-volume
28
29 volume test-volume-replicate-0
30 type cluster/replicate
31 subvolumes test-volume-client-0 test-volume-client-1
32 end-volume
33
34 volume test-volume-replicate-1
35 type cluster/replicate
36 subvolumes test-volume-client-2 test-volume-client-3
37 end-volume
38
39 volume test-volume-dht
40 type cluster/distribute
41 subvolumes test-volume-replicate-0 test-volume-replicate-1
42 end-volume
43
44 volume test-volume-write-behind
45 type performance/write-behind
46 subvolumes test-volume-dht
47 end-volume
[root@localhost test-volume]# ls
bricks info test-volume.192.168.102.128.opt-dir1.vol test-volume.192.168.102.129.opt-dir1.vol test-volume-fuse.vol
cksum run test-volume.192.168.102.128.opt-dir2.vol test-volume.192.168.102.129.opt-dir2.vol
[root@localhost test-volume]# cd /opt
[root@localhost opt]# ls
dir1 dir2 glusterfs-3.1.4 glusterfs-3.1.4.tar.gz
[root@localhost opt]# cd dir1
[root@localhost dir1]# cd glusterfs-3.1.4/
[root@localhost glusterfs-3.1.4]# ls
aclocal.m4 autogen.sh config.sub COPYING extras glusterfs.spec.in Makefile NEWS xlators
argp-standalone cli configure.ac cscope.out glusterfsd libglusterfs Makefile.am rpc
AUTHORS config.h contrib doc glusterfs.spec libtool missing THANKS
[root@localhost glusterfs-3.1.4]# cd ../../dir2
[root@localhost dir2]# ls
glusterfs-3.1.4 glusterfs-3.1.4.tar.gz
[root@localhost dir2]# cd glusterfs-3.1.4
[root@localhost glusterfs-3.1.4]# ls
argp-standalone compile config.log contrib depcomp glusterfsd libglusterfs README tags
ChangeLog config.guess config.status cscope.in.out doc INSTALL ltmain.sh rpc xlators
cli config.h.in configure cscope.po.out extras install-sh Makefile.in stamp-h1
[root@localhost glusterfs-3.1.4]# gluster
gluster glusterd glusterfs glusterfsd/
[root@localhost glusterfs-3.1.4]# gluster volume remove-brick test-volume 192.168.102.128:/opt/dir2 192.168.102.129:/opt/dir2
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
Remove Brick successful
[root@localhost glusterfs-3.1.4]# pwd
/opt/dir2/glusterfs-3.1.4
[root@localhost glusterfs-3.1.4]# ls
argp-standalone compile config.log contrib depcomp glusterfsd libglusterfs README tags
ChangeLog config.guess config.status cscope.in.out doc INSTALL ltmain.sh rpc xlators
cli config.h.in configure cscope.po.out extras install-sh Makefile.in stamp-h1
[root@localhost glusterfs-3.1.4]# cd /opt/dir1
[root@localhost dir1]# ls
glusterfs-3.1.4
[root@localhost dir1]# cd glusterfs-3.1.4/
[root@localhost glusterfs-3.1.4]# ls
aclocal.m4 autogen.sh config.sub COPYING extras glusterfs.spec.in Makefile NEWS xlators
argp-standalone cli configure.ac cscope.out glusterfsd libglusterfs Makefile.am rpc
AUTHORS config.h contrib doc glusterfs.spec libtool missing THANKS
[root@localhost glusterfs-3.1.4]# gluster volume add-brick test-volume 192.168.102.128:/opt/dir2 192.168.102.129:/opt/dir2
Add Brick successful
[root@localhost glusterfs-3.1.4]# gluster volume info
Volume Name: test-volume
Type: Distributed-Replicate
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: 192.168.102.128:/opt/dir1
Brick2: 192.168.102.129:/opt/dir1
Brick3: 192.168.102.128:/opt/dir2
Brick4: 192.168.102.129:/opt/dir2
[root@localhost glusterfs-3.1.4]# gluster volume remove-brick test-volume 192.168.102.128:/opt/dir2 192.168.102.129:/opt/dir2
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
Remove Brick successful
You have new mail in /var/spool/mail/root
[root@localhost glusterfs-3.1.4]# gluster volume add-brick test-volume 192.168.102.128:/opt/dir2 192.168.102.129:/opt/dir2
Add Brick successful
[root@localhost glusterfs-3.1.4]#