阅读更多
1.修改配置去掉了source只留下引用其它节点的agent,
#源定义
#index定义
index dist
{
type =distributed
#local=mysql
agent = 10.28.171.52:9312:mysql
#agent = localhost:9312:chunk3
#agent = localhost:9312:chunk4
# agent_connect_timeout = 1000
# agent_query_timeout = 3000
}
#全局index定义
indexer
{
mem_limit = 128M
}
#searchd服务定义
searchd
{
listen = 9312
read_timeout = 5
max_children = 30
max_matches = 1000
seamless_rotate = 0
preopen_indexes = 0
unlink_old = 1
pid_file = var/log/searchd_mysql.pid #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
log = var/log/searchd_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
query_log = var/log/query_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
}
2.启动indexer
索引: /usr/local/coreseek/bin/indexer -c etc/csft_mysql.conf dist --all 或
不停服务下索引:
/usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/sphinx.conf --all --rotate
搜索服务:启动:/usr/local/coreseek/bin/searchd -c etc/csft_distributed.conf
强行停止: /usr/local/coreseek/bin/searchd -c etc/csft_distributed.conf --stop
安静停止: /usr/local/coreseek/bin/searchd -c etc/csft_distributed.conf --stop
在启动分布索引的时候警告可以忽视 sphinx distributed index can not be directly indexed
3.测试分布式
php api/test.php -i dist Opera
能查询到结果说明已经ok了
使用search 或 test_cor*.php是查询不到结果的