sphinx无法启动的解决
该提示表示当前的配置文件的编码不是UTF-8(无BOM头)格式,无法正确解析,请使用编辑软件打开配置文件,另存为UTF-8(无BOM头)格式;
错误的编码格式包括:Unicode、Unicode BOM、Unicode big endian、Unicode 低位在前、UTF-8 + BOM、UTF-8 Signature、UTF-8 包含签名等;
特别注意:Windows自带的记事本(Notepad)或者写字板(WordPad)无法正确保存为所需格式,请勿使用其编辑配置文件;
在sphinx中处理使用特殊字符时所引起错误的办法
如 “$”、“^”,在sphinx搜索关键字的最前或最尾出现这样的字符时(单独使用也一样),就会导致sphinx致命的错误。例如用“$笔记本”或“笔记本^”作为关键字搜索时,就会引起类似'Query failed: index product: syntax error, unexpected '"'。
在搜索关键字的前面和后面自动加上半角的空格符“ ”可以解决此问题,且不会影响搜索结果。
ERROR: index ‘product’: raw_hits: write error: 122070 of 262017 bytes written
1、增量索引,注意删除的问题 2、对大数据,一定要给sphinx数据目录留出大量空间,因为临时文件会占据非常大的空间
Q、编译安装时出现这个问题….sphinx.cpp; then mv -f “.deps/sphinx.Tpo” “.deps/sphinx.Po”; else rm -f “.deps/sphinx.Tpo”; exit 1; fi In file included from sphinx.cpp:14:sphinx.h:54:19: error: mysql.h: No such file or directory….
Q: sphinx在rotate时出现以下问题。(searchd.log) WARNING: rotating index ‘sphinx’: prealloc: mmap() failed: Cannot allocate memory (length=431854320); using old index,同时,在索引数据目录中会出现sphinx.spl sphinx.new.spl的情况,导致原来的索引不能正确的检索到
先了解一下sphinx的 –rotate机制:
indexer完成索引->发送SIGHUP 给searchd(同时在终端输出索引已经完成)->searchd接到中断信号->等待所有子进程退出->重命名 当前索引为旧索引为 .old
->重命名 .new 索引文件作为当前索引->尝试加载当前索引文件->如果加载失败,searchd会把.old文件回滚为当前文件,并把刚建立的新索引重命名 为 .new ->加载成的话:完成无缝衔接
执行 rotate开关情况下,indexer在完成索引后会首先会发送一个中断信号给searchd(并且会输出已经索引完成)。
接着 searchd会做以下事情:
1)等待所有子进程退出
2)重命名 当前索引为旧索引为 .old
3)重命名 .new 索引文件作为当前索引
4)尝试加载当前索引文件
5)如果加载失败,searchd会把.old文件回滚为当前文件,并把刚建立的新索引重命名为 .new
鉴于以上情况,很可能是开启了2个检测目录访问权限的进程。用户同时使用2个indexer且 searchd运行其下 等等
sphinx的searchd在启动时会创建一个 .spl 锁文件,并在关闭时会删除它。在indexer创建索引时如果发现有 .spl文件,则不会创建新索引,除非使用 –rotate
所以,出现这样的问题可能是 锁文件不知咋的就丢失啦,或者重建索引时没有使用 –rotate开关
原文:
http://www.sphinxsearch.com/forum/view.html?id=274
It seems that
a) the lock files were lost somehow, and
b) you ran indexer without –rotate switch.
Normally, searchd would create .spl lock files on startup (and kill them on shutdown),
and indexer would then refuse to reindex without –rotate switch.
indexers sends SIGHUP to searchd when completed (and it should print that out). searchd
then does the following:
1) waits for all children to exit
2) renames current index files to .old
3) renames .new index files to current
4) tries to load current index files
5) if something failed, it rollbacks current files from .old and new to .new
In your case I would start with double checking directory access rights, users which both
indexer and searchd run under, etc.
具体操作:
killall searchd 然后重启。重启后会自动加载重命名 sphinx.new.sp*为 sphinx.sp*
另外,出现这样的问题时,最好注意 –rotate的使用,在应用许可 的情况下,不妨直接采用 关闭searchd 再索引,然后再开启 searchd
Q:关于updateAttribute更新索引的问题
Q、sphinx安装make时,碰到libiconv的问题。
./configure –without-iconv,就好了。NND,那干嘛还要这个iconv嘛。
看出错代码里,是在xmlunknowencode时才用到。我们都用utf-8,很多时候可能压根用不着这个功能!如若需要的话,可以加上这个lib
Q、检索出来后结果id排序问题
或
SELECT * FROM documents WHERE id IN (3,5,7) ORDER BY substring_index((id,3,5,7),id,1)
Q、WARNING: sort_hits: merge_block_size=248 kb too low, increasing mem_limit may improve performance
Q:sphinx排序问题
Q、WARNING: maxed out, dismissing client
通常客户端也会返回“zero-sized searchd response”。 解决办法: 重启searchd即可 作者的话: It seems that a) the lock files were lost somehow, and b) you ran indexer without --rotate switch. http://www.sphinxsearch.com/forum/view.html?id=247
Q、CentOS5.4 安装coreseek-3.2.13的mmseg 时,./configure 出现错误:config.status: error: cannot find input file: src/Makefile.in
Q:coreseek 在安装 make 时候出现 undefined reference to `libiconv’
./src/MakeFile文件
将
LIBS = -lm -lexpat -L/usr/local/lib
改成
LIBS = -lm -lexpat -liconv -L/usr/local/lib
Q:在分布式搜索中api调用出现 search Error: unknown local index ‘allindex’ in search request
{
type = distributed
local =usertest1stemmed
local =testidx
agent = localhost:3306:agentdata1,agentdata2
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
A:这里是sphinx在解析localhost的时候不能正确指向127.0.0.1 ,所以更改一下配置中的localhost即可。即:
agent = 127.0.0.1:3306:agentdata1,agentdata2
7993



被折叠的 条评论
为什么被折叠?



