- AWS Console (Instances): "Launch Instance" - ami-b51ff8dc (latest alestic-64 jaunty) m1.large.
- AWS Console (Volumes): "Create Volume" - 50GB EBS in same zone as the AMI instance, "Attach Volume" to AMI instance at /dev/sdf.
- Copy "Public DNS" address for the AMI from the AWS Console (referred to as {PUBLIC-DNS.amazonaws.com} from now on).
- Connect using SSH to root@{PUBLIC-DNS.amazonaws.com}.
aptitude update aptitude safe-upgrade aptitude install xfsprogs tomcat6 apache2 libxpp3-java
- Format the EBS block:
mkfs.xfs /dev/sdf echo "/dev/sdf /solr xfs noatime 0 0" >> /etc/fstab mkdir /solr mount /solr
- scp your Solr conf folder (containing solr-config.xml and schema.xml) and solr.war into /solr/
- Set dataDir in /solr/conf/solrconfig.xml to /solr.
- scp your Tomcat context file into /etc/tomcat6/Catalina/localhost/
- TOMCAT6_SECURITY=no in /etc/default/tomcat6 *warning: insecure*
- /etc/init.d/tomcat6 restart (tail -f /var/log/tomcat6/localhost.*.log -c 5000 for errors).
- Add proxy settings to the VirtualHost block of /etc/apache2/sites-enabled/000-default:
ProxyPass /tomcat http://localhost:8080 ProxyPassReverse /tomcat http://localhost:8080
- a2enmod proxy_http
- comment out Deny from all in /etc/apache2/mods-enabled/proxy.conf *warning: insecure*
- apache2ctl restart (tail -f /var/log/apache2/error.log for errors)
- Test URLs:
- http://{PUBLIC-DNS.amazonaws.com}/
- http://{PUBLIC-DNS.amazonaws.com}/tomcat
- http://{PUBLIC-DNS.amazonaws.com}/tomcat/solr
Once you've posted data to Solr, you can umount /dev/sdf, disconnect the EBS volume and shut down the instance (store an image of it on S3 first, for later use, if you like). The EBS volume - and Lucene index - will remain available for connecting to new instances, and you can create snapshots at any time.