Notes for placing sphtracing logs in/dev/SHM

Source: Internet
Author: User
Tags spl

You can use a timer to clear logs:

Several Methods to quickly clear the file content: $:> filename # Where: A placeholder does not produce any output. $> filename $ echo ""> filename $ echo/dev/null> filename $ echo> filename $ CAT/dev/null> filename

 

However, logs play a certain role. For example, the following is an example: Analysis of an example of failure in rebuilding the index using sphinx

You can run the following command to re-create the Sphinx index:/sphinx/bin/indexer-rotate idx_name. However, this command does not guarantee successful re-creation. Sometimes, after re-creation, the new data is not added to the index, but the log shows the following record: Warning: rotating index 'idx _ m_tag ': Lock: failed to lock/sphinx/data/Tables: Resource temporarily unavailable; using old indexwarning: rotating index 'idx _ n_tag ': Lock: failed to lock/sphinx/data/idx_n_tag.new.spl: bad file descriptor; using old index [Sun Mar 24 06: 40: 01.084 2013] [12413] the rotating finished log records the fact that the index reconstruction failed and the old index was used again. To analyze this cause, you must first understand the reindexing process of sphinx. The SPL file recorded in the log is actually an empty file, which is just a tag of the Sphinx lock. When the index is re-created, a new index file is generated, that is, the new file is marked with. New after the original file name, and the old file remains unchanged. Then restart the searchd process, so we will see this output when executing the rotate index: rotating indices: succesfully sent sighup to searchd (pid = 12413 ). after the searchd process is started, an operation is executed to name the old file. old File, put. the new file is updated to a normal index file name. If there is a problem, a rollback operation will be performed. In this process, the file is switched by locking and unlocking the SPL file. If there is a problem with SPL lock contention, the new index file will not take effect. At this time, the solution is to manually restart the searchd process. The easiest way to avoid this problem is to monitor the Sphinx log, capture the failure of the lock SPL file through the script, and process it immediately.

So how do I pay attention to index generation in O & M?

Indexer log http:// OS .51cto.com/art/201103/247290.htm for Nagios monitoring sphwheel

 

Notes for placing sphtracing logs in/dev/SHM

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.