O'Reilly logo

Sphinx Search by Abbas Ali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - adding distributed index configuration

  1. Modify /usr/local/sphinx/etc/sphinx-distributed.conf on the primary server (192.168.1.1) and add a new index definition as shown:
    index master
    {
    type = distributed
    # Local index to be searched
    local = items
    # Remote agent (index) to be searched
    agent = 192.168.1.2:9312:items-2
    }
    
  2. Modify the configuration files on both 192.168.1.1 and 192.168.1.2 servers, and add the searchd section as shown:
    searchd
    {
    log = /usr/local/sphinx/var/log/searchd-distributed.log
    query_log = /usr/local/sphinx/var/log/query-distributed.log
    max_children = 30
    pid_file = /usr/local/sphinx/var/log/searchd-distributed.pid
    }
    
  3. Start the searchd daemon on the primary server (make sure to stop any previous instance):
    $ /usrl/local/sphinx/bin/searchd ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required