博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sphinx服务器安装及配置详解
阅读量:6228 次
发布时间:2019-06-21

本文共 3344 字,大约阅读时间需要 11 分钟。

1、架构:ip192.168.0.200 redhat5.4(64位)

2、安装

#cd /usr/local/src   #yum -y install mysql-devel             #安装mysql头文件支持mysql   #wget http://sphinxsearch.com/files/sphinx-0.9.9.tar.gz   #tar -xvzf sphinx-0.9.9.tar.gz   #cd sphinx-0.9.9   #./configure --prefix=/usr/local/sphinx --with-mysql --with-iconv --enable-id64   #make   #make install

3、配置

#cd /usr/local/sphinx   #cp etc/sphinx.conf.dist etc/sphinx.conf   #vim etc/sphinx.conf                      #修改配置文件   source goods_src   {        type                                    = mysql        sql_host                                = localhost        sql_user                                = ecshop        sql_pass                                = ecshop        sql_db                                  = ecshop        sql_port                                = 3306        sql_sock                                = /tmp/mysql.sock        sql_query_pre                           = SET NAMES utf8        sql_query_pre                           = SET SESSION query_cache_type=OFF        sql_query                               = \                SELECT goods_id,cat_id,goods_sn,goods_name,brand_id,provider_name,goods_number,goods_weight,market_price,shop_price,promote_price,promote_start_date,keywords \                FROM ecs_goods        sql_attr_multi          = uint gid from query; SELECT goods_id,cat_id FROM ecs_goods        sql_attr_uint           = brand_id        sql_attr_float          = market_price        sql_attr_float          = shop_price        sql_attr_float          = promote_price        sql_attr_float          = goods_weight        sql_attr_str2ordinal    = goods_sn        sql_attr_str2ordinal    = goods_name        sql_ranged_throttle     = 100    }    index goods    {        source                  = goods_src        path                    = /usr/local/sphinx/var/data/goods        docinfo                 = extern        mlock                   = 1        morphology              = none        min_stemming_len        = 1        min_word_len            = 1        charset_type            = utf-8        charset_table           = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F        ignore_chars            = U+00AD        ngram_len               = 1        html_strip              = 0    }    indexer    {        mem_limit               = 1024M               //建议256到1024之间    }    searchd    {        listen                  = 9312        log                     = /usr/local/sphinx/var/log/searchd.log        query_log               = /usr/local/sphinx/var/log/query.log        read_timeout            = 5        client_timeout          = 300        max_children            = 30        pid_file                = /usr/local/sphinx/var/log/searchd.pid

max_matches

= 1000

seamless_rotate = 1 preopen_indexes = 0 unlink_old = 1 mva_updates_pool = 1M max_packet_size = 8M max_filters = 256 max_filter_values = 4096 }

4、启动

#/usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/sphinx.conf --all   #创建索引   #/usr/local/sphinx/bin/searchd --config /usr/local/sphinx/etc/sphinx.conf         #启动索引服务   #crontab -e                                加入crontab五分钟重新索引   */5 * * * */usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/sphinx.conf --rotate

  

    本文转自yuangang_love 51CTO博客,原文链接:http://blog.51cto.com/linux008/622088,如需转载请自行联系原作者

你可能感兴趣的文章
升级cordova
查看>>
Alpha 冲刺 (10/10)
查看>>
简述mysql数据库配置文件
查看>>
count
查看>>
P3518 [POI2011]strongbox
查看>>
JS判断数组方法大全
查看>>
【20181019T3】比特战争【最小生成树思想】
查看>>
Python之初识模块
查看>>
iphone-common-codes-ccteam源代码 CCUICalloutView.m
查看>>
鐵打的營盤
查看>>
成功来自刻意练习
查看>>
LR11生成图表后修正Analysis中显示请求的地址长度过短50个字符的问题
查看>>
架构之美阅读笔记之二
查看>>
11.时间序列分析狠
查看>>
Java之Annotation
查看>>
汇编语言中整数常量表示方式
查看>>
XML Schema choice 元素
查看>>
【Luogu 3810】三维偏序
查看>>
hdu Hike on a Graph
查看>>
深入分析 ThreadLocal 内存泄漏问题
查看>>