Mixing Unify and Automatic File Replication
From GlusterDocumentation
[edit]
Server volfile
# file: /etc/glusterfs/glusterfs-server.vol volume brick type storage/posix option directory /data/export end-volume volume brick-ns type storage/posix option directory /data/export-ns end-volume volume posix-mirror type storage/posix option directory /data/export-mirror end-volume volume brick-mirror type features/locks subvolumes posix-mirror end-volume volume server type protocol/server option transport-type tcp option auth.addr.brick.allow * option auth.addr.brick-mirror.allow * option auth.addr.brick-ns.allow * subvolumes brick brick-mirror brick-ns end-volume
[edit]
Client volfile
# file: /etc/glusterfs/glusterfs-client.vol volume remote1 type protocol/client option transport-type tcp option remote-host storage1.example.com option remote-subvolume brick end-volume volume remote2 type protocol/client option transport-type tcp option remote-host storage2.example.com option remote-subvolume brick end-volume volume remote1-mirror type protocol/client option transport-type tcp option remote-host storage1.example.com option remote-subvolume brick-mirror end-volume volume remote2-mirror type protocol/client option transport-type tcp option remote-host storage2.example.com option remote-subvolume brick-mirror end-volume volume afr0 type cluster/afr subvolumes remote1-mirror remote2-mirror end-volume volume remote-ns type protocol/client option transport-type tcp option remote-host storage1.example.com option remote-subvolume brick-ns end-volume volume unify type cluster/unify option scheduler switch option switch.case *.jpg:afr0;*:remote1,remote2 # 2 copies of all .jpg files only option namespace remote-ns subvolumes remote1 remote2 afr0 end-volume


