Skip to content

Instantly share code, notes, and snippets.

@yoshi0309
Created April 1, 2015 15:02
Show Gist options
  • Save yoshi0309/084f66eba95adfe5fdf6 to your computer and use it in GitHub Desktop.
Save yoshi0309/084f66eba95adfe5fdf6 to your computer and use it in GitHub Desktop.
#!/bin/bash -ex
# run only on MASTER node.
if grep -Fq "\"isMaster\": true" /mnt/var/lib/info/instance.json ; then
# open the ssh port...
perl -pi -e 's/^#?Port 22$/Port 22\nPort 443/' /etc/ssh/sshd_config
/etc/init.d/sshd restart
# install scala and sbt.
# scala is in standard bootstrap action of EMR. so you dont need to install by yourself.
wget https://dl.bintray.com/sbt/rpm/sbt-0.13.7.rpm
sudo rpm -ivh sbt-0.13.7.rpm
# install solr and start.
wget http://ftp.meisei-u.ac.jp/mirror/apache/dist/lucene/solr/4.10.3/solr-4.10.3.zip
unzip solr-4.10.3.zip
mv solr-4.10.3 /home/hadoop/solr
cp -r /home/hadoop/solr/example/solr/collection1 /home/hadoop/solr/example/solr/collection2
echo "name=collection2" > /home/hadoop/solr/example/solr/collection2/core.properties
/home/hadoop/solr/bin/solr start
# download source.
sudo yum install git -y
git clone https://bitbucket.org/yoshi0309/urge-recommend-u2i.git
cd urge-recommend-u2i
git checkout develop
# build and package.
sbt package
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment