You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Alvaro Cabrerizo <to...@gmail.com> on 2006/09/26 12:04:55 UTC

stop an index server

How could I stop an index server (started with "bin/nutch server <port>
<index>") knowing the port?

Thanks in advance.

Re: stop an index server

Posted by Alvaro Cabrerizo <to...@gmail.com>.
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 <wi...@gmail.com>:
>
> 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 <to...@gmail.com> wrote:
> >
> > How could I stop an index server (started with "bin/nutch server <port>
> > <index>") knowing the port?
> >
> > Thanks in advance.
> >
> >
>
>

Re: stop an index server

Posted by Jim Wilson <wi...@gmail.com>.
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 <to...@gmail.com> wrote:
>
> How could I stop an index server (started with "bin/nutch server <port>
> <index>") knowing the port?
>
> Thanks in advance.
>
>

Re: stop an index server

Posted by Sami Siren <ss...@gmail.com>.
It seems that this was not reaching nutch-user so here's it again in 
case someone else is also interested.

---

hello,

here's an adhoc addition to search server to support shutdown command.

client calls server like this:

"bin/nutch 'org.apache.nutch.searcher.DistributedSearch$Client'
-shutdown 127.0.0.1 9999"

--
   Sami Siren

Alvaro Cabrerizo wrote:
> 
> 
> 2006/9/27, Sami Siren <ssiren@gmail.com <ma...@gmail.com>>:
> 
>     Alvaro Cabrerizo wrote:
>      > How could I stop an index server (started with "bin/nutch server
>     <port>
>      > <index>") knowing the port?
>      >
>      > Thanks in advance.
>      >
> 
>     It does not support such a feature. Can you describe a little bit more
>     what are you trying to accomplish something similar to tomcats SHUTDOWN?
> 
> 
> Sure,
> That's right. If this feature doesn't exist, I'm looking for a clue to 
> develop a SHUTDOWN and a RESTART command,  using NUTCH/HADOOP api. The 
> idea is to have a group of JAVA classes that lets people execute a 
> command like: "SERVER_RESTART <port>" or more advanced "SERVER_RESTART 
> <port> <ip_address>".
> 
> Anyway 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.
> 
> 
> Thanks, in advance.
>  
> 
>     --
>       Sami Siren
> 
> 



Re: stop an index server

Posted by Alvaro Cabrerizo <to...@gmail.com>.
Hi:

It works fine. Thanks again.

2006/9/28, Sami Siren <ss...@gmail.com>:
>
> hello,
>
> here's an adhoc addition to search server to support shutdown command.
>
> client calls server like this:
>
> "bin/nutch 'org.apache.nutch.searcher.DistributedSearch$Client'
> -shutdown 127.0.0.1 9999"
>
> --
>   Sami Siren
>
> Alvaro Cabrerizo wrote:
> >
> >
> > 2006/9/27, Sami Siren <ssiren@gmail.com <ma...@gmail.com>>:
> >
> >     Alvaro Cabrerizo wrote:
> >      > How could I stop an index server (started with "bin/nutch server
> >     <port>
> >      > <index>") knowing the port?
> >      >
> >      > Thanks in advance.
> >      >
> >
> >     It does not support such a feature. Can you describe a little bit
> more
> >     what are you trying to accomplish something similar to tomcats
> SHUTDOWN?
> >
> >
> > Sure,
> > That's right. If this feature doesn't exist, I'm looking for a clue to
> > develop a SHUTDOWN and a RESTART command,  using NUTCH/HADOOP api. The
> > idea is to have a group of JAVA classes that lets people execute a
> > command like: "SERVER_RESTART <port>" or more advanced "SERVER_RESTART
> > <port> <ip_address>".
> >
> > Anyway 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.
> >
> >
> > Thanks, in advance.
> >
> >
> >     --
> >       Sami Siren
> >
> >
>
>
>
>

Re: stop an index server

Posted by Alvaro Cabrerizo <to...@gmail.com>.
2006/9/27, Sami Siren <ss...@gmail.com>:
>
> Alvaro Cabrerizo wrote:
> > How could I stop an index server (started with "bin/nutch server <port>
> > <index>") knowing the port?
> >
> > Thanks in advance.
> >
>
> It does not support such a feature. Can you describe a little bit more
> what are you trying to accomplish something similar to tomcats SHUTDOWN?


Sure,
That's right. If this feature doesn't exist, I'm looking for a clue to
develop a SHUTDOWN and a RESTART command,  using NUTCH/HADOOP api. The idea
is to have a group of JAVA classes that lets people execute a command like:
"SERVER_RESTART <port>" or more advanced "SERVER_RESTART <port>
<ip_address>".

Anyway 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.


Thanks, in advance.


--
>   Sami Siren
>
>

Re: stop an index server

Posted by Sami Siren <ss...@gmail.com>.
Alvaro Cabrerizo wrote:
> How could I stop an index server (started with "bin/nutch server <port>
> <index>") knowing the port?
> 
> Thanks in advance.
> 

It does not support such a feature. Can you describe a little bit more 
what are you trying to accomplish something similar to tomcats SHUTDOWN?

--
  Sami Siren