[Gluster-devel] AFR replication

Gerry Reno greno at verizon.net
Sat Jul 21 13:04:13 UTC 2007


Gerry Reno wrote:
> But, in my case that would imply that only the :1 definition would be 
> in effect, yet I'm seeing :2 replication so it doesn't appear to just 
> be using the last definition.  I'm going to try putting these all on 
> one line and see what happens.
>
> Gerry
Ok, I'm using patch 341 and I tried this on two setups all on one line 
and still seeing same behavior.  I must have something wrong in my 
configs.  Please take a look at the session and configs:

==============================================
On 192.168.1.200 machine (server and client0):
==============================================
[root at grp-01-30-50 glusterfs]# find /var/brick-appl/
/var/brick-appl/
/var/brick-appl/dir1
/var/brick-appl/dir1/logs
[root at grp-01-30-50 glusterfs]# find /var/appl
/var/appl
/var/appl/dir1
/var/appl/dir1/logs
[root at grp-01-30-50 glusterfs]# touch /var/appl/file1
[root at grp-01-30-50 glusterfs]# find /var/brick-appl/
/var/brick-appl/
/var/brick-appl/file1
/var/brick-appl/dir1
/var/brick-appl/dir1/logs
[root at grp-01-30-50 glusterfs]# find /var/appl
/var/appl
/var/appl/dir1
/var/appl/dir1/logs
/var/appl/file1
[root at grp-01-30-50 glusterfs]# touch /var/appl/dir1/logs/appl.log
[root at grp-01-30-50 glusterfs]# find /var/brick-appl/
/var/brick-appl/
/var/brick-appl/file1
/var/brick-appl/dir1
/var/brick-appl/dir1/logs
/var/brick-appl/dir1/logs/appl.log
[root at grp-01-30-50 glusterfs]# find /var/appl
/var/appl
/var/appl/dir1
/var/appl/dir1/logs
/var/appl/dir1/logs/appl.log
/var/appl/file1
[root at grp-01-30-50 glusterfs]# mount | grep gluster -e gluster -e ext3
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
glusterfs on /var/appl type fuse 
(rw,nosuid,nodev,allow_other,default_permissions,max_read=1048576)
[root at grp-01-30-50 glusterfs]#
==============================================
configs:
### file: glusterfs-server.vol

### Export volume "brick" with the contents of 'option directory'.
volume brick
  type storage/posix                    # POSIX FS translator
  option directory /var/brick-appl      # Export this directory
end-volume

### Add network serving capability to above brick.
volume server
  type protocol/server
  option transport-type tcp/server      # For TCP/IP transport
  subvolumes brick
  option auth.ip.brick.allow *          # Allow access to "brick" volume
end-volume
==============================================
### file: glusterfs-client.vol

### Add client feature and attach to remote subvolume
volume client0
  type protocol/client
  option transport-type tcp/client     # for TCP/IP transport
  option remote-host 192.168.1.200     # IP address of the remote brick
  option remote-subvolume brick        # name of the remote volume
end-volume

### Add client feature and attach to remote subvolume
volume client1
  type protocol/client
  option transport-type tcp/client     # for TCP/IP transport
  option remote-host 192.168.1.201     # IP address of the remote brick
  option remote-subvolume brick        # name of the remote volume
end-volume

### Add readahead feature
#volume readahead
#  type performance/read-ahead
#  option page-size 65536     # unit in bytes
#  option page-count 16       # cache per file  = (page-count x page-size)
#  subvolumes client
#end-volume

### Add IO-Cache feature
#volume iocache
#  type performance/io-cache
#  option page-size 128KB
#  option page-count 128
#  subvolumes readahead
#end-volume

### Add writeback feature
#volume writeback
#  type performance/write-behind
#  option aggregate-size 131072 # unit in bytes
#  subvolumes iocache  
#end-volume

   ### Add automatic file replication (AFR) feature
volume afr
  type  cluster/afr
  subvolumes  client0 client1
  option  replicate /var/appl/dir1/logs/*:1,/var/appl/*:2
  option debug on
end-volume
==============================================




==============================================
On 192.168.1.201 machine (server and client1):
==============================================
[root at grp-01-30-51 glusterfs]# find /var/brick-appl/
/var/brick-appl/
/var/brick-appl/dir1
/var/brick-appl/dir1/logs
[root at grp-01-30-51 glusterfs]# find /var/appl
/var/appl
/var/appl/dir1
/var/appl/dir1/logs
[root at grp-01-30-51 glusterfs]# # after file1 touch on 192.168.1.200 client
[root at grp-01-30-51 glusterfs]# find /var/brick-appl/
/var/brick-appl/                                            
<---------------------------------------------- ??????????? nothing 
replicated to this brick
/var/brick-appl/dir1
/var/brick-appl/dir1/logs
[root at grp-01-30-51 glusterfs]# find /var/appl
/var/appl
/var/appl/dir1
/var/appl/dir1/logs
/var/appl/file1                                                 
<------------------------------------------------------------------------
[root at grp-01-30-51 glusterfs]# # after dir1/logs/appl.log touch on 
192.168.1.200 client
[root at grp-01-30-51 glusterfs]# find /var/brick-appl/
/var/brick-appl/
/var/brick-appl/dir1
/var/brick-appl/dir1/logs
[root at grp-01-30-51 glusterfs]# find /var/appl
/var/appl
/var/appl/dir1
/var/appl/dir1/logs
/var/appl/dir1/logs/appl.log                              
<--------------------------------------------- ?????????? replicated, 
but should not have
/var/appl/file1
[root at grp-01-30-51 glusterfs]# mount | grep -e gluster -e ext3
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
glusterfs on /var/appl type fuse 
(rw,nosuid,nodev,allow_other,default_permissions,max_read=1048576)
[root at grp-01-30-51 glusterfs]#
==============================================
configs:
### file: glusterfs-server.vol

### Export volume "brick" with the contents of 'option directory'.
volume brick
  type storage/posix                    # POSIX FS translator
  option directory /var/brick-appl      # Export this directory
end-volume

### Add network serving capability to above brick.
volume server
  type protocol/server
  option transport-type tcp/server      # For TCP/IP transport
  subvolumes brick
  option auth.ip.brick.allow *          # Allow access to "brick" volume
end-volume
==============================================
glusterfs-client.vol:
### file: glusterfs-client.vol

### Add client feature and attach to remote subvolume
volume client0
  type protocol/client
  option transport-type tcp/client     # for TCP/IP transport
  option remote-host 192.168.1.200     # IP address of the remote brick
  option remote-subvolume brick        # name of the remote volume
end-volume

### Add client feature and attach to remote subvolume
volume client1
  type protocol/client
  option transport-type tcp/client     # for TCP/IP transport
  option remote-host 192.168.1.201     # IP address of the remote brick
  option remote-subvolume brick        # name of the remote volume
end-volume

### Add readahead feature
#volume readahead
#  type performance/read-ahead
#  option page-size 65536     # unit in bytes
#  option page-count 16       # cache per file  = (page-count x page-size)
#  subvolumes client
#end-volume

### Add IO-Cache feature
#volume iocache
#  type performance/io-cache
#  option page-size 128KB
#  option page-count 128
#  subvolumes readahead
#end-volume

### Add writeback feature
#volume writeback
#  type performance/write-behind
#  option aggregate-size 131072 # unit in bytes
#  subvolumes iocache  
#end-volume

   ### Add automatic file replication (AFR) feature
volume afr
  type  cluster/afr
  subvolumes  client0 client1
  option  replicate /var/appl/dir1/logs/*:1,/var/appl/*:2
  option debug on
end-volume
==============================================

start script:  (both machines)
glusterfsd --pidfile /usr/local/var/run/glusterfsd0.pid --spec-file 
/usr/local/etc/glusterfs/glusterfs-server.vol
glusterfs -l /var/log/glusterfs.log --spec-file 
/usr/local/etc/glusterfs/glusterfs-client.vol /var/appl/







More information about the Gluster-devel mailing list