2

Sphinx メイン + デルタ システムを Sphinx で使用しようとしています。Cronジョブがログから言い続けることを除いて、すべてが機能してWARNING: no such index 'listings_delta_index', skippingいます。コマンドを手動で実行すると、問題なく動作します。私が実行しているコマンドと私が使用している sphinx.conf は以下のとおりです。また、インデックス名を Listings_index に変更しようとしましたが、どちらも機能しません。

Sphinx.conf

source listings_source
{
    type            = mysql
    sql_host        = localhost
    sql_user        = user2
    sql_pass        = password
    sql_db          = MyVirtuals
    sql_port        = 3306  # optional, default is 3306
    sql_query_pre   = SET NAMES utf8
    sql_query_pre   = REPLACE INTO sph_counter SELECT 1, MAX(listing_id) FROM     listings
    sql_query_pre   = REPLACE INTO sph_last_index SELECT 1, NOW()
    sql_query       = \
    SELECT listing_id, title,CRC32(mainCategoryID) as mainCategoryID,CAST(price AS DECIMAL(12,2)) as price, UNIX_TIMESTAMP(date_created) AS date_created, description \
    FROM listings WHERE listing_id<=(SELECT max_doc_id FROM sph_counter WHERE counter_id=1) AND status = 1
    sql_query_killlist  = SELECT listing_id FROM listings WHERE modified_on >= (SELECT last_reindex_on FROM sph_last_index WHERE counter_id=1)

    sql_attr_timestamp  = date_created
    sql_attr_uint   = mainCategoryID
    sql_attr_float  = price

    #sql_query_info = SELECT * FROM documents WHERE id=$id
}
index listings_index
{
    source      = listings_source
    path        = /usr/local/sphinx/var/data/listings_index
    docinfo     = extern
    charset_type    = sbcs
    min_word_len    = 1
    html_strip      = 1
}
source listings_delta_source : listings_source{
    sql_query_pre       = SET NAMES utf8
    #Pull listings that are new and changed
    sql_query       = SELECT listing_id, title, CRC32(mainCategoryID) as mainCategoryID, CAST(price AS DECIMAL(12,2)) as price, UNIX_TIMESTAMP(date_created) AS date_created, description \
    FROM listings WHERE listing_id>(SELECT max_doc_id FROM sph_counter WHERE counter_id=1) OR modified_on >= (SELECT last_reindex_on FROM sph_last_index WHERE counter_id=1)
}
index listings_delta_index : listings_index{

        source      = listings_delta_source
        path        = /usr/local/sphinx/var/data/listings_delta_index
        docinfo     = extern
        charset_type    = sbcs
        min_word_len    = 1
        html_strip      = 1
}
indexer
{
    mem_limit       = 32M
}
searchd
{
    listen      = 9312
    listen      = 9306:mysql41
    log         = /var/log/sphinxsearch/searchd.log
    query_log       = /var/log/sphinxsearch/query.log
    read_timeout    = 5
    max_children    = 30
    pid_file        = /var/log/sphinxsearch/searchd.pid
    max_matches     = 1000
    seamless_rotate = 1
    preopen_indexes = 1
    unlink_old      = 1
    workers     = threads # for RT to work
    binlog_path     = /usr/local/sphinx/var/data
}

sphinx_update_delta.sh

indexer -c /var/www/scripts-conf/sphinx.conf --rotate listings_delta_index

crontab

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report     /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
*/1 *    * * *   root    sh /var/www/scripts-conf/sphinx_update_delta.sh > /var/log/cronlog.log
*  0    * * *   root    sh /var/www/scripts-conf/sphinx_update_main.sh

誰でもこの問題で私を助けることができますか?

4

1 に答える 1