Hi Gautier,
Thanks for replying me!
I confirm that the spyder example can run after being built with maven.
However its scripts don't work for me, so I have to launch it with command line (I had to add some missing librairies):
Master:
Code:
$TC_HOME/bin/dso-java.sh
-classpath /home/nam/Documents/terracotta-definitive-guide-1.2/chapter_11_masterworker/spider/target/classes/
:/home/nam/Documents/terracotta-definitive-guide-1.2/chapter_11_masterworker/workmanager/target/classes/
:/home/nam/Documents/terracotta-definitive-guide-1.2/foo-commonj-1.0.1/lib/commonj-twm.jar
:/home/nam/Documents/terracotta-definitive-guide-1.2/foo-commonj-1.0.1/lib/jericho-html-2.6.jar
:/home/nam/Documents/terracotta-definitive-guide-1.2/foo-commonj-1.0.1/lib/commons-cli-1.1.jar
-server -Xms64m -Xmx64m -Dtc.install-root=$TC_HOME
-Dtc.config=/home/nam/Documents/terracotta-definitive-guide-1.2/chapter_11_masterworker/spider/tc-config.xml
org.terracotta.workmanager.spider.StartMaster
--url http://www.google.com --depth 4 --external-links false -i 1:2:3:4:5
Worker:
Code:
$TC_HOME/bin/dso-java.sh
-classpath /home/nam/Documents/terracotta-definitive-guide-1.2/chapter_11_masterworker/spider/target/classes/
:/home/nam/Documents/terracotta-definitive-guide-1.2/chapter_11_masterworker/workmanager/target/classes/
:/home/nam/Documents/terracotta-definitive-guide-1.2/foo-commonj-1.0.1/lib/commonj-twm.jar
:/home/nam/Documents/terracotta-definitive-guide-1.2/foo-commonj-1.0.1/lib/jericho-html-2.6.jar
-server -Xms64m -Xmx64m -Dtc.install-root=$TC_HOME
-Dtc.config=/home/nam/Documents/terracotta-definitive-guide-1.2/chapter_11_masterworker/spider/tc-config.xml
org.terracotta.workmanager.spider.StartWorker 1
But the master and the worker don't work. They just keep waiting. I checked the worker's pipe but there was nothing in it.
Master:
Code:
Starting Spider:
start url = http://www.google.com
max parse depth = 4
follow external links = false
list with routing IDs = [ 1 2 3 4 5 ]
created PipeManager for Initiator: MASTER
DefaultQueueListener has started - serving pipe: 1
DefaultQueueListener has started - serving pipe: 2
DefaultQueueListener has started - serving pipe: 3
DefaultQueueListener has started - serving pipe: 4
DefaultQueueListener has started - serving pipe: 5
Submitting URL: http://www.google.com
scheduled work #: 0
Code:
Worker:
-- starting worker...
-- kill it with ^C when finished
created PipeManager for Initiator: WORKER
registering a new work queue for routing ID: 1
Starting worker with routing ID: 1
About the tc-lib framework, I've run through your site many times and can see a lot of your efforts. I've seen a lot of master/worker examples (of course, with Terracotta enabled) on the internet and I think your examples are the closest ones to a real production system.
Regards,
Chu