sphinxÕûºÏµ½mysql(master/slave)ÖÐ
sphinx°æ±¾Ê¹ÓõÄÊÇcoreseekÐ޸ĵÄÖ§ ³ÖÖÐÎļìË÷µÄ°æ±¾,ÖÐÎÄ´Ê¿âʹÓà coreseek¿ª·¢µÄlibmmseg
mysqlÊÜsphinxÖÐsphinxseÒýÇæÒªÇó°²×°ÁËmysql-5.0.37×öÉú²ú»·¾³µÄmysql-5.0.70µÄ´Ó¿â
±àÒësphinx,libmmsegÒÔ¼°mysql:
±àÒë°²×°libmmseg:
./configure --prefix=/usr/local/mmseg && make -j5 && make install
copy ½âѹËõºóµÄsphinxĿ¼ÖеÄmysqlseÖеÄÎļþµ½mysqlϵÄsql/sphinx/ÖÐ
¸ømysql´òsphinxµÄ²¹¶¡
patch -p1 < sql/sphinx/sphinx.5.0.37.diff
±àÒëmysql:
./configure --prefix=/data/app/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readlin
e --with-big-tables --enable-local-infile --with-sphinx-storage-engine --without-innobase
make -j5 && make install
±àÒësphinx
CPPFLAGS=-I/usr/include/python2.5 LDFLAGS=-lpython2.5 ./configure --prefix=/data/app/sphinx --with-mysql=/data/app/mysql --with-mmse
g=/data/app/mmseg --with-mmseg-includes=/data/app/mmseg/include/mmseg --with-mmseg-libs=/data/app/mmseg/lib
make -j5 && make install
ÅäÖÃmysqlÖ÷´Ó
.master -> slave
Éú³É×ÖµäÎļþ:
mmseg -u unigram.txt
mv unigram.txt.lib /data/app/dict/uni.lib
ÅäÖÃsphinx.conf
source source_name {...} #×öÈ«ÎļìË÷µÄÄÚÈÝÔ´
source source_name_increase:source_name {...} #×öÔöÁ¿¼ìË÷µÄÔ´
index index_name {...} #×öË÷ÒýµÄÅäÖÃ
index index_name_increase:index_name {...} #×öÔöÁ¿Ë÷ÒýµÄÅäÖÃ
indexer {...} #indexer½ø³ÌµÄÉèÖÃ
searched {...} #searched½ø³ÌµÄÉèÖÃ
½¨Á¢ÔÚÔöÁ¿Ë÷ÒýÐèҪʹÓõÄÊý¾Ý±íÒÔ¼°SPHINXÒýÇæÐèÒªµÄ±í:
CREATE TABLE `sphcounter` (
`counterid` int(11) NOT NULL,
`max_doc_id` int(11) NOT NULL,
PRIMARY KEY (`counterid`)
) ENGINE=MyISAM
CREATE TABLE `sphinx` (
`id` int(11) NOT NULL,
`weight` int(11) NOT NULL,
`query` varchar(255) NOT NULL,
KEY `Query` (`query`)
) ENGINE=SPHINX DEFAULT CHARSET=utf8 CONNECTION='sphinx://localhost:3312/cbid_index';
½¨Á¢Æô¶¯½Å±¾ÒÔ¼°½¨Á¢Ë÷ÒýµÄ½Å±¾:
#!/bin/bash
/data/app/sphinx/bin/indexer --all --config /data/app/sphinx/etc/sphinx.conf
sphinx.increase
#!/bin/bash
/dat
Ïà¹ØÎĵµ£º
µ±Ç°»îÔ¾µÄÊÂÎñ:
------------
TRANSACTIONS
------------
Trx id counter080157601
Purge done for trx's n:o <0 80154573 undo n:o <0 0
History list length 6
Total number of lock structs in row lock hash table 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 0, not started, proce ......
×î½üÏëÔÚ·þÎñÆ÷ÉÏÊÔÊÔMySQL5.1µÄ·ÖÇø£¬ÓÚÊǾÍÏë×Å×°¸öMySQL5.1£¬¾¹ýÍ´¿àµÄÒ»¶Î¾Àúºó£¬ÖÕÓÚÕÒ¸öÏÂÃæ×°¸öºÜºÃµÄ½Ì³Ì£¬ÌûÉÏÀ´±¸Íü¡£
1¡¢MySQLÃâ°²×°°æ/¶þ½øÖÆ°æÈí¼þ£¬²»ÓñàÒ룬ÏÂÔصØÖ·£º
http://dev.mysql.com/downloads/
Îļþ¸ñʽ£ºMYSQL-VERSION-OS.tar.gz
2¡¢´ ......
×÷ÕߣºÀÏÍõ
MySQL5.X¶¼ÒѾ·¢²¼ºÃ¾ÃÁË£¬µ«ÊÇ»¹ÓкܶàÈËÈÏΪMySQLÊDz»Ö§³ÖÊÂÎñ´¦ÀíµÄ£¬Õâ²»µÃ²»¹ÖËûÃÇÊǹª¹ÑÎŵģ¬Æäʵ£¬Ö»ÒªÄãµÄMySQL°æ±¾Ö§³ÖBDB»òInnoDB±íÀàÐÍ£¬ÄÇôÄãµÄMySQL¾Í¾ßÓÐÊÂÎñ´¦ÀíµÄÄÜÁ¦¡£ÕâÀïÃ棬ÓÖÒÔInnoDB±íÀàÐÍÓõÄ×î¶à£¬ËäÈ»ºóÀ´·¢ÉúÁËÖîÈçOracleÊÕ¹ºInnoDBµÈÁîMySQL²»Ë¬µÄÊÂÇ飬µ«ÄÇЩÉÌÒµÉϵĶ·ÕùÓ ......
ĬÈÏÇé¿öÏ£¬innodbµÄ²ÎÊýÉèÖõķdz£Ð¡£¬ÔÚÉú²ú»·¾³ÖÐÔ¶Ô¶²»¹»ÓÃ
±ÈÈç×îÖØÒªµÄÁ½¸ö²ÎÊý
innodb_buffer_pool_size
ĬÈÏÊÇ8M
innodb_flush_logs_at_trx_commit ĬÈÏÉèÖõÄÊÇ1 Ò²¾ÍÊÇͬ²½Ë¢ÐÂlog(¿ÉÒÔÕâôÀí½â)
innodb_buffer_pool_size£º
ÕâÊÇInnoDB×îÖØÒªµÄÉèÖ㬶ÔInnoDBÐÔÄÜÓоö¶¨ÐÔµÄÓ°Ï졣ĬÈϵÄÉèÖÃÖ»ÓÐ8M£¬ËùÒÔ ......
1)¡¢back_log£º
ÒªÇó MySQL ÄÜÓеÄÁ¬½ÓÊýÁ¿¡£µ±Ö÷ÒªMySQLÏß³ÌÔÚÒ»¸öºÜ¶Ìʱ¼äÄڵõ½·Ç³£¶àµÄÁ¬½ÓÇëÇó£¬Õâ¾ÍÆð×÷Óã¬È»ºóÖ÷Ï̻߳¨Ð©Ê±¼ä(¾¡¹ÜºÜ¶Ì)¼ì²éÁ¬½Ó²¢ÇÒÆô¶¯Ò»¸öÐÂÏ̡߳£
back_logÖµÖ¸³öÔÚMySQLÔÝʱֹͣ»Ø´ðÐÂÇëÇó֮ǰµÄ¶Ìʱ¼äÄÚ¶àÉÙ¸öÇëÇó¿ÉÒÔ±»´æÔÚ¶ÑÕ»ÖС£Ö»ÓÐÈç¹ûÆÚÍûÔÚÒ»¸ö¶Ìʱ¼äÄÚÓкܶàÁ¬½Ó£¬ÄãÐèÒªÔ ......