[chord] question about chord

侯婕 houhou1983 at 163.com
Fri Mar 26 12:01:28 EDT 2010


Hi all,

 I have some problems when I use the chord. 
 1)could I fetch a file by its file name? I'm attaching the log of actual commands and their output below.

// start DHT on host1
[host1]# /home/hj/dht/dht-eb22cc3d96e0/dht-eb22cc3d96e0/lsd/start-dhash --root /home/hj/build/chord/dhash-a -j 202.197.6.228:10000 -p 10000 &
[1] 16307
RUNNING: /home/hj/build/chord/lsd/adbd adbd -d ./db -S ./adbd-sock -q 0
RUNNING: /home/hj/build/chord/maint/maintd maintd -d ./maintdata -m passingtone -C ./maint-sock
RUNNING: /home/hj/build/chord/lsd/lsd lsd -d ./adbd-sock -S ./dhash-sock -R ./maint-sock -C
./lsd-sock -j 202.197.6.228:10000 -p 10000

// insert file new.c on host1

[host1]# tools/filestore /home/hj/build/chord/dhash-a/dhash-sock -s /home/whl/doc/new.c 1
len 351 inflight 0
len 20
p
len 280
923833ed20b09b7583ebbc25999602374dda00f3

// join the DHT from host2
[host2]# /home/hj/dht/dht-eb22cc3d96e0/dht-eb22cc3d96e0/lsd/start-dhash --root /home/hj/build/chord/dhash-a -j 202.197.6.228:10000 &
[1] 15362
RUNNING: /home/hj/build/chord/lsd/adbd adbd -d ./db -S ./adbd-sock -q 0
RUNNING: /home/hj/build/chord/maint/maintd maintd -d ./maintdata -m passingtone
-C ./maint-sock
RUNNING: /home/hj/build/chord/lsd/lsd lsd -d ./adbd-sock -S ./dhash-sock -R ./maint-sock -C ./lsd-sock -j 202.197.6.228:10000

// retrieve file new.c on host2
[host2]# tools/filestore /home/hj/build/chord/dhash-a/dhash-sock -f 923833ed20b09b7583ebbc25999602374dda00f3 1
retrieve 923833ed20b09b7583ebbc25999602374dda00f3
retrieve eb9a1cd9780247758d8447b4086d39631dc8a95a
retrieve a667258c6485726eee5ac5303080284f6808a78f

// succeed!

However, the input "923833ed20b09b7583ebbc25999602374dda00f3" is so long and unfriendly. 
Can I use the readable file name instead of the long string?


Another question:
Recently, I have a task. The goal is to use DHT to store millions mappings, i.e. host name ~ ip address. 
So I want to get the corresponding ip address when I input the host name. If the the file fetching process can't use the file name,
is it prossible to modify the hash function omitting the len part? Then, I can beforehand use the host name to compute the id and then use the id 
to retrieve the corresponding ip address from the DHT.


I do not know how to solve these problems, please help me. Thanks.


Jie Hou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://amsterdam.lcs.mit.edu/pipermail/chord/attachments/20100327/10e73604/attachment.htm 


More information about the chord mailing list