This is a detailed guide to setup cloud miners (cpu+gpu) on Amazon EC2. I put together this guide for user oda.krell, who was kind enough to give me a very nice tip for it, so thanks should also go to oda.krell.
OK,
So here goes (assuming you have your ec2 account all set up and linked to credit card, which you can do here:
http://aws.amazon.com/ec2/ ):
1) Click on EC2, and then click on Spot Requests under Instances on left sidebar.
2) Click Request Spot Instances blue button near top, and then click Community AMIs and search for XMRminer. Select XMRminer2.
3) For Instance Type, select GPU instances g2.2xlarge, click next and set your maximum price (kind of expensive now, need to do like $0.09 per hour, used to be more like $0.06).
4) Click Review and Launch and then click Launch. At this point you need to setup your ssh keys. I did this a while ago, so I don't remember exact details, but it should be pretty straightforward. Here is a link to Amazon's official tutorial on key pair creation:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.htmlLet me know if you have issues.
5) Make yourself a cup of tea and wait 30-120 seconds while your instance is prepared.
6) You'll need to ssh into your instance. On Linux you just put your ssh keys in ~/.ssh and set permissions for 400 (I think), and if you ssh from that folder, that's all you need to do. I think on Windows, using Putty, you need to maybe convert the key to putty's format using an extra putty tool. Let me know if you need additional help with this. Here are Amazon's official links on how to connect if you're having trouble:
ssh/Linux -
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html Putty/Windows -
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.htmlMore Putty -
http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/getting-started-deploy-app-connect.html7) Click on Instances in the left sidebar, and you should see a g2.2xlarge instance with green circle that says running. Click that and then click Connect at the top, and it should give you your IP address to connect to with some instructions.
8 ) On Linux your ssh command should look like:
Use ubuntu as user not root.
9) Maybe it's more like 180-300 seconds. Drink some tea while waiting.
10) When it prompts you to permanently add key, click "yes".
11) Now, you need to edit cpustart.sh and gpustart.sh in your home directory using either vi or nano, unless you want to mine to my XMR address
It looks like if you want to mine directly to exchange, just replace my XMR address in both files with YourExchangeXMRAddress.YourExchangePaymentID.
12) You need to run two commands, one to make gpuminer work, and other to make cpuminer much faster:
sudo ldconfig /usr/local/cuda-5.5/lib64
sudo sysctl -w vm.nr_hugepages=24
13) I just made another script called start.sh to launch both miners at once, and it seems to work. So do:
then vi or nano start.sh and add:
#!/bin/bash
screen /home/ubuntu/cpustart.sh
screen /home/ubuntu/gpustart.sh
then:
and then launch with:
You need the screen so that when you disconnect your ssh session, the miners keep mining.
That's it. You can disconnect and both miners should be hashing away. You can ssh back in and run
and you should see minerd and ccminer listed in the processes somewhere near the bottom.
If you want to launch a shitload of instances, then obviously you want to automate this process and not do it manually every time. In this case, you need to make sure you edit the files so that they have your XMR address and not mine, and create the start.sh script in home directory, then edit the rc.local file by doing:
and add the following lines:
ldconfig /usr/local/cuda-5.5/lib64
sysctl -w vm.nr_hugepages=24
screen /home/ubuntu/start.sh
This way, as soon as the instance boots up, it should autolaunch the miners. I haven't tried this final automation part (as I don't normally launch a shitload of instances), but I think this should work, and I'm gonna verify it now.
Now, go back to your EC2 console, right-click on the g2.2xlarge instance in your Instances window, and select Create Image. This will sever your connection and cause a reboot, but you will now have your own image/AMI that you can launch 10s or 100s or 1000s of, just by entering however many instances you want when filling out your spot request form.
I just tried the rc.local thing, and it seems to auto-launch ccminer and minerd
If you would like to send me some coins for tip, here is btc:
1Gy2BQKMVjvWdRnG3Ktwm2cXdEyL8ZdqvE
and xmr addresses:
49jkaP1xDZrEYaWxtoToPzitbQh6Z7Vv8c3MwtP49wsZhJUR5VojrxcKgb76zT8XRU5AAWHVptx4RgxgLb5fX7iM2vBSKXA
Let me know if you have any questions or anything. And if you want to repost anywhere, I don't mind. Good luck