ZHT is back and updated, enjoy!
-------------------ABOUT ZHT------------------- ZHT is a zero-hop distributed hash table(see also the paper, http://datasys.cs.iit.edu/projects/ZHT/ZHT-CRC-PID2666213-Final.pdf).
-------------------SOFTWARE REQUIREMENTS------------------- Google protocol buffers c binding, VERSION 0.15 or later. 0.15 version is included. Please find it in src/protobuf-c-0.15.tar.gz. http://code.google.com/p/protobuf-c/downloads/list
Google protocol buffers c++ binding, VERSION 2.4.1 is supported and included. Please find it in src/protobuf-2.4.1.tar.gz. Note: later version may not work!!!
-------------------ABOUT ZHT API, SPECIAL ATTENTION------------------- ZHT supports the API set such as insert/lookup/remove/append/compare_swap.
When you are using append, BE CAREFUL THAT your key and value CAN NOT contain the colon(:), which is used internally to delimite key/value pairs.
-------------------COMPILE AND INSTALL------------------- FIRSTLY install Google protocol buffers c++ binding, AND THEN install Google protocol buffers c binding since the latter dependes on the former.
Assuming that you installed them to default directory, possibly that is, /usr/local
ORTHERWISE, assuming that you will install them to /home/xiaobingo/install, follow THE ORDER:
If you installed Google protocol buffers c and c++ bindings to customized directory, e.g./home/xiaobingo/install, MAKE SURE TO EXPORT them,
, otherwise, you probably fail to compile ZHT or locate dependencies required by ZHT runtime.
-------------------RUN THE BENCHMARK------------------- To run benchmark:
./zhtserver -z zht.conf -n neighbor.conf, OR ./zhtserver -z zht.conf -n neighbor.conf -p 40000, to specify your own port that overrides PORT in zht.conf, OR ./zhtserver -z zht.conf -n neighbor.conf -p 40000 -f novoht.db, to specify your own disk file to which data is persisted.
./zht_ben -z zht.conf -n neighbor.conf -o 1000
NOTE that: The port you specified to listen on at zhtserver(e.g. the PORT in zht.conf, or ./zhtserver -z zht.conf -n neighbor.conf -p 40000) MUST BE CONSISTENT WITH the port of that machine in neighbor.conf, otherwise, the zhtclient CANNOT reach the zhtserver by that port.
In ./zhtserver -z zht.conf -n neighbor.conf -p 40000 or ./zhtserver -z zht.conf -n neighbor.conf -p 40000 -f novoht.db zht.conf: is to configure PROTOCOL and PORT, and other parameters, neighbor.conf: is to configure neighbored nodes(or ZHT servers) in ZHT overlay network, 40000: means zhtserver port to listen on, which overrides PORT in zht.conf, if missing, that PORT in zht.conf will be used. novoht.db: is the disk file to which the data are persisted, if missing, the data reside in memory. Please specify different files if you are going to run multiple zhtservers in the same node.
In ./zht_ben -z zht.conf -n neighbor.conf -o 1000 zht.conf is to configure PROTOCOL and PORT, and other parameters, neighbor.conf is to configure neighbored nodes(or ZHT servers) in ZHT overlay network, 1000 means running 1000 sequential iterations of INSERT, LOOKUP, REMOVE and APPEND.
NOTE that: The parameter ID and VALUE(e.g. PROTOCOL TCP) for both zht.conf and neighbor.conf is SPACE delimited. The conf files support #-style comment-out. The blank lines will be ignored as comment-outs while parsing the conf files.
-------------------RUN TEST CASES FOR C++ BINDING------------------- To run test cases for zht c++ binding:
-------------------RUN TEST CASES FOR C BINDING------------------- To run test cases for zht c binding:
-------------------ZHT STANDALONE DEPLOYMENT------------------- To deploy ZHT on a single node and run your own ZHT application:
NOTE that your_zht_app is your binary that invokes ZHT client to INSERT/LOOKUP/REMOVE/APPEND key/value pairs.
-------------------ZHT CLUSTER DEPLOYMENT------------------- To deploye ZHT on a cluster of nodes and run your own ZHT application:
-------------------DEVELOPE YOUR ZHT APPLICATIONS------------------- To develope your own ZHT applications, please refer to <c_zhtclient_test.c>, which extensively tests ZHT client c binding, internally invoking c++ binding. OR see also <cpp_zhtclient_test.cpp> on how to use ZHT API in c++ programs.
To compile your own ZHT applications, link to <libzht.a> and include cpp_zhtclient.h and c_zhtclient.h for C++ and C programs, respectively.
See also doc/[email protected] for tutorial on how to built ZHT applications step by step.
-------------------HOW TO COMPILE ZHT TO USE MPI PROTOCOL-------------------
-------------------ZHT(USING MPI) STANDALONE DEPLOYMENT-------------------
TO START zht-mpiserver and zht-mpibroker(e.g. ON SINGLE NODE), RUN: mpiexec -np 4 ./zht-mpiserver -z zht.conf -n neighbor.mpi.conf : ./zht-mpibroker -z zht.conf -n neighbor.mpi.conf
TO RUN THE BENCHMARK: see also <RUN THE BENCHMARK> section.
TO RUN TEST CASES FOR C++ BINDING: see also <RUN TEST CASES FOR C++ BINDING> section
TO RUN TEST CASES FOR C BINDING: see also <RUN TEST CASES FOR C BINDING> section
NOTE THAT:
mpiexec: mpi command to launch mpi jobs.
-np 4 ./zht-mpiserver: allocate 4 processors to run 4 zht-mpiserver processes.
-z zht.conf: zht conf file as input argument to zht-mpiserver or zht-mpibroker, the same file mentioned above.
-n neighbor.mpi.conf: negibor conf file as input argument to zht-mpiserver or zht-mpibroker, containing localhost in this case.
zht-mpibroker: the process launched on each node to talk to zht-mpiserver on behalf of zhtclient.
PAY SPECIAL ATTENTIONS: There is ONLY ONE INSTANCE of zht-mpibroker allowed to be deployed ON EVERY NODE.
zht-mpibroker MUST appear after zht-mpiserver IN ORDER in order to ensure the processes of zht-mpiserver are assigned to proper mpi-ranks that serve processing incoming requests from zhtclients.
-------------------ZHT(USING MPI) CLUSTER DEPLOYMENT-------------------
TO START zht-mpiserver and zht-mpibroker(e.g. ON MANY NODEs), RUN: mpiexec -f neighbor.mpi.conf -np <#processes> ./zht-mpiserver -z zht.conf -n neighbor.mpi.conf : ./zht-mpibroker -z zht.conf -n neighbor.mpi.conf OR mpiexec -hosts 192.168.1.100,192.168.1.101 -np <#processes> ./zht-mpiserver -z zht.conf -n neighbor.mpi.conf : ./zht-mpibroker -z zht.conf -n neighbor.mpi.conf
TO RUN THE BENCHMARK: see also <RUN THE BENCHMARK> section.
TO RUN TEST CASES FOR C++ BINDING: see also <RUN TEST CASES FOR C++ BINDING> section
TO RUN TEST CASES FOR C BINDING: see also <RUN TEST CASES FOR C BINDING> section
NOTE THAT:
mpiexec: mpi command to launch mpi jobs.
-f neighbor.mpi.conf: negibor conf file containing nodes on which MPI processes run, in which each line is ip address(e.g. 192.168.1.100), DO NOT USE localhost.
-hosts 192.168.1.100,192.168.1.101: two nodes(comma separated ip addresses) on which MPI processes run.
-np <#processes> ./zht-mpiserver: allocate <#processes> processors to run <#processes> zht-mpiserver processes.
-z zht.conf: zht conf file as input argument to zht-mpiserver or zht-mpibroker, the same file mentioned above.
-n neighbor.mpi.conf: negibor conf file as input argument to zht-mpiserver or zht-mpibroker, in which each line is ip address(e.g. 192.168.1.100), DO NOT USE localhost.
zht-mpibroker: the process launched on each node to talk to zht-mpiserver on behalf of zhtclient.
PAY SPECIAL ATTENTIONS: There is ONLY ONE INSTANCE of zht-mpibroker allowed to be deployed ON EVERY NODE.
zht-mpibroker MUST appear after zht-mpiserver IN ORDER in order to ensure the processes of zht-mpiserver are assigned to proper mpi-ranks which serve processing incoming requests from zhtclients.
-------------------HOW TO CONFIGURE------------------- There are two conf files needed, one is zht.conf, the other is neighbor.conf or neighbor.mpi.conf.
zht.conf: PROTOCOL and PORT are the options to configure what protocols and ports(if applicable) over which zhtclient and zhtserver talk to each other.
If you specified your own port by -p option(e.g. ./zhtserver -z zht.conf -n neighbor.conf -p 40000), this will override PORT defined in zht.conf.
If you specified the disk file by -f option(e.g. -f novoht.db), the data will be persisted to that file, otherwise, they reside in memory. Please specify different files if you are going to run multiple zhtservers in the same node.
neighbor.conf: This file is used for TCP/UDP protocol.
The IP and PORT pairs of neighbored nodes(or ZHT servers) in ZHT overlay network are configured, e.g. 192.168.1.100 50000, 192.168.1.100 50001
The port you defined to listen on at neighbored node(or ZHT server)(e.g. the PORT in zht.conf, or ./zhtserver -z zht.conf -n neighbor.conf -p 40000) MUST BE CONSISTENT WITH the port of that machine in neighbor.conf, otherwise, the zhtclient CANNOT reach the zhtserver by that port.
neighbor.mpi.conf: This file is used for MPI protocol.
The IP(s) of neighbored nodes(or ZHT servers) in ZHT overlay network are configured, e.g. 192.168.1.100, no port is necessary for MPI protocol.
NOTE that: The parameter ID and VALUE(e.g. PROTOCOL TCP) for both zht.conf and neighbor.conf is SPACE delimited. The conf files support #-style comment-out. The blank lines will be ignored as comment-outs while parsing.