aws-ec2

spark-ec2 not recognized when lauching cluster on windows 8.1

会有一股神秘感。 提交于 2019-12-11 02:07:13
问题 I'm a complete beginner on spark. I'm trying to run spark on Amazon EC2, but my system does not recognize "spark-ec2" or "./spark-ec2". It says "spark-ec2" is not recognized as an internal or external command. I followed the instruction here to launch a cluster. I would like to use Scala, how do I make it work? 回答1: Add PYTHON PATH environment variable with boto. PYTHONPATH="${SPARK_EC2_DIR}/third_party/boto-2.4.1.zip/boto-2.4.1:$PYTHONPATH" And execute the python script 回答2: In order to run

How to change aws-ec2 instance type?

邮差的信 提交于 2019-12-08 21:00:40
I wanted to change the aws-ec2 instance type(e.g from micro to large or vice-versa etc) using Boto3. What are the factors that needs to be care while changing the instance type of ec2-instances. Here is my code: def get_ec2_boto3_connection(region, arn): sess = Boto3Connecton.get_boto3_session(arn) ec2_conn = sess.client(service_name='ec2', region_name=region) return ec2_conn def change_instance_type(arn,region): ec2_conn=get_ec2_boto3_connection(region,arn) ec2_conn.modify_instance_attribute(InstanceId=id,Attribute='instanceType'InstanceType={ 'Value': 'm4.large' }) What are the accountable

To check whether AWS instance is up after reboot using python

有些话、适合烂在心里 提交于 2019-12-08 08:45:18
问题 Is there a way to check if an AWS instance has finally come up in python either using boto3 or otherwise. The running state doesnt differentiate between rebooting and finally up phase. 回答1: If you just want to check that a remote port is open you could use the built-in socket package. Here's a quick modification of this answer of waiting for a remote port to open: import socket import time def wait_for_socket(host, port, retries, retry_delay=30): retry_count = 0 while retry_count <= retries:

Private docker registry authentication in aws ecs optimized AMI is not successful

 ̄綄美尐妖づ 提交于 2019-12-06 05:42:05
问题 I am writing a terraform script for creating a ECS auto scaling cluster. I have created a cluster and added ec2 container instances in to it.My task definition file contains a image that is from a Private docker repository.I go through the aws official documentation and find a page for Private Registry Authentication and tried both of the ways as described there. using dockercfg the docker way I put my ecs.config file in the S3 bucket and during the instance boot time I passed the user data

Retrieving public dns of EC2 instance with BOTO3

可紊 提交于 2019-12-05 14:38:17
问题 I'm using ipython to get an understanding of Boto3 and interacting with EC2 instances. Here is the code I'm using to create an instance: import boto3 ec2 = boto3.resource('ec2') client = boto3.client('ec2') new_instance = ec2.create_instances( ImageId='ami-d05e75b8', MinCount=1, MaxCount=1, InstanceType='t2.micro', KeyName=<name_of_my_key>, SecurityGroups=['<security_group_name>'], DryRun = False ) This starts an EC2 instance fine, and I can get the public DNS name, ip and other info from the

How to specify root volume size of core-os ec2 instance using boto3?

让人想犯罪 __ 提交于 2019-12-04 23:59:50
问题 I cannot figure out from documentation and source code how to define size of the root device. You can specify N additional block devices using BlockDeviceMappings section where you can declare their sizes. But there is no way to set size of the root volume. So it always create an instance with root volume of size 8GB which is the default value. 回答1: Ran into this issue myself today, probably to late for the original poster, but in case anyone else stumbles across this question later I did the

Private docker registry authentication in aws ecs optimized AMI is not successful

一笑奈何 提交于 2019-12-04 10:06:52
I am writing a terraform script for creating a ECS auto scaling cluster. I have created a cluster and added ec2 container instances in to it.My task definition file contains a image that is from a Private docker repository.I go through the aws official documentation and find a page for Private Registry Authentication and tried both of the ways as described there. using dockercfg the docker way I put my ecs.config file in the S3 bucket and during the instance boot time I passed the user data as #!/bin/bash yum install -y aws-cli aws s3 cp s3://<my_bucket_name>/ecs.config /etc/ecs/ecs.config In

Retrieving public dns of EC2 instance with BOTO3

孤者浪人 提交于 2019-12-04 00:58:54
I'm using ipython to get an understanding of Boto3 and interacting with EC2 instances. Here is the code I'm using to create an instance: import boto3 ec2 = boto3.resource('ec2') client = boto3.client('ec2') new_instance = ec2.create_instances( ImageId='ami-d05e75b8', MinCount=1, MaxCount=1, InstanceType='t2.micro', KeyName=<name_of_my_key>, SecurityGroups=['<security_group_name>'], DryRun = False ) This starts an EC2 instance fine, and I can get the public DNS name, ip and other info from the AWS console. But, when I try to get the public DNS using Boto, by doing this: new_instance[0].public

How to specify root volume size of core-os ec2 instance using boto3?

三世轮回 提交于 2019-12-03 16:10:40
I cannot figure out from documentation and source code how to define size of the root device. You can specify N additional block devices using BlockDeviceMappings section where you can declare their sizes. But there is no way to set size of the root volume. So it always create an instance with root volume of size 8GB which is the default value. Ran into this issue myself today, probably to late for the original poster, but in case anyone else stumbles across this question later I did the following: import boto3 ec2 = boto3.resource('ec2', region_name='eu-west-1', aws_access_key_id='my-key',

Can I add dns name in aws security group

混江龙づ霸主 提交于 2019-12-03 07:28:17
问题 I have to connect my dynamic IP(which changes every time) to the AWS EC2 machine. For this I mapped my public IP to the domain name(xyz.com), now I am trying to add it to security group. But AWS security group not allowing to add DNS names. Is it the right process to do it, if not please suggest me. 回答1: Security Groups and ACLs are not able to resolve DNS hostnames. You can use the AWS CLI to script the update of your IP dynamic address: aws ec2 authorize-security-group-ingress --group-id -