Home  >  Article  >  php教程  >  sphinx利用配置来进行分布式部署的方法和配置详解

sphinx利用配置来进行分布式部署的方法和配置详解

WBOY
WBOYOriginal
2016-06-21 08:49:24866browse

1:主配置文件 dist.conf

source sour1{}建立源1

index index1{}建立索引1   这些配置不多说

index dist{

      type = distributed //表示为分布式

      local = index1    //本地索引

      agent = localhost:9311:index2   //分布式其它索引ip地址端口和索引名称  可以有多个

}

searchd{

 listen = 9312

pid_file = F:/www/sphinx/data/searchd_mysql.pid

}

2:第二个配置文件 dist1.conf

source source2{}

index index2{}

searchd{

 listen = 9311//这里的端口和pid_file一定不要和上面的重复,应为这要分别开始守护进程的,避免冲突

pid_file = F:/www/sphinx/data/searchd_mysqls.pid

}

然后先开dist1.conf的searchd守护,然后再开dist.conf守护,就可以用了,

注意:要确保两份源数据一致,否则会有错误。貌似在liunx下一份配置就可以做分布式,我没试过,windows下没成功,有高人知道的话可以回帖分享一下。

配置文件说,

在有多个CPU和硬盘的机器上,代理可以指向相同的机器以便并行地使用硬件,降低查询延迟。并不需要为此设置多个searchd实例,一个实例与自身通信是合法的。但是不清楚windows下可行不。



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn