This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# Example: sudo symlink-java jdk1.8.0_40.jdk jdk1.8.0_45.jdk | |
OLD_JDK=$1 | |
NEW_JDK=$2 | |
SYMLINK_DIR=/usr/bin | |
TARGET_DIR=/Library/Java/JavaVirtualMachines/$NEW_JDK/Contents/Home/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elastic-mapreduce --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the word count from local HDFS. | |
elastic-mapreduce -j j-2XP9O9IRLHHBU \ | |
--jar s3n://emr-examples.dius.com.au/java/emr-examples.jar \ | |
--main-class au.com.dius.emr.CommonCrawlTool \ | |
--arg -D --arg target.words=hello,world \ | |
--arg -D --arg base.uri=hdfs:///common-crawl \ | |
--arg -D --arg max.segments=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bulk copy a crawl segment from S3 to the running cluster. | |
elastic-mapreduce -j j-2XP9O9IRLHHBU \ | |
--jar /home/hadoop/lib/emr-s3distcp-1.0.jar \ | |
--arg --src --arg s3://aws-publicdatasets/common-crawl/parse-output/segment/1346823845675 \ | |
--arg --srcPattern --arg '.*textData.*' \ | |
--arg --dest --arg hdfs:///common-crawl/parse-output/segment/1346823845675 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./src/ruby/common_crawl_input.rb 2>/dev/null \ | |
| ./src/ruby/common_crawl_mapper.rb hello,world \ | |
| sort -t$'\t' -k1 \ | |
| ./src/ruby/common_crawl_reducer.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the word against 15 crawl segments | |
elastic-mapreduce -j j-2XP9O9IRLHHBU \ | |
--jar s3n://emr-examples.dius.com.au/java/emr-examples.jar \ | |
--main-class au.com.dius.emr.CommonCrawlTool \ | |
--arg -D --arg target.words=hello,world \ | |
--arg -D --arg max.segments=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the word count against a single crawl segment. | |
elastic-mapreduce -j j-2XP9O9IRLHHBU \ | |
--jar s3n://emr-examples.dius.com.au/java/emr-examples.jar \ | |
--main-class au.com.dius.emr.CommonCrawlTool \ | |
--arg -D --arg target.words=hello,world \ | |
--arg -D --arg max.segments=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launch a cluster from the spot market. | |
# | |
# This time we specify --alive to keep the cluster running until we | |
# manually terminate it. | |
elastic-mapreduce \ | |
--create \ | |
--name "Common Crawl word count" \ | |
--alive \ | |
--enable-debugging \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Word count, Java-fied. | |
# | |
# In this implementation, the job knows how to discover its input URIs based | |
# on the max.segments argument, which specifies how many crawl segments | |
# to process. | |
# | |
# See the code for details. | |
$ elastic-mapreduce \ | |
--create \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launch a cluster and run the word count against a single crawl segment. | |
$ elastic-mapreduce \ | |
--create \ | |
--name "Common Crawl word count" \ | |
--enable-debugging \ | |
--stream \ | |
--ami-version latest \ | |
--instance-group master --instance-count 1 --instance-type m2.2xlarge \ | |
--instance-group core --instance-count 10 --instance-type c1.xlarge \ |
NewerOlder