aptitude install glusterfs-server
volume posix type storage/posix option directory /mnt/Files end-volume volume locks type features/locks subvolumes posix end-volume volume Files type performance/io-threads option thread-count 8 subvolumes locks end-volume volume server type protocol/server option transport-type tcp option auth.login.Files.allow user # login+password option auth.login.user.password secret_pass subvolumes Files end-volume
aptitude install glusterfs-client
volume server1.com type protocol/client option transport-type tcp option username user option password secret_pass option remote-host 10.132.259.159 # server1.com option remote-subvolume Files end-volume volume server2.com type protocol/client option transport-type tcp option username user option password secret_pass option remote-host 10.184.179.175 # server2.com option remote-subvolume Files end-volume volume replicate type cluster/replicate subvolumes server1.com server2.com end-volume volume writebehind type performance/write-behind option cache-size 1MB subvolumes replicate end-volume volume cache type performance/io-cache option cache-size 512MB subvolumes writebehind end-volume
modprobe fuse
/usr/sbin/glusterfs -f /etc/glusterfs/glusterfs.vol /mnt/Files df -h /etc/glusterfs/glusterfs.vol 199G 120G 70G 64% /mnt/Files
fuse
update-initramfs -u -k `uname -r`
/etc/glusterfs/glusterfs.vol /mnt/Files glusterfs defaults 0 0
root@domU-12-41-56-0F-34-81:~# time cat /mnt/Files/ubuntu-11.10-desktop-amd64+mac.iso > /dev/null real 0m28.101s user 0m0.000s sys 0m4.700s root@domU-12-41-56-0F-34-81:~# time cat /mnt/Files/ubuntu-11.10-desktop-amd64+mac.iso > /dev/null real 0m20.321s user 0m0.000s sys 0m2.030s root@domU-12-41-56-0F-34-81:~# time cat /mnt/Files/ubuntu-11.10-desktop-amd64+mac.iso > /dev/null real 0m36.444s user 0m0.000s sys 0m1.410s
stolen@stolen ~/soft/pohmelfs-server.git $ time cat /mnt/pohmel/share/GRTMPVOL_RU_20.10.08.iso >/dev/null real 1m37.150s user 0m0.010s sys 0m1.270s stolen@stolen ~/soft/pohmelfs-server.git $ time cat /mnt/pohmel/share/GRTMPVOL_RU_20.10.08.iso >/dev/null real 0m0.591s user 0m0.003s sys 0m0.257s stolen@stolen ~/soft/pohmelfs-server.git $ time cat /mnt/upload/share/GRTMPVOL_RU_20.10.08.iso >/dev/null real 1m3.719s user 0m0.003s sys 0m0.400s
root@domU-12-41-56-0F-34-81:run$ time cat /mnt/Files/ubuntu-11.10-desktop-amd64+mac.iso > /dev/null real 0m15.220s user 0m0.008s sys 0m0.423s root@domU-12-41-56-0F-34-81:run$ time cat /mnt/Files/ubuntu-11.10-desktop-amd64+mac.iso > /dev/null real 0m16.139s user 0m0.005s sys 0m0.160s root@domU-12-41-56-0F-34-81:run$ time cat /mnt/Files/ubuntu-11.10-desktop-amd64+mac.iso > /dev/null real 0m18.812s user 0m0.006s sys 0m0.177s
#!/bin/bash count=0 while [ $count -lt 700 ] do touch small_files/$count.txt openssl rand -base64 $[$count*42] > /root/small_files/$count.txt count=$[$count+1] done
root@domU-12-31-36-0F-71-81:~# time cp /root/small_files/* /mnt/Files/test_small/ real 0m28.318s user 0m0.010s sys 0m0.160s root@domU-12-31-36-0F-71-81:~# time cp /root/small_files/* /mnt/Files/test_small/ real 0m27.432s user 0m0.000s sys 0m0.170s root@domU-12-31-36-0F-71-81:~# time cp /root/small_files/* /mnt/Files/test_small/ real 0m29.397s user 0m0.010s sys 0m0.150s
root@domU-12-41-39-01-D1-71:~# time cp /root/small_files/* /mnt/Files/test_small/ real 0m15.848s user 0m0.008s sys 0m0.061s root@domU-12-41-39-01-D1-71:~# time cp /root/small_files/* /mnt/Files/test_small/ real 0m12.792s user 0m0.002s sys 0m0.070s root@domU-12-41-39-01-D1-71:~# time cp /root/small_files/* /mnt/Files/test_small/ real 0m13.417s user 0m0.006s sys 0m0.049s
root@domU-12-31-36-0F-71-81:~# time rm /mnt/Files/test_small/* real 0m5.050s user 0m0.060s sys 0m0.000s root@domU-12-31-36-0F-71-81:~# time rm /mnt/Files/test_small/* real 0m7.055s user 0m0.000s sys 0m0.060s root@domU-12-31-36-0F-71-81:~# time rm /mnt/Files/test_small/* real 0m5.300s user 0m0.040s sys 0m0.020s
root@domU-12-41-39-01-D1-71:~# time rm /mnt/Files/test_small/* real 0m4.861s user 0m0.003s sys 0m0.013s root@domU-12-41-39-01-D1-71:~# time rm /mnt/Files/test_small/* real 0m3.618s user 0m0.002s sys 0m0.007s root@domU-12-41-39-01-D1-71:~# time rm /mnt/Files/test_small/* real 0m4.297s user 0m0.003s sys 0m0.024s
Source: https://habr.com/ru/post/140031/
All Articles