{"id":1073,"date":"2013-03-04T14:32:32","date_gmt":"2013-03-04T14:32:32","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=1073"},"modified":"2013-03-04T14:39:14","modified_gmt":"2013-03-04T14:39:14","slug":"aws-server-migrationscaleup-debian","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2013\/03\/aws-server-migrationscaleup-debian\/","title":{"rendered":"AWS server migration\/scaleup (debian)"},"content":{"rendered":"<p>I&#8217;m using AWS (EC2) for a lot of my work at the moment, I generally run things out of a microinstance, however sometimes I need to scaleup to a larger system to run something computationally intensive. I&#8217;m using debian, and this is the script I&#8217;m currently using to do this. You&#8217;ll need to setup euca-tools, and have .eucarc files for the regions you want to use, but this might help point you in the right direction:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/bash\r\n\r\n# Region select\r\nREGION=EU\r\necho $REGION\r\n\r\n#for new regions you need to:\r\n#euca-add-keypair keypair_for_regular_debian_machine &gt; keypair_private_$REGION.asc_complete\r\n#chmod 0600 keypair_private_$REGION.asc_complete\r\n\r\ncd ~\r\ncp .eucarc_eu .eucarc\r\n\r\n# start instance\r\nif &#x5B; &quot;$REGION&quot; == &quot;EU&quot; ]\r\nthen\r\n  euca-run-instances --instance-type m1.xlarge ami-8992a5fd -k keypair_for_regular_debian_machine\r\nfi\r\n\r\nif &#x5B; &quot;$REGION&quot; == &quot;JP&quot; ]\r\nthen\r\n  echo &quot;JP&quot;\r\n  euca-run-instances --instance-type m1.xlarge ami-22a80223 -k keypair_for_regular_debian_machine\r\nfi\r\n\r\nsleep 30\r\n\r\n# setup remote system\r\nexport NEWSERVER=`euca-describe-instances | tail -n 1 | awk '{print $4}'`\r\nssh -oStrictHostKeyChecking=no -i keypair_private_$REGION.asc_complete root@$NEWSERVER useradd --shell \/bin\/bash new\r\nssh -oStrictHostKeyChecking=no -i keypair_private_$REGION.asc_complete root@$NEWSERVER mkdir  \/home\/new\r\nssh -oStrictHostKeyChecking=no -i keypair_private_$REGION.asc_complete root@$NEWSERVER chowan new:users \/home\/new\r\nssh -oStrictHostKeyChecking=no -i keypair_private_$REGION.asc_complete root@$NEWSERVER chmod 777 \/home\/new\r\nssh -oStrictHostKeyChecking=no -i keypair_private_$REGION.asc_complete root@$NEWSERVER apt-get update\r\nssh -oStrictHostKeyChecking=no -i keypair_private_$REGION.asc_complete root@$NEWSERVER apt-get -y install make g++ vim gnuplot unison\r\nscp -oStrictHostKeyChecking=no -r -i keypair_private_$REGION.asc_complete \/home\/new root@$NEWSERVER:\/home\/new\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using AWS (EC2) for a lot of my work at the moment, I generally run things out of a microinstance, however sometimes I need to scaleup to a larger system to run something computationally intensive. I&#8217;m using debian, and this is the script I&#8217;m currently using to do this. You&#8217;ll need to setup euca-tools, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1073","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-hj","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=1073"}],"version-history":[{"count":3,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1073\/revisions"}],"predecessor-version":[{"id":1076,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1073\/revisions\/1076"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=1073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=1073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=1073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}