Ok,
I'll try to explain it in a more clear way.
Imagine that you have finished crawling a group of sites and you have a well
formed index. Then you configure tomcat, create a nutch-site.xml, add the
property searcher.dir pointing to a search-servers.txt that contains this
line: "127.0.0.1 44444". Then you start tomcat, and an index server using
the command "nutch_home/bin/nutch server 44444 myIndexDir". Now you can get
the results of that server via tomcat, in a distributed way.
At this point I would like to know how to stop the server running on 44444
port. I can execute "ps aux | grep 44444" in a shell and find out proccess
number in order to kill it or I can make a "^C" to stop it, but this is not
the solution I'm looking for.
I've tried this piece of code (based on
org.apache.nutch.search.DistributedSearch):
Configuration conf = NutchConfiguration.create();
InetSocketAddress[] a_InetSocketAddress = new InetSocketAddress[1];
a_InetSocketAddress[0] = new InetSocketAddress("localhost", 44444);
Object[][] params = new Object[1][0];
Method get_method = org.apache.hadoop.ipc.Server.class.getMethod("get", new
Class[] {});
org.apache.hadoop.ipc.Server[] servers =
(org.apache.hadoop.ipc.Server[])RPC.call(get_method,
params,
a_InetSocketAddress ,conf);
servers[0].stop();
Executing this code gives me a nullPointer exception because the RPC.call,
returns an array of nulls. If I understand it, when we execute
"nutch_home/bin/nutch server 44444 myIndexDir", we are enveloping a
NutchBean in a RPC layer (), tha let us to access to the methods of
NutchBean via RPC.calls, but not to org.apache.hadoop.ipc.Server methods.
Summarizing, the question is how to get the instance of that server (the
org.apache.hadoop.ipc.Server running on 44444 port) to make an STOP.
Once I can make an stop, i can update the index and restart it.
Thanks for your answer.
2006/9/26, Jim Wilson <[EMAIL PROTECTED]>:
Do you mean what "crawl-urlfilter.txt" line you'd need? I think the
following would do it:
-^http://server:port/
But I'm not convinced that this is what you were asking ...
-- Jim
On 9/26/06, Alvaro Cabrerizo <[EMAIL PROTECTED]> wrote:
>
> How could I stop an index server (started with "bin/nutch server <port>
> <index>") knowing the port?
>
> Thanks in advance.
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nutch-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-general