- Clone the demo project
git clone https://github.com/trulia/thoth-demo.git
This example contains a demo version of
- ActiveMQ broker
- A simple solr instance that we will use to intercept queries from
- A thoth index
- Thoth
Start the demos separately or use the example start script
-
Execute start_demo.sh .
./scripts/start_demo.sh
Access to activemq webUI will be on default port 8161 , if user and password requested use user:admin , password:admin
Access to demo solr instance will be on port 8900
Access to demo thoth index will be on port 8983
Thoth will be running on port 8081
-
Let's execute some queries and simulate some exceptions from the intercepted instance
# Standard query *:* curl 'http://localhost:8900/solr/collection1/select?q=*%3A*&wt=json&indent=true' # Query that will generate exception curl 'http://localhost:8900/solr/collection1/select?q=THIS_FIELD:DOES_NOT_EXIST&wt=json&indent=true'
-
Those requests have been intercepted and indexed by Thoth inside the Thoth index . Let's verify this:
http://localhost:8983/solr/collection1/select?q=*%3A*&wt=json&indent=true
- After a minute the documents will be automatically shrinked and a summary shrank document will be added to the shrank core.
You can change the shrinking configuration inside
thoth/resources/application.properties
Here's a snippet
# Enable/Disable shrinking feature
thoth.shrinker.enabled=true
# Schedule when do you want the shrinker feature to be triggered
# 0 * * * * ? --> Every minute
thoth.shrinker.schedule=0 * * * * ?
# 'how long back' you want to shrink docs in seconds
thoth.shrinker.period= 900
thoth.shrinker.threadPoolSize = 1
The stop_demo.sh script kills the above started process based on the default port number's.
Stop the demos separately or use the example stop script. (Make sure you have execute permission's)
- Execute stop_demo.sh .
./scripts/stop_demo.sh
Copyright (c) 2014 Trulia, Inc. See the LICENSE file for license rights and limitations.