== Download and installation == <> For a quick start, we have prepared a bash script that starts all the necessary components on one machine. We will use this script throughout this quickstart manual to allow you to get a feel for what the system can do and how it works without having to deal with issues of distributing to other servers. === Base system required === For the quick startup, !NetarchiveSuite requires * a Linux system. . Note that for the quickstart, you must be able to run a browser on the machine that you run the system on - this is an artifact of the quickstart system and is not the case in the full system. Root access is not required. * Running Ant application - Java based build tool like make * Sun Java SE (Standard Edition) JDK version 1.6.0_07 running on the Linux system. . Newer versions of Java may work, but have not been tested. Older versions of Java will '''not''' work correctly. The latest download version of Sun Java 6 SE is "JDK 6 Update 13" (19 May 2009). To check that you have the right version of Java do the following * start a terminal login to the linux system as a ordinary user * check java version is version 1.6.0_07 (or higher) by writing: . {{{$ java -version}}} . you should then see . {{{ linux>java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing) }}} === Downloading === Download and unzip of the newest release is described here * start a terminal login to the linux system as a ordinary user in a bash shell * make a directory for the download e.g. directory {{{ ~/netarchive }}} . {{{ $ mkdir ~/netarchive }}} * start a web browser, e.g. Firefox * follow the registration and download instructions on [[Get NetarchiveSuite]] and save the download file to the directory you created earlier * go to the directory . {{{ $ cd ~/netarchive }}} * unzip the binary package . {{{ $ unzip NetarchiveSuite*.zip }}} * if downloading the trunk: . {{{ $ cd trunk }}} . {{{ $ ant warfiles }}} === JMS === !NetarchiveSuite uses JMS for inter-process communication. JMS is the Java Messaging Service, which provides asynchronous communication between processes. You do not need any knowledge of JMS to use !NetarchiveSuite. However you need to make sure that there are not already JMS brokers running on your system using PORT 8100. ## But the JMS application listen to port 7676 so this must be available before starting the simple harvest program. Currently only the open-source version of Sun's JMS implementation is supported, since some functionality of other implementations does not match our assumptions well. ## If the port is available, then ## {{{ ## telnet localhost 7676 ## }}} ## results in {{{Trying 127.0.0.1... ## telnet: Unable to connect to remote host: Connection refused }}} To download and install it, do the following: * open this link in a browser window https://mq.dev.java.net/downloads.html * click the Linux Link under version 4.1 Binary Downloads to download a file {{{mq4_1-binary-Linux_X86-20070816.jar}}} (or later) * save the download file to the created directory you created earlier e.g. {{{ ~/netarchive }}} * go to the directory . {{{ $ cd ~/netarchive }}} * unpack the jar file (this creates a directory mq and three files with licensing information) . {{{ $ jar xvf mq4_1-binary-Linux_X86-20070816.jar }}} * run imqbroker in order to create settings file . {{{ $ chmod +x ./mq/bin/imqbrokerd }}} . {{{ $./mq/bin/imqbrokerd }}} . For this to work, it may be necessary to set the IMQ_JAVAHOME environment variable to point to your java installation directory, e.g. `/usr/java/jdk1.6.0_07`: {{{ $ export IMQ_JAVAHOME=/usr/java/jdk1.6.0_07 }}} * check that {{{ imqbrokerd }}} starts and that the last message is {{{ "Broker :7676 ready" }}} * stop imqbroker by pressing {{{ control-C }}} * edit settings to allow for enough listeners to a queue by doing . edit {{{ ~/netarchive/mq/var/instances/imqbroker/props/config.properties }}} * uncomment and specify count=20 for listeners by changing line . {{{"# imq.autocreate.queue.maxNumActiveConsumers" }}} . -> . {{{" imq.autocreate.queue.maxNumActiveConsumers=20"}}} === Configuration === Assuming the !NetarchiveSuite files were unzipped to the directory {{{~/netarchive}}} as described above, you must do the following to configure the !NetarchiveSuite for your system: For the simple harvest setup, the startup script needs to know a few paths. You can either do this by exporting the environment variables in your shell or by changing the harvest script. The following describes how to set the environment variables: * set `JAVA` to point to your java installation directory, e.g. `/usr/java/jdk1.6.0_07` . {{{ $ export JAVA=/usr/java/jdk1.6.0_07 }}} * set `JAVA_HOME` to point to your java installation directory, e.g. `/usr/java/jdk1.6.0_07` . {{{ $ export JAVA_HOME=/usr/java/jdk1.6.0_07 }}} * set `IMQ_JAVAHOME` to point to your java installation directory, e.g. `//usr/java/jdk1.6.0_07` . {{{ $ export IMQ_JAVAHOME=/usr/java/jdk1.6.0_07 }}} * set `IMQ` to the full path of the executable of the Sun JMS broker, e.g. {{{~/netarchive/mq/bin/imqbrokerd}}} . {{{ $ export IMQ=~/netarchive/mq/bin/imqbrokerd }}} Note that these environment variables need to be set every time you log in, if you wish to use the quickstart scripts. You can also edit the file {{{harvest.sh}}} and set the variables there, if you wish the settings to be persistent. === Starting the system === '''Note:''' Starting the script clears all data from previous runs. The clearing of previous data is disabled by setting environment variable KEEPDATA: {{{ export KEEPDATA=1 }}}. To start the program do the following: * start a terminal login to the linux system as a ordinary user in a {{{bash}}} shell * set the environment variables `JAVA`, `IMQ`, and `IMQ_JAVAHOME` as described above, if they are not set already. * go to the simple harvest directory and run program . {{{$ cd ~/netarchive/scripts/simple_harvest}}} . {{{$ ./harvest.sh}}} . note that it will start several xterm windows, one for each application running (including JMS). All the xterms will display the logs of their applications (see figure below) -- you can follow how they start up and when they are ready to use. . Also notice that invoking the harvest.sh script while not in the ~/netarchive/scripts/simple_harvest directory will result in parts of the application, as the GUI, not starting, so be sure of always cd-ing in the directory where the script resides. * if running on trunk, make sure to have generated jar files first . {{{$ ant jarfiles }}} * wait until the xterm with the title {{{ HarvestDefinition }}} has stopped writing messages. It should include towards the end one saying {{{ "Scheduler running every 60 seconds" }}} A typical set of windows looks like this: . {{attachment:Screenshot-1.png}} * start a web browser by e.g. {{{ $ mozilla }}} Note that it is important that the browser is started on the same machine as the simple harvest script is run on. * write url in the started browser http://localhost:8073/HarvestDefinition . You can now see the webinterface in the browser === Stopping the system === When you are done experimenting, you can use the scripts described below to stop the programs. After that, it should be possible to restart from scratch by following the instructions described above under section "Starting simple_harvest version". Do the following: {{{ $ cd ~/netarchive/scripts/simple_harvest $ ./killhard.sh }}}