Hot answers tagged

24

Install Java Runtime 1.8 sudo yum install java-1.8.0 or if you need a java compiler and other developer tools: sudo yum install java-1.8.0-openjdk-devel Then use the alternatives command to make Java 1.8 the default. sudo /usr/sbin/alternatives --config java If you prefer you can remove Java 1.7 with sudo yum remove java-1.7.0-openjdk but remove ...


20

My comment could probably use some clarification. I spouted off with the eloquence of an inebriated yak: I have never wanted to set myself on fire so much as I do now. Why? Why would I say such a thing? Mostly because I'm an awful person. However, aside from that, I can explain my outburst by going over the original post piecemeal: I like to know ...


10

The best way to protect your EC2 keypairs, which are just SSH keys, is to encrypt them with a passphrase (and follow your normal password management process for that passphrase). Assuming you are using linux, you can use ssh-keygen -p -f $file to encrypt the key. You should keep a backup, preferably physically secured (i.e. a thumb drive in a safety ...


8

As far as I'm aware the configuration wizard for AWS-EB configures an EC2 AutoScaling group for you automatically with a default desired running instances count of 1. That is why every time you try to terminate an instance the instance is relaunched. I would therefore suggest removing AutoScaling group(s) and probably also load balancer configurations that ...


8

Amazon notes in their documentation on T2 (burstable) instances that while these instances normally have 30 CPU credits initially, there are limits to how this initial credit will be applied. There are limits to how many T2 instances will launch or start with the initial CPU credit, which by default is set to 100 launches or starts of any T2 ...


7

No, the data on your ephemeral drive will not be there. Honestly, though, if you have to ask anything about the resiliency of data on the ephemeral drive, you're doing it wrong. To use EC2 correctly, you must assume that you will lose your ephemeral storage.


6

To stay up to date you can now (2015-08-31) subscribe to AWS public IP address changes via SNS. Subscribe to the topic: arn:aws:sns:us-east-1:806199016981:AmazonIpSpaceChanged Every time the addresses are changed, you get a message like this: { "create-time":"yyyy-mm-ddThh:mm:ss+00:00", "synctoken":"0123456789", "md5":"...


6

For instance store-backed EC2 instances, one trick is to add a comment to the user data script containing a version number, date, or similar, then change that whenever you want the instance recreated: { "Resources" : { "MyEC2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { // ... other ...


6

It is not a cron issue, rather wget restarting the download after reaching the default timeout of 900 seconds: --read-timeout=seconds Set the read (and write) timeout to seconds seconds. The "time" of this timeout refers to idle time: if, at any point in the download, no data is received for more than the specified number of ...


5

Updated answer from the aws docs: Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. In the navigation bar, verify your region. In the navigation panel, click AMIs. Select the AMI, click Actions, and then click Deregister. When prompted for confirmation, click Continue. In the navigation pane, click Snapshots. Select the snapshot, click ...


5

Just to improve on the above answer, which is correct. The following works great: location /elb-status { access_log off; return 200 'A-OK!'; # because default content-type is application/octet-stream, # browser will offer to "save the file"... # the next line allows you to see it in the browser so you can test add_header Content-...


5

According to this, this command can be used: ssh-keygen -f id_rsa -e -m pem This will convert your public key to an OpenSSL compatible format. Double check if AWS isn't asking for a (X.509) certificate in PEM format, which would be a different thing than your SSH keys.


5

The instance that you launched without a public ip will stay without one as it is only assigned when you launch the instance. Even having a subnet with the auto assign public ip switched on will not assign a public ip to your instance if when you launched the instance you chose not to have a public ip. The only way I know is to select assign a public ip ...


5

Is this even possible in EC2? No, not using their ASG product. The whole point of using an ASG (and honestly, doing more or less anything on EC2), is that your individual compute instances should not retain any state that you can't easily and quickly re-create. This means: keep data in a database of some sort keep static assets in S3 build a centralized ...


5

This is precisely what EC2's user data functionality is for. You can provide a shell script that makes your required changes, or even better than that, have the system pull its intended configuration from your Configuration Management solution (Ansible, Salt, etc.).


5

You'll want to replace the two GoDaddy nameservers with the four Route53 ones. To prevent downtime, ensure you have the same records in both GoDaddy and Route53 before making the nameserver changes.


5

I understand that you're looking for specific reasons why this isn't a good idea, and as your own research has shown, Domain Controllers can be turned off for short periods of time with little or no risk, but my entire point is that this isn't something that anybody does as a normal practice and contradicts best practice. You're free to do anything you want ...


5

Rather than discuss whether or not this is a great idea, which you've already stated you don't want to do, let's instead discuss what you lose when you don't have access to a domain controller. AD Logins. Cached credentials would work, if the user had logged on before, but new domain logins would fail. Network shares. Your Kerberos ticket duration and ...


5

As of now EBS is the most reliable option you have on AWS. It's not only better, its also easy to take snapshots and re-attach to another instance. We have very large Ec2 instances which are EBS based that are used by media site and have not had any issue like this. Apart from that Amazon guarantees 99.95% uptime for this service and will give a refund ...


5

You have two main options: Pre-bake your application and configuration into an AMI, which the ASG uses to launch new instances. Use the user-data launch configuration field to have the instance itself download your application and configure it as part of the boot process. I generally prefer #1 as it gets the instance up and running faster. #2 is more ...


5

VPC. Always VPC. Even with a single instance, I always deploy in VPC. There's a reason that AWS now defaults to deploying EC2 instances in a VPC. By doing this, you gain significant benefits in security and flexibility going forward that are not possible in EC2-Classic.


5

According to the folks at bootstrap-vz it is an issue with growpart on Debian Jessie (#784004). For detailed information on this exact issue please read the Github issue: Debian 8 AMI only using 8GB partition #267 In the meantime, it only takes two simple commands to easily resize the partition: :# sudo parted /dev/xvda resizepart 2 Warning: Partition /...


5

90%-95% SLA is useless, it is better to don't say it (even old shared hosting guarantee better SLA for your webapp), you need at least 99.5% for serious business. If you need better SLA (and your customers will!) you need to have mirrored resources (2 app servers, 2 database servers etc.), setup loadbalancing and failover (like keepalived, haproxy, squid etc....


5

I've managed this with the following which works well. Create /etc/cron.d/reboot with the contents below. Note - It's been a while, you should check syntax. @reboot root run-parts /etc/cron.reboot Create a folder /etc/cron.reboot From there it's a matter of dropping files in to the cron.reboot folder.


5

Q: Can I use certificates on Amazon EC2 instances or on my own servers? No. At this time, certificates provided by ACM can only be used with specific AWS services. Q: With which AWS services can I use certificates provided by ACM? You can use ACM with the following AWS services: • Elastic Load Balancing • Amazon CloudFront ...


5

I have an Amazon EC2 instance, and I need to prevent access for a user. OK, well for the purposes of this question, it does not matter that it's an EC2 instance. It's a linux server. Right now the team (we're amateurs) shares a PEM key that is used to access the server through SFTP. Oh, HELL no. :) Seriously, though. There is absolutely no ...


5

This is not how EC2 works. All EC2 instances sit behind Amazon's NAT infrastructure. It is not possible to directly assign an EIP or other public IP directly to an EC2 instance.


4

Unresponsive != no heartbeats. The kernel is still running. AWS has no way of knowing that you've consumed all of your memory. AWS Cloudwatch monitoring is really just the bare minimum you should do. If you need more detailed monitoring, you'll need to roll your own.


4

I have written a small script like below to get the IP list: #!/bin/bash for i in `aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name ASGName | grep -i instanceid | awk '{ print $2}' | cut -d',' -f1| sed -e 's/"//g'` do aws ec2 describe-instances --instance-ids $i | grep -i PrivateIpAddress | awk '{ print $2 }' | head -1 | cut -d"," -...


4

An Elastic IP address, is an address that you request from AWS and is allocated to you until you choose to release it back to AWS. This means that only you can use this IP address. The benefits of an Elastic IP address over an auto-assigned Public IP address are: It's constant, meaning it won't change. It's movable, meaning you can move it from instance ...



Only top voted, non community-wiki answers of a minimum length are eligible