SMILA/Project Concepts/CrawlerController Remote Management
How to manage CrawlerController remotely
Bundle org.eclipse.smila.management.crawlercontroller allows remote management of the CrawlerController. Currently the following methods of the CrawlerController are offered for management: - startCrawl(String dataSourceId), - stopCrawl(String dataSourceId), - getStatus(String dataSourceId) - getActiveCrawls()
To activate remote JMX management SMILA application must be started with the following JVM arguments:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=9004
CrawlerController can be managed with any JMX agent, for example JConsole.
JMX agent application
JMX agent application (jmxagent) allows remote management of the CrawlerController and batch execution of the CrawlerController methods. Jmxagent is available as bundle of the SMILA project org.eclipse.smila.monitoring.jmxagent, but it will be also compiled into the jmxagent-folder of SMILA. It can be started as a java application in Eclipse, or from console with the appropriate run script from build directory (run.bat or run.sh). You can also check sample batch execution script startcrawl.sh or starcrawl.bat.
Configuring the JMX agent application
Using command line arguments
jmxagent run.bat or run.sh script must be provided with the following arguments:
- agent - remote management agent name to connect to (org.eclipse.smila.connectivity.framework.CrawlerController for the CrawlerController management agent)
Remote management agent is a bundle that provides service that implements org.eclipse.smila.management.ManagementAgent interface.
- cmd - command to execute, for example startCrawl;
- dataSourceId - optional parameter, if dataSourceId is missing it's assumed that operation doesn't have any parameters.
run.bat -agent=org.eclipse.smila.connectivity.framework.CrawlerController -cmd=startCrawl -dataSourceId=file
In addition, following JMX configuration arguments can be provided (optionally):
- host - JMX server host (default is localhost)
- port - JMX server port number (default is 9004)
Using properties file.
JMX agent application can be also configured using configuration.properties file. By default it contains default values for host and port properties. Any other command line arguments described above can be placed into configuration.properties file too. Properties from this file will be overridden by the provided corresponding command line properties. The default values host=localhost and port=9004 will be used even if host or port was not specified neither in command line nor in properties file.