amazon-ec2

How to override AssociatePublicIpAddress for an EC2 instance

随声附和 提交于 2021-02-20 03:00:59
问题 We have several EC2 instances that are in a private subnet, but gets a public IP address every time that instance is launched. That private subnet has "Auto-assign Public IP" property set to No, but what happens is when instance was created, it got AssociatePublicIpAddress property set to true. Now we don't know how to reset AssociatePublicIpAddress to false without terminating the instances. I'd expect aws ec2 create-network-interface would have an option for that, but it's not the case. EC2

Scikit-learn machine learning models training using multiple CPUs

允我心安 提交于 2021-02-19 06:50:13
问题 I want to decrease training time of my models by using a high end EC2 instance. So I tried c5.18xlarge instance with 2 CPUs and run a few models with parameter n_jobs=-1 but I noticed that only one CPU was utilized: Can I somehow make Scikit-learn to use all CPUs? 回答1: Try adding: import multiprocessing multiprocessing.set_start_method('forkserver') at the top of your code, before running or importing anything. That's a well-known issue with multiprocessing in python. 来源: https:/

AWS EC2 User Data script to allocate Elastic IP

╄→尐↘猪︶ㄣ 提交于 2021-02-19 05:31:39
问题 I am attempting to create my own bastion host for a VPC, and created an auto-scaling group with min/max instances of 1. In my launch configurations, I specify the following for the ec2 user data: #! INSTANCE_ID=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id` aws ec2 associate-address --instance-id $INSTANCE_ID --allocation-id eipalloc-my-eip-id --allow-reassociation The goal of this user data is to immediately associate an Elastic IP address with my newly created EC2

AWS EC2 User Data script to allocate Elastic IP

梦想的初衷 提交于 2021-02-19 05:30:08
问题 I am attempting to create my own bastion host for a VPC, and created an auto-scaling group with min/max instances of 1. In my launch configurations, I specify the following for the ec2 user data: #! INSTANCE_ID=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id` aws ec2 associate-address --instance-id $INSTANCE_ID --allocation-id eipalloc-my-eip-id --allow-reassociation The goal of this user data is to immediately associate an Elastic IP address with my newly created EC2

How do I determine what a given AWS Security Group is associated with?

瘦欲@ 提交于 2021-02-19 02:18:16
问题 The AWS EC2 Security Groups documentation mentions that "Security groups for EC2-VPC have additional capabilities that aren't supported by security groups for EC2-Classic" but the Security Groups dashboard does not provide any information on the "capabilities" of attributes of Security Groups that allow me to distinguish what kind of Security Group I'm looking at or what it is attached to, so that, for example I can't figure out whether I can consolidate Security Groups and share them across

How do I determine what a given AWS Security Group is associated with?

核能气质少年 提交于 2021-02-19 02:14:39
问题 The AWS EC2 Security Groups documentation mentions that "Security groups for EC2-VPC have additional capabilities that aren't supported by security groups for EC2-Classic" but the Security Groups dashboard does not provide any information on the "capabilities" of attributes of Security Groups that allow me to distinguish what kind of Security Group I'm looking at or what it is attached to, so that, for example I can't figure out whether I can consolidate Security Groups and share them across

Trigger Lambda Function in AWS when the message is present in SQS Queue

落爺英雄遲暮 提交于 2021-02-18 06:59:13
问题 I am using AWS Lambda function to process the messages in Queue it's working fine. But i need to execute this Lambda function when messages available or added in SQS queue. Is it possible to trigger the Lambda function based on SQS queue.Please suggest one method to achieve this goal. 回答1: Invoking Lambda functions from SQS queues is not directly supported. You can see the list of available triggers here: http://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html Possible

Extremely long response time using requests

旧巷老猫 提交于 2021-02-16 18:40:10
问题 Description I have an AWS ec2 instance (ubuntu 16) that runs a Python application. In which I call some Facebook Account Kit APIs and also Google Play Store APIs. They all work perfectly fine until I reboot the instance two weeks before. After the reboot, the requests take more than 5 mins to finish, which is totally not acceptable. I have to manually set the timeout to over 10mins in order to let the request to be finished. The problem only occurs on one of my servers, I run with the same

Deploying Docker to AWS Elastic Beanstalk — how to forward port to host? (port binding)

旧街凉风 提交于 2021-02-16 14:56:46
问题 I have a project set up with CircleCI that I am using to auto-deploy to Elastic Beanstalk. My EBS environment is a single container, auto-scaling, web environment. I am trying to run a service that listens on raw socket port 8080. My Dockerfile: FROM golang:1.4.2 ... EXPOSE 8080 My Dockerrun.aws.json.template: { "AWSEBDockerrunVersion": "1", "Authentication": { "Bucket": "<bucket>", "Key": "<key>" }, "Image": { "Name": "project/hello:<TAG>", "Update": "true" }, "Ports": [ { "ContainerPort":

Why multi-threaded python program slow on ec2 micro-instance?

佐手、 提交于 2021-02-16 09:23:28
问题 I am working on a Online Judge code checker.My code uses multi-threading in python 2.7.The same program on my local machine (i core 3 RAM 4GB) evaluates about 1000 submisions in 1 minute 10 seconds. But when I run it on ec2 micro instance(about 600 MB RAM) it takes about 40 minutes(It gets slow for some random seconds).To know the reason I broke down things. First this is how my evaluator works: I have a main program worker.py , which creates multiple threads The main thread pulls submissions