next up previous contents index
Next: 7.5 Troubleshooting Up: 7 The Replicator Previous: 7.3 Customizations

7.4 Distributing the load among replicas

Once you have a set of replicas set up, you need to arrange to have queries routed among them. In Harvest Version 1.0 we allowed users to select a query from the Broker's query.html page. Starting with Harvest Version 1.1 we made the load sharing automatic and transparent to the user, by interposing a process that redirects queries to one of the replica set, chosen at random. This process runs as a CGI program called Query.cgi, which is created by the CreateBroker command (which is run by the RunHarvest command). The Query.cgi program lives in the same directory as query.html, and redirects users to one of the query.html's for that Broker.

By default, Query.cgi is never used, and query.html is used as the Broker's Home Page. If you run a replicated Broker, you need to do the following:

  1. Modify the configuration file so your httpd treats all .cgi files (rather than just those in the cgi-bin directory) as CGI programs (if your httpd doesn't support this, then include the Broker directory as one of the valid CGI script directories). For example, in NCSA httpd, you need to add this line to your srm.conf:

            AddType application/x-httpd-cgi .cgi

  2. Change the Broker-Home-Page in broker.conf to point to Query.cgi instead of query.html. Then, advertise this URL as the Broker's point of entry.

As replica Brokers are added, you need to edit Query.cgi to include the new query.html URLs. For the URL ``http://whatever/Harvest/brokers/foo/Query.cgi'' people can see the full list of replicas using the URL ``http://whatever/Harvest/brokers/foo/Query.cgi?list''.


Duane Wessels
Wed Jan 31 23:46:21 PST 1996