sphinx分布式配置

单机配置请参考

搭建coreseek(sphinx+mmseg3)详细安装配置+php之sphinx扩展安装+php调用示例 

分布式配置很简单,只需要将局域网内的机器连接即可。

vi /usr/local/coreseek/etc/csft.conf

index dist
{
        type                            = distributed
        agent                           = 127.0.0.1:9313:index_3307_0
        agent                           = 127.0.0.1:9313:index_3307_0_delta
        agent                           = 127.0.0.1:9314:index_3307_1
        agent                           = 127.0.0.1:9314:index_3307_1_delta
        agent                           = 127.0.0.1:9316:index_3308_0
        agent                           = 127.0.0.1:9316:index_3308_0_delta
        agent                           = 127.0.0.1:9317:index_3308_1
        agent                           = 127.0.0.1:9317:index_3308_1_delta
        agent                           = 127.0.0.1:9319:index_3309_0
        agent                           = 127.0.0.1:9319:index_3309_0_delta
        agent                           = 127.0.0.1:9320:index_3309_1
        agent                           = 127.0.0.1:9320:index_3309_1_delta
        agent_query_timeout             = 100000
}

indexer
{
    mem_limit           = 1024M
}
searchd
{
    listen              = 9312
    read_timeout        = 5
    max_children        = 30
    max_matches         = 6000
    seamless_rotate     = 1
    preopen_indexes     = 1
    unlink_old          = 1
    compat_sphinxql_magics=0
    query_log_format    = sphinxql
    pid_file            = /usr/local/coreseek/var/log/searchd_mysql.pid
    log                 = /usr/local/coreseek/var/log/searchd_mysql.log
    query_log           = /usr/local/coreseek/var/log/query_mysql.log
    #workers            = threads
    dist_threads = 6
}

共6台机器的索引及增量,共12项。

然后启动进程。

/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft.conf

最后记得加入到开机命令中:

vi /etc/rc.local

你可能感兴趣的:(sphinx分布式配置)