"Combat" Sphinx the index merge script

Source: Internet
Author: User

Mkdir/usr/local/sphinx/scripts----0. All primary indexes new #!/bin/bash#[email protected] #main_index_update. sh/usr/local/ Sphinx/bin/indexer src2-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin /indexer src3-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer Src4-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src5-c/usr /local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1----1. Incremental index #!/bin/bash#[email protected]# Delta_index_update.sh/usr/local/sphinx/bin/indexer src2_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/ Dev/null 2>&1/usr/local/sphinx/bin/indexer src3_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/ Null 2>&1/usr/local/sphinx/bin/indexer src4_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src5_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1---2. Merging indexes #!/bin/bash#[email protected] #merge_ daily_index.sh# Merge "main + Delta" indexes# #1. Index Abount tblpnr/usr/local/sphinx/bin/indexer--merge src2 src2_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter select 2, max (ID), Max (up date_time) from Jinripnr.tblpnr "fi# #2. Index Abount tblticketno/usr/local/sphinx/bin/indexer--merge src3 src3_delta-c/usr/local/sphinx/etc/sphinx.conf-- Rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter Select 3, MAX (ID), Max (update_time) from Jinritickno.tblticketno "fi# #3. Index Abount tblpassengername/usr/local/sphinx/bin/indexer--merge SRC4 src4_delta-c/USR/LOCAL/SPHinx/etc/sphinx.conf--rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter Select 4, MAX (ID), Max (update_time) from Jinripname.tblpassengername "fi# #4. Index Abount tblorderno/usr/local/sphinx/bin/indexer--merge src5 src5_delta-c/usr/local/sphinx/etc/sphinx.conf-- Rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter Select 5, MAX (ID), Max (update_time) from Jinriorderno.tblorderno "fi### #再次新建增量索引 #delta_index_update.sh/usr/local/sphinx/bin/indexer Src2_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src3 _delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src4_ Delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src5_delta-c/usr/local/sphinx/etc/ sphinx.conf--rotate >/dev/null 2>&1 # crontab-l# CRONTAB-E*/5 * * * */usr/local/mysql/scripts/delta_index _update.sh0 2 * * */usr/local/mysql/scripts/merge_daily_index.sh---Merge syntax/usr/local/sphinx/bin/indexer--merge src3 src 3_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate--merge-dst-range deleted 0 0--merge-killlists--View Job execution log tail-f /var/log/cron

"Combat" Sphinx the index merge script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.