[Gluster-devel] How can I add new node to DHT?

Kirby Zhou kirbyzhou at sohu-rd.com
Sun Mar 15 04:57:41 UTC 2009


2.0.0rc4

>From wiki

Now the question is what about adding a new server? 

Currently hash works based on directory level distribution. Ie, a given
file's parent directory will have information of how the hash numbers are
mapped to subvolumes. So, adding new node doesn't disturb any current setup
as the files/dirs present already have its information preserved. Whatever
new directory gets created, will start considering new volume for scheduling
files. 

But I encounter strange problem: after adding new nodes, old files are
disappeard.
And another problem, I can not use following line to mount a volume
glusterfs  --volfile-server=10.10.123.21 --volfile-server-port=6986
--volume-name=dht0-raw /mnt 

[root at xen-727057 ~]# glusterfs  --volfile=/root/glusterfs.vol
--volume-name=dht0-raw /mnt
[root at xen-727057 ~]# cp * /mnt/
 [root at xen-727057 ~]# ll /mnt/
total 184
-rw-r--r-- 1 root root    78 Mar 15 12:48 112.log
-rw------- 1 root root  1434 Mar 15 12:48 anaconda-ks.cfg
-rwxr-xr-x 1 root root  9506 Mar 15 12:48 a.out
-rw-r--r-- 1 root root  5350 Mar 15 12:48 decode.c
-rw-r--r-- 1 root root  2097 Mar 15 12:48 glusterfs.vol
-rw-r--r-- 1 root root 34517 Mar 15 12:48 install.log
-rw-r--r-- 1 root root  3670 Mar 15 12:48 install.log.syslog
-rw-r--r-- 1 root root  1930 Mar 15 12:48 install.sh
-rw-r--r-- 1 root root 17953 Mar 15 12:48 linux.tgz
-rw-r--r-- 1 root root 29224 Mar 15 12:48 log
-rwxr-xr-x 1 root root  2805 Mar 15 12:48 mksimplerpm.sh
-rwxr-xr-x 1 root root  9955 Mar 15 12:48 nbody
-rw-r--r-- 1 root root  4783 Mar 15 12:48 nbody.cpp
-rwxr-xr-x 1 root root 13119 Mar 15 12:48 redux
-rw-r--r-- 1 root root  7104 Mar 15 12:48 redux.cpp
-rw-r--r-- 1 root root  1517 Mar 15 12:48 teste.cpp
-rw-r--r-- 1 root root   124 Mar 15 12:48 uname.list
[root at xen-727057 ~]# umount /mnt

[root at xen-727057 ~]# vim glusterfs.vol ## I add some extra volumns here.
# goto every node, restart glusterfsd

[root at xen-727057 ~]# glusterfs  --volfile=/root/glusterfs.vol
--volume-name=dht0-raw /mnt
[root at xen-727057 ~]# ll /mnt/
total 48
-rw-r--r-- 1 root root  5350 Mar 15 12:48 decode.c
-rw-r--r-- 1 root root 29224 Mar 15 12:48 log
-rw-r--r-- 1 root root  7104 Mar 15 12:48 redux.cpp
[root at xen-727057 ~]# mkdir /mnt/XXX
[root at xen-727057 ~]# ll /mnt/XXX/
total 0
[root at xen-727057 ~]# ll /mnt/
total 48
-rw-r--r-- 1 root root  5350 Mar 15 12:48 decode.c
-rw-r--r-- 1 root root 29224 Mar 15 12:48 log
-rw-r--r-- 1 root root  7104 Mar 15 12:48 redux.cpp
drwxr-xr-x 2 root root    48 Mar 15 12:48 XXX
[root at xen-727057 ~]#


====Server volumes:
volume brick1-posix
  type storage/posix                   # POSIX FS translator
  option directory /exports/disk1      # Export this directory
end-volume
volume brick1-locks
  type features/locks
  subvolumes brick1-posix
end-volume
volume brick1
  type performance/io-threads
  subvolumes brick1-locks
  option thread-count 16
  option cache-size 256m
end-volume

volume brick2-posix
  type storage/posix                   # POSIX FS translator
  option directory /exports/disk2      # Export this directory
end-volume
volume brick2-locks
  type features/locks
  subvolumes brick2-posix
end-volume
volume brick2
  type performance/io-threads
  subvolumes brick2-locks
  option thread-count 16
  option cache-size 256m
end-volume

#volume brick-ns
#  type storage/posix                   # POSIX FS translator
#  option directory /exports/ns         # 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
  option listen-port 6986              # Default is 6996
  option client-volume-filename /etc/glusterfs/glusterfs.vol
  subvolumes brick1 brick2 
  option auth.ip.brick1.allow 10.10.*,10.11.*,10.15.*,192.168.*
  option auth.ip.brick2.allow 10.10.*,10.11.*,10.15.*,192.168.*
  option auth.ip.brick-ns.allow 10.10.*,10.11.*,10.15.*,192.168.*
end-volume


====Client volume:
volume 10.10.123.21-brick1
  type protocol/client
  option transport-type tcp/client
  option remote-host 10.10.123.21
  option remote-port 6986
  option transport-timeout 3
  option remote-subvolume brick1
end-volume
volume 10.10.123.21-brick2
  type protocol/client
  option transport-type tcp/client
  option remote-host 10.10.123.21
  option remote-port 6986
  option transport-timeout 3
  option remote-subvolume brick2
end-volume

...

volume dht0-raw
  type cluster/distribute
  #subvolumes 10.10.123.21-brick1 10.10.123.21-brick2 10.10.123.22-brick1
10.10.123.22-brick2
  subvolumes 10.10.123.21-brick1 10.10.123.21-brick2 10.10.123.22-brick1
10.10.123.22-brick2 10.10.123.31-brick1 10.10.123.31-brick2
10.10.123.32-brick1 10.10.123.32-brick2
  option lookup-unhashed yes
end-volume








More information about the Gluster-devel mailing list