Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 03663abacfb5829946c324cb3e985338 > files > 234

groonga-doc-1.2.7-1.fc14.x86_64.rpm




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>4.2. How to use groonga with network &mdash; groonga v1.2.6 documentation</title>
    
    <link rel="stylesheet" href="../_static/groonga.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.2.6',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="groonga v1.2.6 documentation" href="../index.html" />
    <link rel="up" title="4. チュートリアル" href="../tutorial.html" />
    <link rel="next" title="4.3. さまざまな種類をもったデータの保存" href="data.html" />
    <link rel="prev" title="4.1. 基本的な操作" href="introduction.html" /> 
  </head>
  <body>
<div class="header">
  <h1 class="title">
    <a id="top-link" href="../index.html">
      <span class="project">groonga</span>
      <span class="separator">-</span>
      <span class="description">An open-source fulltext search engine and column store.</span>
    </a>
  </h1>

  <div class="other-language-links">
    <ul>
      <li><a href="../../../ja/html/tutorial/network.html"><img src="../_static/jp.png" alt="日本語"></a></li>
    </ul>
  </div>
</div>
  

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="data.html" title="4.3. さまざまな種類をもったデータの保存"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="introduction.html" title="4.1. 基本的な操作"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">groonga v1.2.6 documentation</a> &raquo;</li>
          <li><a href="../tutorial.html" accesskey="U">4. チュートリアル</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="how-to-use-groonga-with-network">
<h1>4.2. How to use groonga with network<a class="headerlink" href="#how-to-use-groonga-with-network" title="Permalink to this headline">¶</a></h1>
<p>You can use groonga with network. When you run groonga by using the groonga original protocol or HTTP, groonga accepts connection for network.</p>
<div class="section" id="connect-with-groonga-s-original-protocol">
<h2>4.2.1. Connect with groonga's original protocol<a class="headerlink" href="#connect-with-groonga-s-original-protocol" title="Permalink to this headline">¶</a></h2>
<div class="section" id="run-groonga-daemon">
<h3>4.2.1.1. Run groonga daemon<a class="headerlink" href="#run-groonga-daemon" title="Permalink to this headline">¶</a></h3>
<p>Form:</p>
<div class="highlight-none"><div class="highlight"><pre>groonga [-p PORT_NUMBER] -d DB_PATH_NAME
</pre></div>
</div>
<p>The DB_PATH_NAME is set the full-path of existing database.
With this form, you can run groonga as a daemon and connect by
with groonga original protocol on PORT_NUMBER.
(The port number is 10041 when you don't specify PORT_NUMBER.)</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>% groonga -d /tmp/groonga-databases/introduction.db
12345
%
</pre></div>
</div>
<p>Groonga shows its process ID on daemon mode.</p>
</div>
<div class="section" id="connect-to-groonga-server">
<h3>4.2.1.2. Connect to groonga server<a class="headerlink" href="#connect-to-groonga-server" title="Permalink to this headline">¶</a></h3>
<p>Form:</p>
<div class="highlight-none"><div class="highlight"><pre>groonga [-p PORT_NUMBER] -c [HOST_NAME_OR_IP_ADDRESS]
</pre></div>
</div>
<p>This command connects to groonga server running at specified HOST_NAME_OR_IP_ADDRESS.</p>
<p>When you don't specify HOST_NAME_OR_IP_ADDRESS, this command connects to groonga server running at localhost. When you don't specify PORT_NUMBER, 10041 is used.</p>
<p>Groonga runs in interactive mode after connect to groonga server successfully. Groonga reads command from standard input and evaluates it repeatedly.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>% groonga -c
&gt; status
[[0,1317212813.13814,0.000102148],{&quot;alloc_count&quot;:184,&quot;starttime&quot;:1317212806,&quot;uptime&quot;:7,&quot;version&quot;:&quot;1.2.5-84-g5c190df&quot;,&quot;n_queries&quot;:14,&quot;cache_hit_rate&quot;:0.0,&quot;command_version&quot;:1,&quot;default_command_version&quot;:1,&quot;max_command_version&quot;:2}]
&gt; ctrl-d
%
</pre></div>
</div>
</div>
<div class="section" id="terminate-groonga-daemon">
<h3>4.2.1.3. Terminate groonga daemon<a class="headerlink" href="#terminate-groonga-daemon" title="Permalink to this headline">¶</a></h3>
<p>You can terminate groonga daemon with shutdown command.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>% groonga -c
&gt; shutdown
%
</pre></div>
</div>
</div>
</div>
<div class="section" id="connect-with-http">
<h2>4.2.2. Connect with HTTP<a class="headerlink" href="#connect-with-http" title="Permalink to this headline">¶</a></h2>
<p>You need to run groonga in HTTP protocol mode when you want to use groonga via HTTP.</p>
<p>Form:</p>
<div class="highlight-none"><div class="highlight"><pre>groonga [-p PORT_NUMBER] -d --protocol http DB_PATH_NAME
</pre></div>
</div>
<p><cite>--protocol</cite> option specifies a protocol of groonga server. <cite>http</cite> means that groonga accepts connections via HTTP.</p>
<div class="section" id="administration-tool-based-on-html">
<h3>4.2.2.1. Administration tool based on HTML<a class="headerlink" href="#administration-tool-based-on-html" title="Permalink to this headline">¶</a></h3>
<p>You can access administration tool based on HTML at <cite>http://[HOST_NAME_OR_IP_ADDRESS]:[PORT_NUMBER]/</cite> after the above command is ran. Your browser must enables JavaScript.</p>
</div>
<div class="section" id="run-command-with-http">
<h3>4.2.2.2. Run command with HTTP<a class="headerlink" href="#run-command-with-http" title="Permalink to this headline">¶</a></h3>
<p>You can run command at <cite>/d/COMMAND_NAME</cite> when groonga is ran in HTTP protocol mode.</p>
<p>Command options are passed as HTTP's GET parameters. They are in <cite>?OPTION=VALUE&amp;OPTION=VALUE&amp;...</cite> form.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>http://[IPまたはホスト名]:[ポート番号]/d/status
実行される処理:
&gt; status
[[0,1317212813.33982,0.000109691],{&quot;alloc_count&quot;:184,&quot;starttime&quot;:1317212806,&quot;uptime&quot;:7,&quot;version&quot;:&quot;1.2.5-84-g5c190df&quot;,&quot;n_queries&quot;:14,&quot;cache_hit_rate&quot;:0.0,&quot;command_version&quot;:1,&quot;default_command_version&quot;:1,&quot;max_command_version&quot;:2}]

http://[IPまたはホスト名]:[ポート番号]/d/select?table=Site&amp;query=title:@this
実行される処理:
&gt; select --table Site --query title:@this
[[0,1317212813.54112,6.7993e-05],[[[1],[[&quot;_id&quot;,&quot;UInt32&quot;],[&quot;_key&quot;,&quot;ShortText&quot;],[&quot;title&quot;,&quot;ShortText&quot;]],[1,&quot;http://example.org/&quot;,&quot;This is test record 1!&quot;]]]]
</pre></div>
</div>
</div>
</div>
<div class="section" id="security">
<h2>4.2.3. Security<a class="headerlink" href="#security" title="Permalink to this headline">¶</a></h2>
<p>Network service of groonga doesn't support authentication. Everyone can view and modify the database. We recommend that you restrict client accesses by IP address. You can use iptables or any similar tool for it.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">4.2. How to use groonga with network</a><ul>
<li><a class="reference internal" href="#connect-with-groonga-s-original-protocol">4.2.1. Connect with groonga's original protocol</a><ul>
<li><a class="reference internal" href="#run-groonga-daemon">4.2.1.1. Run groonga daemon</a></li>
<li><a class="reference internal" href="#connect-to-groonga-server">4.2.1.2. Connect to groonga server</a></li>
<li><a class="reference internal" href="#terminate-groonga-daemon">4.2.1.3. Terminate groonga daemon</a></li>
</ul>
</li>
<li><a class="reference internal" href="#connect-with-http">4.2.2. Connect with HTTP</a><ul>
<li><a class="reference internal" href="#administration-tool-based-on-html">4.2.2.1. Administration tool based on HTML</a></li>
<li><a class="reference internal" href="#run-command-with-http">4.2.2.2. Run command with HTTP</a></li>
</ul>
</li>
<li><a class="reference internal" href="#security">4.2.3. Security</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="introduction.html"
                        title="previous chapter">4.1. 基本的な操作</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="data.html"
                        title="next chapter">4.3. さまざまな種類をもったデータの保存</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/tutorial/network.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="data.html" title="4.3. さまざまな種類をもったデータの保存"
             >next</a> |</li>
        <li class="right" >
          <a href="introduction.html" title="4.1. 基本的な操作"
             >previous</a> |</li>
        <li><a href="../index.html">groonga v1.2.6 documentation</a> &raquo;</li>
          <li><a href="../tutorial.html" >4. チュートリアル</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2011, Brazil, Inc.
    </div>
  </body>
</html>