I am playing with GlusterFS. And now I am curious how to fully rebuild replicated volume.
So I`ve created 1 replicated volume from server1 and server2 nodes:
root@server1:~# gluster volume create replicated replica 2 transport tcp server1:/mnt/repl1 server2:/mnt/repl2 force
root@server1:~# gluster volume start replicated
volume start: replicated: success
And mounted it to client node:
root@client:~# mount.glusterfs server1:/distributed /mnt/distrib/
Now I am trying to test high-availability. So I`ve turned off server1 and trying to write smth to client mount-point:
root@client:/mnt/replica# ls -lh
total 106M
-rw-r--r-- 1 root root 19 Jul 12 2015 1.txt
-rw-r--r-- 1 root root 1.3K Jul 12 2015 2.txt
-rw-r--r-- 1 root root 106M Jul 12 2015 testfile1
So ok so far. All files are also on server2:
root@server2:/mnt/repl2# ls -lh
total 106M
-rw-r--r-- 2 root root 19 Jul 12 03:52 1.txt
-rw-r--r-- 2 root root 1.3K Jul 12 03:54 2.txt
-rw-r--r-- 2 root root 106M Jul 12 03:53 testfile1
root@server2:/mnt/repl2#
After all my server1 goes online and there I can see only skeleton of files w/o data in it:
root@server1:/mnt/repl1# ls -lh
total 4.0K
-rw-r--r-- 2 root root 0 Jul 12 12:21 1.txt
-rw-r--r-- 2 root root 0 Jul 12 03:54 2.txt
-rw-r--r-- 2 root root 0 Jul 12 12:21 testfile1
Only after accessing to files from client mount-point (with cat or like this) info is pulling into server2 files:
root@client:/mnt/replica# cat 2.txt
GlusterFS — blalabla..
root@server1:/mnt/repl1# ls -lh
total 4.0K
-rw-r--r-- 2 root root 0 Jul 12 12:21 1.txt
-rw-r--r-- 2 root root 1.3K Jul 12 03:54 2.txt
-rw-r--r-- 2 root root 0 Jul 12 12:21 testfile1
root@server1:/mnt/repl1#
Is it possible to rebuild all files automatically on previously failed server w/o accessing to them from client mount point?