-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add licence, readme and cleanup code
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright (c) 2012, Glenn Plas | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
The views and conclusions contained in the software and documentation are those | ||
of the authors and should not be interpreted as representing official policies, | ||
either expressed or implied, of the FreeBSD Project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# check_solr_slave.php | ||
Written by [Glenn Plas](http://byte-consult.be) | ||
|
||
- Uses curl for HTTP calls to the slave | ||
- Cleans out dangerous moves (basically, it only allow GET request to be sent to a slave) | ||
|
||
## Overview | ||
- This script either parses or tails a solr request log file and sends appropriate slave requests. | ||
- exits at the first error, so as long as it runs, the slave looks to respond fine | ||
|
||
## Usage | ||
|
||
1. `-i`, OR --input <value> : The input file to get the requests from (required) | ||
2. `-s`, OR --slave <value> : host:port ( host can be an ip or a hostname) (required) | ||
3. `-t`, OR --tail : Use tail on the file so you check in realtime, otherwise it will be read from start to end | ||
4. `-d`, OR --debug <value> : Debug flag level. ( value range 1..6 ) => Unused for now | ||
|
||
## Gotchas | ||
|
||
Large files take a long time to process sequentially, I find the tail function a lot more interesting. Your slave will get some hits. | ||
|
||
## Dependencies | ||
- php curl ! | ||
- solr (duh) | ||
|
||
## Inspiration | ||
- A real life problem that required me to verify if a slave was doing fine. | ||
## License | ||
|
||
## TODO | ||
- Check the content of the responses | ||
- Check the response sizes of the slave and compair them to the master (Theoretically they should be the same) | ||
|
||
Copyright (c) 2012, Byte Consult | ||
All rights reserved. | ||
|
||
See included License file |