[Practice] The sphsf-index merging script is used to implement the sphsf-index.

Source: Internet
Author: User

[Practice] The sphsf-index merging script is used to implement the sphsf-index.

Mkdir/usr/local/sphscripts/scripts ---- 0. Create all primary indexes #! /Bin/bash # ocpyang@126.com # 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/sphi Nx. conf -- rotate>/dev/null 2> & 1----1. incremental index #! /Bin/bash # ocpyang@126.com # 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/sphcenters/etc/sphcenters. conf -- rotate>/dev/null 2> & 1---2. Merge indexes #! /Bin/bash # ocpyang@126.com # merge_daily_index.sh # merge "main + delta" indexes #1. index abunt tblpnr/usr/local/sphunt/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 (update_time) FROM jinripnr. tblpnr "fi #2. index abount tblticketno/usr/local/sphunt/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 abunt tblpassengername/usr/local/sphunt/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/sphunt/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 #### create an incremental index again # 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 src3_delta-c/usr/local/sphinx/etc/sphinx. conf \ -- rotate -- merge-dst-range deleted 0 0 -- merge-killlists -- view the job execution log tail-f/var/log/cron

Related Article

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.