<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Operation</title><link>https://sourceforge.net/p/pwa-technologies/wiki/Operation/</link><description>Recent changes to Operation</description><atom:link href="https://sourceforge.net/p/pwa-technologies/wiki/Operation/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 17 Dec 2013 15:54:48 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pwa-technologies/wiki/Operation/feed" rel="self" type="application/rss+xml"/><item><title>Operation modified by Anonymous</title><link>https://sourceforge.net/p/pwa-technologies/wiki/Operation/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The indexing process is where you turn a number of different arc files with a number of pages into a searchable index. &lt;/p&gt;
&lt;h1 id="procedure"&gt;Procedure&lt;/h1&gt;
&lt;p&gt;For this procedures the hadoop cluster should be &lt;a class="" href="../Install"&gt;installed&lt;/a&gt; and started (${HADOOP_HOME}/bin/start-all.sh). Steps for indexing a data collection: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy the file created in &lt;a class="" href="../Compile"&gt;Compile&lt;/a&gt; &lt;code&gt;pwa-technologies/PwaArchive-access/projects/nutchwax/nutchwax-job/target/nutchwax-job-0.11.0-SNAPSHOT.jar&lt;/code&gt; to the directory &lt;code&gt;SCRIPTS_DIR&lt;/code&gt;. And copy the pwalucene-1.0.0-SNAPSHOT.jar is in &lt;code&gt;pwa-technologies/PwaLucene/target/pwalucene-1.0.0-SNAPSHOT.jar&lt;/code&gt; to directory &lt;code&gt;SCRIPTS_DIR&lt;/code&gt;, defined in &lt;a class="" href="../Install"&gt;Install&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Make the arc files to index available to all servers in the cluster, in pwa we use the web application browser, adding the arcs to the directory &lt;code&gt;${CATALINA_HOME}/webapps/browser/files&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create arc list: &lt;/p&gt;
&lt;p&gt;find &lt;span&gt;[FOLDER_WITH_ARC_FILES]&lt;/span&gt; -type f -name '*.arc.gz' -printf "http://master.example.com:8080/browser/files/&lt;span&gt;[COLLECTION]&lt;/span&gt;/%P\n" &amp;gt; &lt;span&gt;[DESTINATION_FILE.txt]&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;copy arc list to HDFS: &lt;/p&gt;
&lt;p&gt;${HADOOP_HOME}/bin/hadoop fs -mkdir inputs&lt;br /&gt;
${HADOOP_HOME}/bin/hadoop fs -put &lt;span&gt;[DESTINATION_FILE.txt]&lt;/span&gt; inputs/&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Parse arcs files to create segments, change the &lt;code&gt;COLLECTION_NAME&lt;/code&gt; to a name to be contained in the index, it is used has identification only. This process creates the &lt;code&gt;segments&lt;/code&gt; directory on the HDFS, erase it if you need to repeat the process: &lt;/p&gt;
&lt;p&gt;echo -e "Import\n$(date)" &amp;gt;&amp;gt;time; ${HADOOP_HOME}/bin/hadoop jar ${SCRIPTS_DIR}/nutchwax-job-0.11.0-SNAPSHOT.jar import inputs outputs COLLECTION_NAME; date &amp;gt;&amp;gt;time&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Some verifications that can be done using hadoop logs from all machines, and the total of Exceptions should be less than 1% of the total number of documents: &lt;/p&gt;
&lt;p&gt;grep -r 'IllegalCharsetNameException' ${HADOOP_HOME}/logs/&lt;em&gt; | awk {'print $6'} | sort -u&lt;br /&gt;
grep -r 'parser not found for' ${HADOOP_HOME}/logs/&lt;/em&gt; | awk {'print $15'} | sort -u&lt;br /&gt;
grep -r 'Error parsing' ${HADOOP_HOME}/logs/* | awk {'print $7'} | sort | uniq -c | sort -n -r&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update dbs with recent imports. This process creates the &lt;code&gt;crawldb&lt;/code&gt; directory on the HDFS, erase it if you need to repeat the process: &lt;/p&gt;
&lt;p&gt;echo -e "Update\n$(date)" &amp;gt;&amp;gt;time; ${HADOOP_HOME}/bin/hadoop jar ${SCRIPTS_DIR}/nutchwax-job-0.11.0-SNAPSHOT.jar update outputs ; date &amp;gt;&amp;gt;time &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Invert links (create structure outlink-&amp;gt;inlinks). This process creates the &lt;code&gt;linkdb&lt;/code&gt; directory on the HDFS, erase it if you need to repeat the process: &lt;/p&gt;
&lt;p&gt;echo -e "Invert\n$(date)" &amp;gt;&amp;gt;time; ${HADOOP_HOME}/bin/hadoop jar ${SCRIPTS_DIR}/nutchwax-job-0.11.0-SNAPSHOT.jar invert outputs ; date &amp;gt;&amp;gt;time &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create indexes. This process creates the &lt;code&gt;indexes&lt;/code&gt; directory on the HDFS, erase it if you need to repeat the process: &lt;/p&gt;
&lt;p&gt;echo -e "Index\n$(date)" &amp;gt;&amp;gt;time; ${HADOOP_HOME}/bin/hadoop jar ${SCRIPTS_DIR}/nutchwax-job-0.11.0-SNAPSHOT.jar index outputs; date &amp;gt;&amp;gt;time &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Merge indexes partitions into one. This process creates the &lt;code&gt;index&lt;/code&gt; directory on the HDFS, erase it if you need to repeat the process: &lt;/p&gt;
&lt;p&gt;echo -e "Merge Indexes\n$(date)" &amp;gt;&amp;gt;time;${HADOOP_HOME}/bin/hadoop jar ${SCRIPTS_DIR}/nutchwax-job-0.11.0-SNAPSHOT.jar merge outputs; date &amp;gt;&amp;gt;time &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get indexes from HDFS: &lt;/p&gt;
&lt;p&gt;echo -e "copyFromHDFS\n$(date)" &amp;gt;&amp;gt;time;${HADOOP_HOME}/bin/hadoop fs -get outputs /data/outputs; date &amp;gt;&amp;gt;time &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After getting the index to a particular machnie, sort indexes with IndexSorter: &lt;/p&gt;
&lt;p&gt;echo -e "IndexSorter\n$(date)" &amp;gt;&amp;gt;time; ${HADOOP_HOME}/bin/hadoop jar ${SCRIPTS_DIR}/nutchwax-job-0.11.0-SNAPSHOT.jar class org.apache.nutch.indexer.IndexSorterArquivoWeb /data/outputs; date &amp;gt;&amp;gt;time &lt;br /&gt;
cd /data/outputs&lt;br /&gt;
mv index index-ORIGINAL&lt;br /&gt;
mv index-sorted index&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pruning Indexes, the posting lists of the five fields (content, title, anchor, url and host) are pruned. All documents on the posting lists of mime types not searchable are discarded. Fields stored not on index can also be discarded using the "-del" option followed by the field names. Execute the command without parameters to see the help description. Execute the following command to prune the index on directory $INDEX_DIR, that will be stored on directory $INDEX_DIR_OUT. &lt;/p&gt;
&lt;p&gt;export INDEX_DIR=/data/outputs/index&lt;br /&gt;
export INDEX_DIR_OUT=/data/outputs/index-PRUNNING&lt;br /&gt;
echo -e "PruningIndexes\n$(date)" &amp;gt;&amp;gt;time;java -Xmx5000m -classpath ${SCRIPTS_DIR}/pwalucene-1.0.0-SNAPSHOT.jar org.apache.lucene.pruning.PruningTool -impl arquivo -in $INDEX_DIR -out $INDEX_DIR_OUT -del pagerank:pPsv,outlinks:pPsv -t 1;date &amp;gt;&amp;gt;time;&lt;br /&gt;
mv $INDEX_DIR /data/outputs/index-SORTED&lt;br /&gt;
mv $INDEX_DIR_OUT $INDEX_DIR&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Stopwords, the searching system ignores all stopwords in queries. Stopwords are defined in the stopwords.cache file inside the index directory. The format of the file is a stopword per line, e.g. There is a file in the &lt;code&gt;SCRIPTS_DIR&lt;/code&gt; with the pwa stopwords file: &lt;/p&gt;
&lt;p&gt;a&lt;br /&gt;
in&lt;br /&gt;
de&lt;br /&gt;
...&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create file /data/outputs/index/blacklist.cache: &lt;/p&gt;
&lt;p&gt;touch /data/outputs/index/blacklist.cache&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tuning memory for Index, the quantity of memory RAM for the Hadoop search servers, define the environment variable &lt;code&gt;HADOOP_HEAPSIZE&lt;/code&gt; sets the memory of the JVM (Xmx parameter). The entry &lt;code&gt;export HADOOP_HEAPSIZE=12000&lt;/code&gt; (Xmx=12 000 MB) should be set in file &lt;code&gt;${COLLECTIONS_DIR}/test_collection_hadoop/hadoop-env.sh&lt;/code&gt;. The &lt;code&gt;HADOOP_HEAPSIZE&lt;/code&gt; should be proportional to the size of the collection: &lt;/p&gt;
&lt;p&gt;HADOOP_HEAPSIZE (in GB) = DOCS/7&lt;br /&gt;
Example:&lt;br /&gt;
  * For a collection of 130 Million documents the RAM memory whould be 19 GB, ´HADOOP_HEAPSIZE=19000´&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run in the machine with arcproxy or change arcproxy locationdb, the directory &lt;code&gt;pwa-technologies/PwaArchive-access/projects/wayback/wayback-webapp/target/wayback-1.2.1/WEB-INF/lib&lt;/code&gt; has to be available to the command. &lt;/p&gt;
&lt;p&gt;cat &lt;span&gt;[DESTINATION_FILE.txt]&lt;/span&gt; | awk -F"/" '{print $NF" "$0}' &amp;gt; tmp_arcs | WAYBACK_HOME=pwa-technologies/PwaArchive-access/projects/wayback/wayback-webapp/target/wayback-1.2.1/WEB-INF/lib ${SCRIPTS_DIR}/location-client add-stream &lt;a href="http://127.0.0.1:8080/arcproxy/locationdb" rel="nofollow"&gt;http://127.0.0.1:8080/arcproxy/locationdb&lt;/a&gt; &amp;lt; tmp_arcs ; rm -f tmp_arcs &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the file search-servers.txt with the correct hostname, server, the directory for hadoop server(&lt;code&gt;/opt/searcher/collections/test_collection_hadoop&lt;/code&gt;) and the directory for the index &lt;code&gt;/data/outputs&lt;/code&gt;. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Start search servers as indicated in &lt;a class="" href="../Install"&gt;Install&lt;/a&gt; (start-slave-searchers.sh). &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a list of errors from a crawl log of Heritrix crawler. &lt;/p&gt;
&lt;p&gt;cat crawl.log | sed 's/  */ /g' | cut -d ' ' -f2,4 | egrep -v "^2" | egrep -v "^-" | egrep -v "^1 " | egrep -v "^0 " &amp;gt; errors.urls&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Process to create a blacklist of documents not redirecting properly. It uses a log file from the crawler software, the file is a text file with URLs that did not return HTTP OK. The format is: &lt;/p&gt;
&lt;p&gt;404 &lt;a href="http://614.pt/robots.txt" rel="nofollow"&gt;http://614.pt/robots.txt&lt;/a&gt;&lt;br /&gt;
 404 &lt;a href="http://8mm.weblog.com.pt/robots.txt" rel="nofollow"&gt;http://8mm.weblog.com.pt/robots.txt&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;the parameters for the utility are: &lt;code&gt;[index path] [url base] [number threads] [startDoc or 0(first)] [lastDoc exclusively or -1(all)] [errorsFile or nothing]&lt;/code&gt; If the errorsFile parameter is not added, then all documents from the index will be tested. &lt;code&gt;Note:&lt;/code&gt; the program will test the URLs &lt;a href="http://hostname/wayback/wayback/id?index?" rel="nofollow"&gt;http://hostname/wayback/wayback/id?index?&lt;/a&gt;, where index must be 0. &lt;/p&gt;
&lt;p&gt;Documents can be excluded manually by adding their ids to the blacklist of the specific index. &lt;/p&gt;
&lt;p&gt;Command: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;echo -e &amp;quot;Blacklist\n$(date)&amp;quot; &amp;gt;&amp;gt;time;java -classpath &lt;span class="cp"&gt;${&lt;/span&gt;&lt;span class="n"&gt;SCRIPTS_DIR&lt;/span&gt;&lt;span class="cp"&gt;}&lt;/span&gt;/pwalucene-1.0.0-SNAPSHOT.jar org.apache.lucene.search.caches.PwaBlacklistCache /data/outputs/index 
 http://hostname:8080/wayback/wayback 30 0 -1 errors.urls &amp;gt;lixo1 2&amp;gt;lixo2 ;date&amp;gt;&amp;gt;time
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Indexing Finished. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Tue, 17 Dec 2013 15:54:48 -0000</pubDate><guid>https://sourceforge.netcfd82cb7a5241f666d46c11c8c56a72a308295ec</guid></item></channel></rss>